You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

  1. From 6c01778cf7ff81d9a571291fee615b65961ca1d5 Mon Sep 17 00:00:00 2001
  2. From: David Woodhouse <dwmw2@infradead.org>
  3. Date: Thu, 28 Jun 2018 16:21:11 +0100
  4. Subject: [PATCH] Fix inline functions to use 'static inline'
  5. With just 'inline', if the compiler decides not to inline them, it isn't
  6. required to emit them at all. For some targets with -Os that is causing
  7. build failures.
  8. Perhaps we might consider using '__attribute__((always_inline))' for
  9. GCC builds, but 'static inline' is a good start.
  10. ---
  11. src/rtl_adsb.c | 8 ++++----
  12. src/rtl_power.c | 2 +-
  13. 2 files changed, 5 insertions(+), 5 deletions(-)
  14. diff --git a/src/rtl_adsb.c b/src/rtl_adsb.c
  15. index 9087de4..7aea8dd 100644
  16. --- a/src/rtl_adsb.c
  17. +++ b/src/rtl_adsb.c
  18. @@ -183,7 +183,7 @@ int magnitute(uint8_t *buf, int len)
  19. return len/2;
  20. }
  21. -inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d)
  22. +static inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d)
  23. /* takes 4 consecutive real samples, return 0 or 1, BADSAMPLE on error */
  24. {
  25. int bit, bit_p;
  26. @@ -224,17 +224,17 @@ inline uint16_t single_manchester(uint16_t a, uint16_t b, uint16_t c, uint16_t d
  27. return BADSAMPLE;
  28. }
  29. -inline uint16_t min16(uint16_t a, uint16_t b)
  30. +static inline uint16_t min16(uint16_t a, uint16_t b)
  31. {
  32. return a<b ? a : b;
  33. }
  34. -inline uint16_t max16(uint16_t a, uint16_t b)
  35. +static inline uint16_t max16(uint16_t a, uint16_t b)
  36. {
  37. return a>b ? a : b;
  38. }
  39. -inline int preamble(uint16_t *buf, int i)
  40. +static inline int preamble(uint16_t *buf, int i)
  41. /* returns 0/1 for preamble at index i */
  42. {
  43. int i2;
  44. diff --git a/src/rtl_power.c b/src/rtl_power.c
  45. index 00f4d9f..625d818 100644
  46. --- a/src/rtl_power.c
  47. +++ b/src/rtl_power.c
  48. @@ -250,7 +250,7 @@ void sine_table(int size)
  49. }
  50. }
  51. -inline int16_t FIX_MPY(int16_t a, int16_t b)
  52. +static inline int16_t FIX_MPY(int16_t a, int16_t b)
  53. /* fixed point multiply and scale */
  54. {
  55. int c = ((int)a * (int)b) >> 14;
  56. --
  57. 2.7.4