[c,standard] use C99 inline

This commit is contained in:
akallabeth
2025-09-22 12:19:02 +02:00
parent c0b1debb80
commit 74648eb3a9
75 changed files with 555 additions and 551 deletions

View File

@@ -182,7 +182,7 @@ typedef struct gdi_palette gdiPalette;
#if defined(WITH_FREERDP_DEPRECATED)
#define GetBitsPerPixel(...) FreeRDPGetBitsPerPixel(__VA_ARGS__)
#endif
static INLINE UINT32 FreeRDPGetBitsPerPixel(UINT32 format)
static inline UINT32 FreeRDPGetBitsPerPixel(UINT32 format)
{
return (((format) >> 24) & 0x3F);
}
@@ -195,7 +195,7 @@ typedef struct gdi_palette gdiPalette;
#if defined(WITH_FREERDP_DEPRECATED)
#define ColorHasAlpha(...) FreeRDPColorHasAlpha(__VA_ARGS__)
#endif
static INLINE BOOL FreeRDPColorHasAlpha(UINT32 format)
static inline BOOL FreeRDPColorHasAlpha(UINT32 format)
{
UINT32 alpha = (((format) >> 12) & 0x0F);
@@ -252,7 +252,7 @@ typedef struct gdi_palette gdiPalette;
#if defined(WITH_FREERDP_DEPRECATED)
#define ConvertColor(...) FreeRDPConvertColor(__VA_ARGS__)
#endif
static INLINE UINT32 FreeRDPConvertColor(UINT32 color, UINT32 srcFormat, UINT32 dstFormat,
static inline UINT32 FreeRDPConvertColor(UINT32 color, UINT32 srcFormat, UINT32 dstFormat,
const gdiPalette* palette)
{
BYTE r = 0;
@@ -274,7 +274,7 @@ typedef struct gdi_palette gdiPalette;
#if defined(WITH_FREERDP_DEPRECATED)
#define GetBytesPerPixel(...) FreeRDPGetBytesPerPixel(__VA_ARGS__)
#endif
static INLINE UINT32 FreeRDPGetBytesPerPixel(UINT32 format)
static inline UINT32 FreeRDPGetBytesPerPixel(UINT32 format)
{
return (FreeRDPGetBitsPerPixel(format) + 7) / 8;
}

View File

@@ -35,46 +35,46 @@ extern "C"
} Array##T; \
typedef BOOL Array##T##Cb(T* v, void* data); \
\
static INLINE void array_##TLOWER##_init(Array##T* a) \
static inline void array_##TLOWER##_init(Array##T* a) \
{ \
WINPR_ASSERT(a); \
a->values = NULL; \
a->nvalues = 0; \
} \
\
static INLINE size_t array_##TLOWER##_size(const Array##T* a) \
static inline size_t array_##TLOWER##_size(const Array##T* a) \
{ \
WINPR_ASSERT(a); \
return a->nvalues; \
} \
\
static INLINE T* array_##TLOWER##_data(const Array##T* a) \
static inline T* array_##TLOWER##_data(const Array##T* a) \
{ \
WINPR_ASSERT(a); \
return a->values; \
} \
\
static INLINE const T* array_##TLOWER##_cdata(const Array##T* a) \
static inline const T* array_##TLOWER##_cdata(const Array##T* a) \
{ \
WINPR_ASSERT(a); \
return (const T*)a->values; \
} \
\
static INLINE T array_##TLOWER##_get(const Array##T* a, size_t idx) \
static inline T array_##TLOWER##_get(const Array##T* a, size_t idx) \
{ \
WINPR_ASSERT(a); \
WINPR_ASSERT(a->nvalues > idx); \
return a->values[idx]; \
} \
\
static INLINE void array_##TLOWER##_set(Array##T* a, size_t idx, T v) \
static inline void array_##TLOWER##_set(Array##T* a, size_t idx, T v) \
{ \
WINPR_ASSERT(a); \
WINPR_ASSERT(a->nvalues > idx); \
a->values[idx] = v; \
} \
\
static INLINE BOOL array_##TLOWER##_append(Array##T* a, T v) \
static inline BOOL array_##TLOWER##_append(Array##T* a, T v) \
{ \
WINPR_ASSERT(a); \
T* tmp = realloc(a->values, sizeof(T) * (a->nvalues + 1)); \
@@ -87,7 +87,7 @@ extern "C"
return TRUE; \
} \
\
static INLINE BOOL array_##TLOWER##_contains(const Array##T* a, T v) \
static inline BOOL array_##TLOWER##_contains(const Array##T* a, T v) \
{ \
WINPR_ASSERT(a); \
\
@@ -100,7 +100,7 @@ extern "C"
return FALSE; \
} \
\
static INLINE BOOL array_##TLOWER##_foreach(Array##T* a, Array##T##Cb cb, void* data) \
static inline BOOL array_##TLOWER##_foreach(Array##T* a, Array##T##Cb cb, void* data) \
{ \
WINPR_ASSERT(a); \
for (size_t i = 0; i < a->nvalues; i++) \
@@ -112,13 +112,13 @@ extern "C"
return TRUE; \
} \
\
static INLINE void array_##TLOWER##_reset(Array##T* a) \
static inline void array_##TLOWER##_reset(Array##T* a) \
{ \
WINPR_ASSERT(a); \
a->nvalues = 0; \
} \
\
static INLINE void array_##TLOWER##_uninit(Array##T* a) \
static inline void array_##TLOWER##_uninit(Array##T* a) \
{ \
WINPR_ASSERT(a); \
free(a->values); \