Skip to content

Commit 9047eef

Browse files
dwmw2steve-m
authored andcommitted
Fix inline functions to use 'static inline'
With just 'inline', if the compiler decides not to inline them, it isn't required to emit them at all. For some targets with -Os that is causing build failures, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86360. Perhaps we might consider using '__attribute__((always_inline))' for GCC builds, but 'static inline' is a good start. Signed-off-by: Steve Markgraf <[email protected]>
1 parent 8a26aba commit 9047eef

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/rtl_adsb.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ int magnitute(uint8_t *buf, int len)
183183
return len/2;
184184
}
185185

186-
inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d)
186+
static inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d)
187187
/* takes 4 consecutive real samples, return 0 or 1, BADSAMPLE on error */
188188
{
189189
int bit, bit_p;
@@ -224,17 +224,17 @@ inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d
224224
return BADSAMPLE;
225225
}
226226

227-
inline uint16_t min16(uint16_t a, uint16_t b)
227+
static inline uint16_t min16(uint16_t a, uint16_t b)
228228
{
229229
return a<b ? a : b;
230230
}
231231

232-
inline uint16_t max16(uint16_t a, uint16_t b)
232+
static inline uint16_t max16(uint16_t a, uint16_t b)
233233
{
234234
return a>b ? a : b;
235235
}
236236

237-
inline int preamble(uint16_t *buf, int i)
237+
static inline int preamble(uint16_t *buf, int i)
238238
/* returns 0/1 for preamble at index i */
239239
{
240240
int i2;

src/rtl_power.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void sine_table(int size)
250250
}
251251
}
252252

253-
inline int16_t FIX_MPY(int16_t a, int16_t b)
253+
static inline int16_t FIX_MPY(int16_t a, int16_t b)
254254
/* fixed point multiply and scale */
255255
{
256256
int c = ((int)a * (int)b) >> 14;

0 commit comments

Comments
 (0)