Skip to content

Commit 1cc16c3

Browse files
cyyevercopybara-github
authored andcommitted
Fix warning C4141: 'inline': used more than once (#22440)
The fix works by merging `inline` into `FORCE_INLINE_ATTR` Closes #22440 COPYBARA_INTEGRATE_REVIEW=#22440 from cyyever:fix_inline 85c3c59 PiperOrigin-RevId: 782042400
1 parent 8351926 commit 1cc16c3

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/google/protobuf/port_def.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
185185
#elif defined(__GNUC__)
186186
#define PROTOBUF_ALWAYS_INLINE inline __attribute__((always_inline))
187187
#elif defined(_MSC_VER)
188-
#define PROTOBUF_ALWAYS_INLINE inline __forceinline
188+
#define PROTOBUF_ALWAYS_INLINE __forceinline
189189
#else
190190
#define PROTOBUF_ALWAYS_INLINE inline
191191
#endif

third_party/utf8_range/utf8_range.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@
2222
#include <string.h>
2323

2424
#if defined(__GNUC__)
25-
#define FORCE_INLINE_ATTR __attribute__((always_inline))
25+
#define FORCE_INLINE_ATTR __attribute__((always_inline)) inline
2626
#elif defined(_MSC_VER)
2727
#define FORCE_INLINE_ATTR __forceinline
2828
#else
29-
#define FORCE_INLINE_ATTR
29+
#define FORCE_INLINE_ATTR inline
3030
#endif
3131

32-
static FORCE_INLINE_ATTR inline uint64_t utf8_range_UnalignedLoad64(
32+
static FORCE_INLINE_ATTR uint64_t utf8_range_UnalignedLoad64(
3333
const void* p) {
3434
uint64_t t;
3535
memcpy(&t, p, sizeof t);
3636
return t;
3737
}
3838

39-
static FORCE_INLINE_ATTR inline int utf8_range_AsciiIsAscii(unsigned char c) {
39+
static FORCE_INLINE_ATTR int utf8_range_AsciiIsAscii(unsigned char c) {
4040
return c < 128;
4141
}
4242

43-
static FORCE_INLINE_ATTR inline int utf8_range_IsTrailByteOk(const char c) {
43+
static FORCE_INLINE_ATTR int utf8_range_IsTrailByteOk(const char c) {
4444
return (int8_t)(c) <= (int8_t)(0xBF);
4545
}
4646

@@ -175,7 +175,7 @@ static inline const char* utf8_range_SkipAscii(const char* data,
175175
#include "utf8_range_neon.inc"
176176
#endif
177177

178-
static FORCE_INLINE_ATTR inline size_t utf8_range_Validate(
178+
static FORCE_INLINE_ATTR size_t utf8_range_Validate(
179179
const char* data, size_t len, int return_position) {
180180
if (len == 0) return 1 - return_position;
181181
// Save buffer start address for later use

third_party/utf8_range/utf8_range_neon.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* straightforward.
77
*/
88

9-
static FORCE_INLINE_ATTR inline size_t utf8_range_ValidateUTF8Simd(
9+
static FORCE_INLINE_ATTR size_t utf8_range_ValidateUTF8Simd(
1010
const char* data_original, const char* data, const char* end,
1111
int return_position) {
1212
const uint8x16_t first_len_tbl = {

third_party/utf8_range/utf8_range_sse.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <smmintrin.h>
33
#include <tmmintrin.h>
44

5-
static FORCE_INLINE_ATTR inline size_t utf8_range_ValidateUTF8Simd(
5+
static FORCE_INLINE_ATTR size_t utf8_range_ValidateUTF8Simd(
66
const char* data_original, const char* data, const char* end,
77
int return_position) {
88
/* This code checks that utf-8 ranges are structurally valid 16 bytes at once

0 commit comments

Comments
 (0)