From 74648eb3a904464ec77b7dacb433504fd1de421e Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 22 Sep 2025 12:19:02 +0200 Subject: [PATCH] [c,standard] use C99 inline --- channels/ainput/common/ainput_common.h | 2 +- channels/cliprdr/cliprdr_common.c | 2 +- channels/rdpear/common/rdpear-common/ndr.h | 2 +- channels/rdpecam/client/camera.h | 4 +- channels/rdpgfx/server/rdpgfx_main.c | 20 +-- client/Windows/wf_cliprdr.c | 2 +- client/common/client.c | 2 +- client/common/file.c | 4 +- client/common/test/TestClientCmdLine.c | 2 +- include/freerdp/codec/color.h | 8 +- include/freerdp/utils/pod_arrays.h | 22 +-- libfreerdp/codec/bitmap.c | 36 ++-- libfreerdp/codec/bulk.c | 4 +- libfreerdp/codec/clear.c | 2 +- libfreerdp/codec/color.c | 16 +- libfreerdp/codec/color.h | 8 +- libfreerdp/codec/dsp.c | 2 +- libfreerdp/codec/h264.c | 2 +- libfreerdp/codec/interleaved.c | 14 +- libfreerdp/codec/ncrush.c | 12 +- libfreerdp/codec/neon/rfx_neon.c | 10 +- libfreerdp/codec/planar.c | 28 +-- libfreerdp/codec/progressive.c | 99 ++++++----- libfreerdp/codec/region.c | 2 +- libfreerdp/codec/rfx.c | 109 ++++++------ libfreerdp/codec/rfx_decode.c | 2 +- libfreerdp/codec/rfx_differential.h | 4 +- libfreerdp/codec/rfx_dwt.c | 2 +- libfreerdp/codec/rfx_quantization.c | 4 +- libfreerdp/codec/rfx_rlgr.c | 2 +- .../codec/test/TestFreeRDPCodecRemoteFX.c | 2 +- libfreerdp/codec/xcrush.c | 4 +- libfreerdp/codec/yuv.c | 19 +- libfreerdp/codec/zgfx.c | 10 +- libfreerdp/common/addin.c | 2 +- libfreerdp/core/aad.c | 2 +- libfreerdp/core/input.h | 2 +- libfreerdp/core/orders.c | 52 +++--- libfreerdp/core/tcp.h | 18 +- libfreerdp/core/update.h | 8 +- libfreerdp/crypto/base64.c | 8 +- libfreerdp/crypto/opensslcompat.h | 4 +- libfreerdp/gdi/bitmap.c | 4 +- libfreerdp/gdi/brush.h | 2 +- libfreerdp/gdi/gdi.h | 4 +- libfreerdp/gdi/region.c | 16 +- libfreerdp/primitives/neon/prim_YUV_neon.c | 28 +-- libfreerdp/primitives/prim_add.c | 2 +- libfreerdp/primitives/prim_colors.c | 16 +- libfreerdp/primitives/prim_copy.c | 17 +- libfreerdp/primitives/prim_internal.h | 44 ++--- libfreerdp/primitives/prim_shift.c | 16 +- libfreerdp/primitives/sse/prim_YUV_sse4.1.c | 8 +- libfreerdp/primitives/sse/prim_copy_avx2.c | 4 +- libfreerdp/primitives/sse/prim_copy_sse4_1.c | 4 +- server/shadow/shadow_client.c | 20 +-- winpr/include/winpr/bitstream.h | 14 +- winpr/include/winpr/collections.h | 6 +- winpr/include/winpr/crt.h | 14 +- winpr/include/winpr/endian.h | 84 ++++----- winpr/include/winpr/error.h | 2 +- winpr/include/winpr/intrin.h | 8 +- winpr/include/winpr/nt.h | 4 +- winpr/include/winpr/platform.h | 4 - winpr/include/winpr/pool.h | 10 +- winpr/include/winpr/stream.h | 164 +++++++++--------- winpr/libwinpr/crt/alignment.c | 2 +- winpr/libwinpr/handle/handle.h | 10 +- winpr/libwinpr/sspi/Kerberos/kerberos.c | 2 +- winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c | 8 +- winpr/libwinpr/sspi/sspi_gss.h | 2 +- winpr/libwinpr/thread/apc.c | 2 +- winpr/libwinpr/utils/collections/HashTable.c | 20 +-- winpr/libwinpr/utils/collections/StreamPool.c | 4 +- winpr/test/TestIntrinsics.c | 2 +- 75 files changed, 555 insertions(+), 551 deletions(-) diff --git a/channels/ainput/common/ainput_common.h b/channels/ainput/common/ainput_common.h index 34442f7d9..9176692f4 100644 --- a/channels/ainput/common/ainput_common.h +++ b/channels/ainput/common/ainput_common.h @@ -25,7 +25,7 @@ #include -static INLINE const char* ainput_flags_to_string(UINT64 flags, char* buffer, size_t size) +static inline const char* ainput_flags_to_string(UINT64 flags, char* buffer, size_t size) { char number[32] = { 0 }; diff --git a/channels/cliprdr/cliprdr_common.c b/channels/cliprdr/cliprdr_common.c index f4d40d1d2..e83d81bed 100644 --- a/channels/cliprdr/cliprdr_common.c +++ b/channels/cliprdr/cliprdr_common.c @@ -148,7 +148,7 @@ static void cliprdr_write_file_contents_request(wStream* s, Stream_Write_UINT32(s, request->clipDataId); /* clipDataId (4 bytes) */ } -static INLINE void cliprdr_write_lock_unlock_clipdata(wStream* s, UINT32 clipDataId) +static inline void cliprdr_write_lock_unlock_clipdata(wStream* s, UINT32 clipDataId) { Stream_Write_UINT32(s, clipDataId); } diff --git a/channels/rdpear/common/rdpear-common/ndr.h b/channels/rdpear/common/rdpear-common/ndr.h index e674b9689..cec5121c0 100644 --- a/channels/rdpear/common/rdpear-common/ndr.h +++ b/channels/rdpear/common/rdpear-common/ndr.h @@ -122,7 +122,7 @@ extern "C" void ndr_context_free(NdrContext* context); - static INLINE void ndr_context_destroy(NdrContext** pcontext) + static inline void ndr_context_destroy(NdrContext** pcontext) { WINPR_ASSERT(pcontext); ndr_context_free(*pcontext); diff --git a/channels/rdpecam/client/camera.h b/channels/rdpecam/client/camera.h index a0a1e7a1a..d813389f8 100644 --- a/channels/rdpecam/client/camera.h +++ b/channels/rdpecam/client/camera.h @@ -122,11 +122,11 @@ typedef struct } CameraDeviceStream; -static INLINE CAM_MEDIA_FORMAT streamInputFormat(CameraDeviceStream* stream) +static inline CAM_MEDIA_FORMAT streamInputFormat(CameraDeviceStream* stream) { return stream->formats.inputFormat; } -static INLINE CAM_MEDIA_FORMAT streamOutputFormat(CameraDeviceStream* stream) +static inline CAM_MEDIA_FORMAT streamOutputFormat(CameraDeviceStream* stream) { return stream->formats.outputFormat; } diff --git a/channels/rdpgfx/server/rdpgfx_main.c b/channels/rdpgfx/server/rdpgfx_main.c index 908ba9cb4..1a876f86e 100644 --- a/channels/rdpgfx/server/rdpgfx_main.c +++ b/channels/rdpgfx/server/rdpgfx_main.c @@ -70,12 +70,12 @@ static BOOL checkCapsAreExchangedInt(RdpgfxServerContext* context, const char* f * * @return new stream */ -static INLINE UINT32 rdpgfx_pdu_length(UINT32 dataLen) +static inline UINT32 rdpgfx_pdu_length(UINT32 dataLen) { return RDPGFX_HEADER_SIZE + dataLen; } -static INLINE UINT rdpgfx_server_packet_init_header(wStream* s, UINT16 cmdId, UINT32 pduLength) +static inline UINT rdpgfx_server_packet_init_header(wStream* s, UINT16 cmdId, UINT32 pduLength) { RDPGFX_HEADER header; header.flags = 0; @@ -93,7 +93,7 @@ static INLINE UINT rdpgfx_server_packet_init_header(wStream* s, UINT16 cmdId, UI * @param s stream * @param start saved start pos of the packet in the stream */ -static INLINE BOOL rdpgfx_server_packet_complete_header(wStream* s, size_t start) +static inline BOOL rdpgfx_server_packet_complete_header(wStream* s, size_t start) { const size_t current = Stream_GetPosition(s); const size_t cap = Stream_Capacity(s); @@ -215,7 +215,7 @@ error: * * @return 0 on success, otherwise a Win32 error code */ -static INLINE UINT rdpgfx_server_single_packet_send(RdpgfxServerContext* context, wStream* s) +static inline UINT rdpgfx_server_single_packet_send(RdpgfxServerContext* context, wStream* s) { /* Fill actual length */ rdpgfx_server_packet_complete_header(s, 0); @@ -439,7 +439,7 @@ static UINT rdpgfx_send_delete_surface_pdu(RdpgfxServerContext* context, return rdpgfx_server_single_packet_send(context, s); } -static INLINE BOOL rdpgfx_write_start_frame_pdu(wStream* s, const RDPGFX_START_FRAME_PDU* pdu) +static inline BOOL rdpgfx_write_start_frame_pdu(wStream* s, const RDPGFX_START_FRAME_PDU* pdu) { if (!Stream_EnsureRemainingCapacity(s, 8)) return FALSE; @@ -448,7 +448,7 @@ static INLINE BOOL rdpgfx_write_start_frame_pdu(wStream* s, const RDPGFX_START_F return TRUE; } -static INLINE BOOL rdpgfx_write_end_frame_pdu(wStream* s, const RDPGFX_END_FRAME_PDU* pdu) +static inline BOOL rdpgfx_write_end_frame_pdu(wStream* s, const RDPGFX_END_FRAME_PDU* pdu) { if (!Stream_EnsureRemainingCapacity(s, 4)) return FALSE; @@ -507,7 +507,7 @@ static UINT rdpgfx_send_end_frame_pdu(RdpgfxServerContext* context, const RDPGFX * * @return estimated size */ -static INLINE UINT32 rdpgfx_estimate_h264_avc420(const RDPGFX_AVC420_BITMAP_STREAM* havc420) +static inline UINT32 rdpgfx_estimate_h264_avc420(const RDPGFX_AVC420_BITMAP_STREAM* havc420) { /* H264 metadata + H264 stream. See rdpgfx_write_h264_avc420 */ return sizeof(UINT32) /* numRegionRects */ @@ -522,7 +522,7 @@ static INLINE UINT32 rdpgfx_estimate_h264_avc420(const RDPGFX_AVC420_BITMAP_STRE * * @return estimated size */ -static INLINE UINT32 rdpgfx_estimate_surface_command(const RDPGFX_SURFACE_COMMAND* cmd) +static inline UINT32 rdpgfx_estimate_surface_command(const RDPGFX_SURFACE_COMMAND* cmd) { RDPGFX_AVC420_BITMAP_STREAM* havc420 = NULL; RDPGFX_AVC444_BITMAP_STREAM* havc444 = NULL; @@ -568,7 +568,7 @@ static INLINE UINT32 rdpgfx_estimate_surface_command(const RDPGFX_SURFACE_COMMAN * * @return 0 on success, otherwise a Win32 error code */ -static INLINE UINT16 rdpgfx_surface_command_cmdid(const RDPGFX_SURFACE_COMMAND* cmd) +static inline UINT16 rdpgfx_surface_command_cmdid(const RDPGFX_SURFACE_COMMAND* cmd) { if (cmd->codecId == RDPGFX_CODECID_CAPROGRESSIVE || cmd->codecId == RDPGFX_CODECID_CAPROGRESSIVE_V2) @@ -626,7 +626,7 @@ static UINT rdpgfx_write_h264_metablock(wLog* log, wStream* s, const RDPGFX_H264 * * @return 0 on success, otherwise a Win32 error code */ -static INLINE UINT rdpgfx_write_h264_avc420(wLog* log, wStream* s, +static inline UINT rdpgfx_write_h264_avc420(wLog* log, wStream* s, RDPGFX_AVC420_BITMAP_STREAM* havc420) { UINT error = CHANNEL_RC_OK; diff --git a/client/Windows/wf_cliprdr.c b/client/Windows/wf_cliprdr.c index 085d4d5d7..61207cfbc 100644 --- a/client/Windows/wf_cliprdr.c +++ b/client/Windows/wf_cliprdr.c @@ -1092,7 +1092,7 @@ static UINT32 get_local_format_id_by_name(wfClipboard* clipboard, const TCHAR* f return 0; } -static INLINE BOOL file_transferring(wfClipboard* clipboard) +static inline BOOL file_transferring(wfClipboard* clipboard) { return get_local_format_id_by_name(clipboard, CFSTR_FILEDESCRIPTORW) ? TRUE : FALSE; } diff --git a/client/common/client.c b/client/common/client.c index 8f75f68a1..3db3c1049 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -1648,7 +1648,7 @@ BOOL freerdp_client_send_wheel_event(rdpClientContext* cctx, UINT16 mflags) } #if defined(CHANNEL_AINPUT_CLIENT) -static INLINE BOOL ainput_send_diff_event(rdpClientContext* cctx, UINT64 flags, INT32 x, INT32 y) +static inline BOOL ainput_send_diff_event(rdpClientContext* cctx, UINT64 flags, INT32 x, INT32 y) { UINT rc = 0; diff --git a/client/common/file.c b/client/common/file.c index 053a54891..ffd31fd6e 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -1063,14 +1063,14 @@ BOOL freerdp_client_parse_rdp_file_ex(rdpFile* file, const char* name, rdp_file_ return status; } -static INLINE void freerdp_client_file_string_reset(char** target) +static inline void freerdp_client_file_string_reset(char** target) { WINPR_ASSERT(target); freerdp_client_file_string_check_free(*target); *target = (void*)~((size_t)NULL); } -static INLINE BOOL FILE_POPULATE_STRING(char** _target, const rdpSettings* _settings, +static inline BOOL FILE_POPULATE_STRING(char** _target, const rdpSettings* _settings, FreeRDP_Settings_Keys_String _option) { WINPR_ASSERT(_target); diff --git a/client/common/test/TestClientCmdLine.c b/client/common/test/TestClientCmdLine.c index f1bca2acf..33b9354b8 100644 --- a/client/common/test/TestClientCmdLine.c +++ b/client/common/test/TestClientCmdLine.c @@ -40,7 +40,7 @@ static void print_test_title(int argc, char** argv) printf("\n"); } -static INLINE BOOL testcase(const char* name, char** argv, size_t argc, int expected_return, +static inline BOOL testcase(const char* name, char** argv, size_t argc, int expected_return, validate_settings_pr validate_settings) { int status = 0; diff --git a/include/freerdp/codec/color.h b/include/freerdp/codec/color.h index 3b8708179..0dffe947b 100644 --- a/include/freerdp/codec/color.h +++ b/include/freerdp/codec/color.h @@ -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; } diff --git a/include/freerdp/utils/pod_arrays.h b/include/freerdp/utils/pod_arrays.h index ef8667d24..b70889ef1 100644 --- a/include/freerdp/utils/pod_arrays.h +++ b/include/freerdp/utils/pod_arrays.h @@ -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); \ diff --git a/libfreerdp/codec/bitmap.c b/libfreerdp/codec/bitmap.c index 0c32cbc2e..0bba3ad46 100644 --- a/libfreerdp/codec/bitmap.c +++ b/libfreerdp/codec/bitmap.c @@ -25,13 +25,13 @@ #include #include -static INLINE UINT16 GETPIXEL16(const void* WINPR_RESTRICT d, UINT32 x, UINT32 y, UINT32 w) +static inline UINT16 GETPIXEL16(const void* WINPR_RESTRICT d, UINT32 x, UINT32 y, UINT32 w) { const BYTE* WINPR_RESTRICT src = (const BYTE*)d + ((y * w + x) * sizeof(UINT16)); return WINPR_ASSERTING_INT_CAST(UINT16, ((UINT16)src[1] << 8) | (UINT16)src[0]); } -static INLINE UINT32 GETPIXEL32(const void* WINPR_RESTRICT d, UINT32 x, UINT32 y, UINT32 w) +static inline UINT32 GETPIXEL32(const void* WINPR_RESTRICT d, UINT32 x, UINT32 y, UINT32 w) { const BYTE* WINPR_RESTRICT src = (const BYTE*)d + ((y * w + x) * sizeof(UINT32)); return (((UINT32)src[3]) << 24) | (((UINT32)src[2]) << 16) | (((UINT32)src[1]) << 8) | @@ -39,7 +39,7 @@ static INLINE UINT32 GETPIXEL32(const void* WINPR_RESTRICT d, UINT32 x, UINT32 y } /*****************************************************************************/ -static INLINE UINT16 IN_PIXEL16(const void* WINPR_RESTRICT in_ptr, UINT32 in_x, UINT32 in_y, +static inline UINT16 IN_PIXEL16(const void* WINPR_RESTRICT in_ptr, UINT32 in_x, UINT32 in_y, UINT32 in_w, UINT16 in_last_pixel) { if (in_ptr == 0) @@ -51,7 +51,7 @@ static INLINE UINT16 IN_PIXEL16(const void* WINPR_RESTRICT in_ptr, UINT32 in_x, } /*****************************************************************************/ -static INLINE UINT32 IN_PIXEL32(const void* WINPR_RESTRICT in_ptr, UINT32 in_x, UINT32 in_y, +static inline UINT32 IN_PIXEL32(const void* WINPR_RESTRICT in_ptr, UINT32 in_x, UINT32 in_y, UINT32 in_w, UINT32 in_last_pixel) { if (in_ptr == 0) @@ -64,7 +64,7 @@ static INLINE UINT32 IN_PIXEL32(const void* WINPR_RESTRICT in_ptr, UINT32 in_x, /*****************************************************************************/ /* color */ -static INLINE UINT16 out_color_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s, +static inline UINT16 out_color_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s, UINT16 in_data) { if (in_count > 0) @@ -96,7 +96,7 @@ static INLINE UINT16 out_color_count_2(UINT16 in_count, wStream* WINPR_RESTRICT /*****************************************************************************/ /* color */ -static INLINE UINT16 out_color_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s, +static inline UINT16 out_color_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s, UINT32 in_data) { if (in_count > 0) @@ -132,7 +132,7 @@ static INLINE UINT16 out_color_count_3(UINT16 in_count, wStream* WINPR_RESTRICT /*****************************************************************************/ /* copy */ -static INLINE UINT16 out_copy_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s, +static inline UINT16 out_copy_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s, wStream* WINPR_RESTRICT in_data) { @@ -165,7 +165,7 @@ static INLINE UINT16 out_copy_count_2(UINT16 in_count, wStream* WINPR_RESTRICT i in_count = out_copy_count_2(in_count, in_s, in_data) /*****************************************************************************/ /* copy */ -static INLINE UINT16 out_copy_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s, +static inline UINT16 out_copy_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s, wStream* WINPR_RESTRICT in_data) { if (in_count > 0) @@ -198,7 +198,7 @@ static INLINE UINT16 out_copy_count_3(UINT16 in_count, wStream* WINPR_RESTRICT i /*****************************************************************************/ /* bicolor */ -static INLINE UINT16 out_bicolor_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s, +static inline UINT16 out_bicolor_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s, UINT16 in_color1, UINT16 in_color2) { if (in_count > 0) @@ -232,7 +232,7 @@ static INLINE UINT16 out_bicolor_count_2(UINT16 in_count, wStream* WINPR_RESTRIC /*****************************************************************************/ /* bicolor */ -static INLINE UINT16 out_bicolor_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s, +static inline UINT16 out_bicolor_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s, UINT32 in_color1, UINT32 in_color2) { if (in_count > 0) @@ -270,7 +270,7 @@ static INLINE UINT16 out_bicolor_count_3(UINT16 in_count, wStream* WINPR_RESTRIC /*****************************************************************************/ /* fill */ -static INLINE UINT16 out_fill_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s) +static inline UINT16 out_fill_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s) { if (in_count > 0) { @@ -298,7 +298,7 @@ static INLINE UINT16 out_fill_count_2(UINT16 in_count, wStream* WINPR_RESTRICT i /*****************************************************************************/ /* fill */ -static INLINE UINT16 out_fill_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s) +static inline UINT16 out_fill_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s) { if (in_count > 0) { @@ -325,7 +325,7 @@ static INLINE UINT16 out_fill_count_3(UINT16 in_count, wStream* WINPR_RESTRICT i /*****************************************************************************/ /* mix */ -static INLINE UINT16 out_mix_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s) +static inline UINT16 out_mix_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s) { if (in_count > 0) { @@ -353,7 +353,7 @@ static INLINE UINT16 out_mix_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in /*****************************************************************************/ /* mix */ -static INLINE UINT16 out_mix_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s) +static inline UINT16 out_mix_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s) { if (in_count > 0) { @@ -382,7 +382,7 @@ static INLINE UINT16 out_mix_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in /*****************************************************************************/ /* fom */ -static INLINE UINT16 out_from_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s, +static inline UINT16 out_from_count_2(UINT16 in_count, wStream* WINPR_RESTRICT in_s, const int8_t* WINPR_RESTRICT in_mask, size_t in_mask_len) { if (in_count > 0) @@ -414,7 +414,7 @@ static INLINE UINT16 out_from_count_2(UINT16 in_count, wStream* WINPR_RESTRICT i /*****************************************************************************/ /* fill or mix (fom) */ -static INLINE UINT16 out_from_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s, +static inline UINT16 out_from_count_3(UINT16 in_count, wStream* WINPR_RESTRICT in_s, const int8_t* WINPR_RESTRICT in_mask, size_t in_mask_len) { if (in_count > 0) @@ -464,7 +464,7 @@ static INLINE UINT16 out_from_count_3(UINT16 in_count, wStream* WINPR_RESTRICT i bicolor_spin = FALSE; \ } while (0) -static INLINE SSIZE_T freerdp_bitmap_compress_24(const void* WINPR_RESTRICT srcData, UINT32 width, +static inline SSIZE_T freerdp_bitmap_compress_24(const void* WINPR_RESTRICT srcData, UINT32 width, WINPR_ATTR_UNUSED UINT32 height, wStream* WINPR_RESTRICT s, UINT32 byte_limit, UINT32 start_line, wStream* WINPR_RESTRICT temp_s, @@ -774,7 +774,7 @@ static INLINE SSIZE_T freerdp_bitmap_compress_24(const void* WINPR_RESTRICT srcD return lines_sent; } -static INLINE SSIZE_T freerdp_bitmap_compress_16(const void* WINPR_RESTRICT srcData, UINT32 width, +static inline SSIZE_T freerdp_bitmap_compress_16(const void* WINPR_RESTRICT srcData, UINT32 width, WINPR_ATTR_UNUSED UINT32 height, wStream* WINPR_RESTRICT s, UINT32 bpp, UINT32 byte_limit, UINT32 start_line, diff --git a/libfreerdp/codec/bulk.c b/libfreerdp/codec/bulk.c index c804f00bc..c07bbe905 100644 --- a/libfreerdp/codec/bulk.c +++ b/libfreerdp/codec/bulk.c @@ -48,7 +48,7 @@ struct rdp_bulk }; #if defined(WITH_BULK_DEBUG) -static INLINE const char* bulk_get_compression_flags_string(UINT32 flags) +static inline const char* bulk_get_compression_flags_string(UINT32 flags) { flags &= BULK_COMPRESSION_FLAGS_MASK; @@ -96,7 +96,7 @@ UINT16 bulk_compression_max_size(rdpBulk* WINPR_RESTRICT bulk) } #if defined(WITH_BULK_DEBUG) -static INLINE int bulk_compress_validate(rdpBulk* bulk, const BYTE* pSrcData, UINT32 SrcSize, +static inline int bulk_compress_validate(rdpBulk* bulk, const BYTE* pSrcData, UINT32 SrcSize, const BYTE* pDstData, UINT32 DstSize, UINT32 Flags) { int status; diff --git a/libfreerdp/codec/clear.c b/libfreerdp/codec/clear.c index 421ae4ec8..ad5752909 100644 --- a/libfreerdp/codec/clear.c +++ b/libfreerdp/codec/clear.c @@ -1010,7 +1010,7 @@ static BOOL clear_decompress_glyph_data(CLEAR_CONTEXT* WINPR_RESTRICT clear, return TRUE; } -static INLINE BOOL updateContextFormat(CLEAR_CONTEXT* WINPR_RESTRICT clear, UINT32 DstFormat) +static inline BOOL updateContextFormat(CLEAR_CONTEXT* WINPR_RESTRICT clear, UINT32 DstFormat) { if (!clear || !clear->nsc) return FALSE; diff --git a/libfreerdp/codec/color.c b/libfreerdp/codec/color.c index 4d1536409..c8913aa1a 100644 --- a/libfreerdp/codec/color.c +++ b/libfreerdp/codec/color.c @@ -320,7 +320,7 @@ BOOL freerdp_image_copy_from_monochrome(BYTE* WINPR_RESTRICT pDstData, UINT32 Ds return TRUE; } -static INLINE UINT32 freerdp_image_inverted_pointer_color(UINT32 x, UINT32 y, UINT32 format) +static inline UINT32 freerdp_image_inverted_pointer_color(UINT32 x, UINT32 y, UINT32 format) { /** * Inverted pointer colors (where individual pixels can change their @@ -362,12 +362,12 @@ static void fill_gdi_palette_for_icon(const BYTE* colorTable, UINT16 cbColorTabl } } -static INLINE UINT32 div_ceil(UINT32 a, UINT32 b) +static inline UINT32 div_ceil(UINT32 a, UINT32 b) { return (a + (b - 1)) / b; } -static INLINE UINT32 round_up(UINT32 a, UINT32 b) +static inline UINT32 round_up(UINT32 a, UINT32 b) { return b * div_ceil(a, b); } @@ -773,7 +773,7 @@ BOOL freerdp_image_copy_from_pointer_data(BYTE* WINPR_RESTRICT pDstData, UINT32 andMask, andMaskLength, xorBpp, palette); } -static INLINE BOOL overlapping(const BYTE* pDstData, UINT32 nYDst, UINT32 nDstStep, +static inline BOOL overlapping(const BYTE* pDstData, UINT32 nYDst, UINT32 nDstStep, const BYTE* pSrcData, UINT32 nYSrc, UINT32 nSrcStep, UINT32 nHeight) { const uintptr_t src = (uintptr_t)pSrcData; @@ -792,7 +792,7 @@ static INLINE BOOL overlapping(const BYTE* pDstData, UINT32 nYDst, UINT32 nDstSt return FALSE; } -static INLINE BOOL freerdp_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, +static inline BOOL freerdp_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, @@ -822,7 +822,7 @@ static INLINE BOOL freerdp_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstData return TRUE; } -static INLINE BOOL freerdp_image_copy_bgrx32_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, +static inline BOOL freerdp_image_copy_bgrx32_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, @@ -852,7 +852,7 @@ static INLINE BOOL freerdp_image_copy_bgrx32_bgrx32(BYTE* WINPR_RESTRICT pDstDat return TRUE; } -static INLINE BOOL freerdp_image_copy_generic( +static inline BOOL freerdp_image_copy_generic( BYTE* WINPR_RESTRICT pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* WINPR_RESTRICT palette, @@ -894,7 +894,7 @@ static INLINE BOOL freerdp_image_copy_generic( return TRUE; } -static INLINE BOOL freerdp_image_copy_no_overlap_dst_alpha( +static inline BOOL freerdp_image_copy_no_overlap_dst_alpha( BYTE* WINPR_RESTRICT pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, DWORD SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* WINPR_RESTRICT palette, diff --git a/libfreerdp/codec/color.h b/libfreerdp/codec/color.h index 5a4f08e78..5db6903ca 100644 --- a/libfreerdp/codec/color.h +++ b/libfreerdp/codec/color.h @@ -28,13 +28,13 @@ #define INT_COLOR_TAG FREERDP_TAG("codec.color.h") -static INLINE DWORD FreeRDPAreColorFormatsEqualNoAlpha_int(DWORD first, DWORD second) +static inline DWORD FreeRDPAreColorFormatsEqualNoAlpha_int(DWORD first, DWORD second) { const DWORD mask = (DWORD) ~(8UL << 12UL); return (first & mask) == (second & mask); } -static INLINE BOOL FreeRDPWriteColor_int(BYTE* WINPR_RESTRICT dst, UINT32 format, UINT32 color) +static inline BOOL FreeRDPWriteColor_int(BYTE* WINPR_RESTRICT dst, UINT32 format, UINT32 color) { switch (FreeRDPGetBitsPerPixel(format)) { @@ -76,7 +76,7 @@ static INLINE BOOL FreeRDPWriteColor_int(BYTE* WINPR_RESTRICT dst, UINT32 format return TRUE; } -static INLINE BOOL FreeRDPWriteColorIgnoreAlpha_int(BYTE* WINPR_RESTRICT dst, UINT32 format, +static inline BOOL FreeRDPWriteColorIgnoreAlpha_int(BYTE* WINPR_RESTRICT dst, UINT32 format, UINT32 color) { switch (format) @@ -102,7 +102,7 @@ static INLINE BOOL FreeRDPWriteColorIgnoreAlpha_int(BYTE* WINPR_RESTRICT dst, UI } } -static INLINE UINT32 FreeRDPReadColor_int(const BYTE* WINPR_RESTRICT src, UINT32 format) +static inline UINT32 FreeRDPReadColor_int(const BYTE* WINPR_RESTRICT src, UINT32 format) { UINT32 color = 0; diff --git a/libfreerdp/codec/dsp.c b/libfreerdp/codec/dsp.c index dbd11f1b0..59ca801ab 100644 --- a/libfreerdp/codec/dsp.c +++ b/libfreerdp/codec/dsp.c @@ -891,7 +891,7 @@ static const INT32 ms_adpcm_coeffs1[7] = { 256, 512, 0, 192, 240, 460, 392 }; static const INT32 ms_adpcm_coeffs2[7] = { 0, -256, 0, 64, 0, -208, -232 }; -static INLINE INT16 freerdp_dsp_decode_ms_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, BYTE sample, +static inline INT16 freerdp_dsp_decode_ms_adpcm_sample(ADPCM* WINPR_RESTRICT adpcm, BYTE sample, size_t channel) { const INT8 nibble = (sample & 0x08 ? (INT8)sample - 16 : (INT8)sample); diff --git a/libfreerdp/codec/h264.c b/libfreerdp/codec/h264.c index 4c09503f8..98646420c 100644 --- a/libfreerdp/codec/h264.c +++ b/libfreerdp/codec/h264.c @@ -171,7 +171,7 @@ static BOOL allocate_h264_metablock(UINT32 QP, RECTANGLE_16* rectangles, return TRUE; } -static INLINE BOOL diff_tile(const RECTANGLE_16* regionRect, BYTE* pYUVData[3], +static inline BOOL diff_tile(const RECTANGLE_16* regionRect, BYTE* pYUVData[3], BYTE* pOldYUVData[3], UINT32 const iStride[3]) { size_t size = 0; diff --git a/libfreerdp/codec/interleaved.c b/libfreerdp/codec/interleaved.c index 5ca8539e9..06e2b7b58 100644 --- a/libfreerdp/codec/interleaved.c +++ b/libfreerdp/codec/interleaved.c @@ -151,7 +151,7 @@ static const char* rle_code_str(UINT32 code) #define buffer_within_range(pbSrc, size, pbEnd) \ buffer_within_range_((pbSrc), (size), (pbEnd), __func__, __FILE__, __LINE__) -static INLINE BOOL buffer_within_range_(const void* pbSrc, size_t size, const void* pbEnd, +static inline BOOL buffer_within_range_(const void* pbSrc, size_t size, const void* pbEnd, const char* fkt, const char* file, size_t line) { WINPR_UNUSED(file); @@ -171,7 +171,7 @@ static INLINE BOOL buffer_within_range_(const void* pbSrc, size_t size, const vo * Reads the supplied order header and extracts the compression * order code ID. */ -static INLINE UINT32 ExtractCodeId(BYTE bOrderHdr) +static inline UINT32 ExtractCodeId(BYTE bOrderHdr) { if ((bOrderHdr & 0xC0U) != 0xC0U) { @@ -312,7 +312,7 @@ static UINT ExtractRunLengthLite(const BYTE* pbOrderHdr, const BYTE* pbEnd, UINT return runLength; } -static INLINE UINT32 ExtractRunLength(UINT32 code, const BYTE* pbOrderHdr, const BYTE* pbEnd, +static inline UINT32 ExtractRunLength(UINT32 code, const BYTE* pbOrderHdr, const BYTE* pbEnd, UINT32* advance) { UINT32 runLength = 0; @@ -375,7 +375,7 @@ static INLINE UINT32 ExtractRunLength(UINT32 code, const BYTE* pbOrderHdr, const #define ensure_capacity(start, end, size, base) \ ensure_capacity_((start), (end), (size), (base), __func__, __FILE__, __LINE__) -static INLINE BOOL ensure_capacity_(const BYTE* start, const BYTE* end, size_t size, size_t base, +static inline BOOL ensure_capacity_(const BYTE* start, const BYTE* end, size_t size, size_t base, const char* fkt, WINPR_ATTR_UNUSED const char* file, size_t line) { @@ -391,13 +391,13 @@ static INLINE BOOL ensure_capacity_(const BYTE* start, const BYTE* end, size_t s return res; } -static INLINE void write_pixel_8(BYTE* _buf, BYTE _pix) +static inline void write_pixel_8(BYTE* _buf, BYTE _pix) { WINPR_ASSERT(_buf); *_buf = _pix; } -static INLINE void write_pixel_24(BYTE* _buf, UINT32 _pix) +static inline void write_pixel_24(BYTE* _buf, UINT32 _pix) { WINPR_ASSERT(_buf); (_buf)[0] = (BYTE)(_pix); @@ -405,7 +405,7 @@ static INLINE void write_pixel_24(BYTE* _buf, UINT32 _pix) (_buf)[2] = (BYTE)((_pix) >> 16); } -static INLINE void write_pixel_16(BYTE* _buf, UINT16 _pix) +static inline void write_pixel_16(BYTE* _buf, UINT16 _pix) { WINPR_ASSERT(_buf); _buf[0] = _pix & 0xFF; diff --git a/libfreerdp/codec/ncrush.c b/libfreerdp/codec/ncrush.c index c13c86940..b83463c58 100644 --- a/libfreerdp/codec/ncrush.c +++ b/libfreerdp/codec/ncrush.c @@ -1918,7 +1918,7 @@ static const UINT32 LOMBaseLUT[30] = { 0x2 /* 29 */ }; -static INLINE UINT16 get_word(const BYTE* data) +static inline UINT16 get_word(const BYTE* data) { UINT16 tmp = 0; @@ -1928,7 +1928,7 @@ static INLINE UINT16 get_word(const BYTE* data) return tmp; } -static INLINE UINT32 get_dword(const BYTE* data) +static inline UINT32 get_dword(const BYTE* data) { UINT32 tmp = 0; WINPR_ASSERT(data); @@ -1939,7 +1939,7 @@ static INLINE UINT32 get_dword(const BYTE* data) return tmp; } -static INLINE BOOL NCrushFetchBits(const BYTE** SrcPtr, const BYTE** SrcEnd, INT32* nbits, +static inline BOOL NCrushFetchBits(const BYTE** SrcPtr, const BYTE** SrcEnd, INT32* nbits, UINT32* bits) { WINPR_ASSERT(SrcPtr); @@ -1976,7 +1976,7 @@ static INLINE BOOL NCrushFetchBits(const BYTE** SrcPtr, const BYTE** SrcEnd, INT return TRUE; } -static INLINE void NCrushWriteStart(UINT32* bits, UINT32* offset, UINT32* accumulator) +static inline void NCrushWriteStart(UINT32* bits, UINT32* offset, UINT32* accumulator) { WINPR_ASSERT(bits); WINPR_ASSERT(offset); @@ -1987,7 +1987,7 @@ static INLINE void NCrushWriteStart(UINT32* bits, UINT32* offset, UINT32* accumu *accumulator = 0; } -static INLINE void NCrushWriteBits(BYTE** DstPtr, UINT32* accumulator, UINT32* offset, UINT32 _bits, +static inline void NCrushWriteBits(BYTE** DstPtr, UINT32* accumulator, UINT32* offset, UINT32 _bits, UINT32 _nbits) { WINPR_ASSERT(DstPtr); @@ -2006,7 +2006,7 @@ static INLINE void NCrushWriteBits(BYTE** DstPtr, UINT32* accumulator, UINT32* o } } -static INLINE void NCrushWriteFinish(BYTE** DstPtr, UINT32 accumulator) +static inline void NCrushWriteFinish(BYTE** DstPtr, UINT32 accumulator) { WINPR_ASSERT(DstPtr); diff --git a/libfreerdp/codec/neon/rfx_neon.c b/libfreerdp/codec/neon/rfx_neon.c index 08499541f..c999adf5c 100644 --- a/libfreerdp/codec/neon/rfx_neon.c +++ b/libfreerdp/codec/neon/rfx_neon.c @@ -233,7 +233,7 @@ static void rfx_dwt_2d_decode_NEON(INT16* buffer, INT16* dwt_buffer) rfx_dwt_2d_decode_block_NEON(buffer, dwt_buffer, 32); } -static INLINE void rfx_idwt_extrapolate_horiz_neon(INT16* restrict pLowBand, size_t nLowStep, +static inline void rfx_idwt_extrapolate_horiz_neon(INT16* restrict pLowBand, size_t nLowStep, const INT16* restrict pHighBand, size_t nHighStep, INT16* restrict pDstBand, size_t nDstStep, size_t nLowCount, @@ -317,7 +317,7 @@ static INLINE void rfx_idwt_extrapolate_horiz_neon(INT16* restrict pLowBand, siz } } -static INLINE void rfx_idwt_extrapolate_vert_neon(const INT16* restrict pLowBand, size_t nLowStep, +static inline void rfx_idwt_extrapolate_vert_neon(const INT16* restrict pLowBand, size_t nLowStep, const INT16* restrict pHighBand, size_t nHighStep, INT16* restrict pDstBand, size_t nDstStep, size_t nLowCount, size_t nHighCount, @@ -458,12 +458,12 @@ static INLINE void rfx_idwt_extrapolate_vert_neon(const INT16* restrict pLowBand } } -static INLINE size_t prfx_get_band_l_count(size_t level) +static inline size_t prfx_get_band_l_count(size_t level) { return (64 >> level) + 1; } -static INLINE size_t prfx_get_band_h_count(size_t level) +static inline size_t prfx_get_band_h_count(size_t level) { if (level == 1) return (64 >> 1) - 1; @@ -471,7 +471,7 @@ static INLINE size_t prfx_get_band_h_count(size_t level) return (64 + (1 << (level - 1))) >> level; } -static INLINE void rfx_dwt_2d_decode_extrapolate_block_neon(INT16* buffer, INT16* temp, +static inline void rfx_dwt_2d_decode_extrapolate_block_neon(INT16* buffer, INT16* temp, size_t level) { size_t nDstStepX; diff --git a/libfreerdp/codec/planar.c b/libfreerdp/codec/planar.c index 9d4cf078c..1a06e36ed 100644 --- a/libfreerdp/codec/planar.c +++ b/libfreerdp/codec/planar.c @@ -110,7 +110,7 @@ static inline BYTE PLANAR_CONTROL_BYTE_RAW_BYTES(UINT32 controlByte) return ((controlByte >> 4) & 0x0F); } -static INLINE UINT32 planar_invert_format(BITMAP_PLANAR_CONTEXT* WINPR_RESTRICT planar, BOOL alpha, +static inline UINT32 planar_invert_format(BITMAP_PLANAR_CONTEXT* WINPR_RESTRICT planar, BOOL alpha, UINT32 DstFormat) { WINPR_ASSERT(planar); @@ -173,15 +173,15 @@ static INLINE UINT32 planar_invert_format(BITMAP_PLANAR_CONTEXT* WINPR_RESTRICT return DstFormat; } -static INLINE BOOL freerdp_bitmap_planar_compress_plane_rle(const BYTE* WINPR_RESTRICT inPlane, +static inline BOOL freerdp_bitmap_planar_compress_plane_rle(const BYTE* WINPR_RESTRICT inPlane, UINT32 width, UINT32 height, BYTE* WINPR_RESTRICT outPlane, UINT32* WINPR_RESTRICT dstSize); -static INLINE BYTE* freerdp_bitmap_planar_delta_encode_plane(const BYTE* WINPR_RESTRICT inPlane, +static inline BYTE* freerdp_bitmap_planar_delta_encode_plane(const BYTE* WINPR_RESTRICT inPlane, UINT32 width, UINT32 height, BYTE* WINPR_RESTRICT outPlane); -static INLINE INT32 planar_skip_plane_rle(const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcSize, +static inline INT32 planar_skip_plane_rle(const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcSize, UINT32 nWidth, UINT32 nHeight) { UINT32 used = 0; @@ -246,7 +246,7 @@ static inline UINT8 clamp(INT16 val) return (UINT8)val; } -static INLINE INT32 planar_decompress_plane_rle_only(const BYTE* WINPR_RESTRICT pSrcData, +static inline INT32 planar_decompress_plane_rle_only(const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcSize, BYTE* WINPR_RESTRICT pDstData, UINT32 nWidth, UINT32 nHeight) { @@ -360,7 +360,7 @@ static INLINE INT32 planar_decompress_plane_rle_only(const BYTE* WINPR_RESTRICT return (INT32)(srcp - pSrcData); } -static INLINE INT32 planar_decompress_plane_rle(const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcSize, +static inline INT32 planar_decompress_plane_rle(const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcSize, BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 nChannel, BOOL vFlip) @@ -493,7 +493,7 @@ static INLINE INT32 planar_decompress_plane_rle(const BYTE* WINPR_RESTRICT pSrcD return (INT32)(srcp - pSrcData); } -static INLINE INT32 planar_set_plane(BYTE bValue, BYTE* pDstData, UINT32 nDstStep, UINT32 nXDst, +static inline INT32 planar_set_plane(BYTE bValue, BYTE* pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 nChannel, BOOL vFlip) { @@ -527,7 +527,7 @@ static INLINE INT32 planar_set_plane(BYTE bValue, BYTE* pDstData, UINT32 nDstSte return 0; } -static INLINE BOOL writeLine(BYTE** WINPR_RESTRICT ppRgba, UINT32 DstFormat, UINT32 width, +static inline BOOL writeLine(BYTE** WINPR_RESTRICT ppRgba, UINT32 DstFormat, UINT32 width, const BYTE** WINPR_RESTRICT ppR, const BYTE** WINPR_RESTRICT ppG, const BYTE** WINPR_RESTRICT ppB, const BYTE** WINPR_RESTRICT ppA) { @@ -589,7 +589,7 @@ static INLINE BOOL writeLine(BYTE** WINPR_RESTRICT ppRgba, UINT32 DstFormat, UIN } } -static INLINE BOOL planar_decompress_planes_raw(const BYTE* WINPR_RESTRICT pSrcData[4], +static inline BOOL planar_decompress_planes_raw(const BYTE* WINPR_RESTRICT pSrcData[4], BYTE* WINPR_RESTRICT pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, BOOL vFlip, @@ -1119,7 +1119,7 @@ BOOL freerdp_bitmap_decompress_planar(BITMAP_PLANAR_CONTEXT* WINPR_RESTRICT plan return TRUE; } -static INLINE BOOL freerdp_split_color_planes(BITMAP_PLANAR_CONTEXT* WINPR_RESTRICT planar, +static inline BOOL freerdp_split_color_planes(BITMAP_PLANAR_CONTEXT* WINPR_RESTRICT planar, const BYTE* WINPR_RESTRICT data, UINT32 format, UINT32 width, UINT32 height, UINT32 scanline, BYTE* WINPR_RESTRICT planes[4]) @@ -1170,7 +1170,7 @@ static INLINE BOOL freerdp_split_color_planes(BITMAP_PLANAR_CONTEXT* WINPR_RESTR return TRUE; } -static INLINE UINT32 freerdp_bitmap_planar_write_rle_bytes(const BYTE* WINPR_RESTRICT pInBuffer, +static inline UINT32 freerdp_bitmap_planar_write_rle_bytes(const BYTE* WINPR_RESTRICT pInBuffer, UINT32 cRawBytes, UINT32 nRunLength, BYTE* WINPR_RESTRICT pOutBuffer, UINT32 outBufferSize) @@ -1286,7 +1286,7 @@ static INLINE UINT32 freerdp_bitmap_planar_write_rle_bytes(const BYTE* WINPR_RES return (UINT32)diff; } -static INLINE UINT32 freerdp_bitmap_planar_encode_rle_bytes(const BYTE* WINPR_RESTRICT pInBuffer, +static inline UINT32 freerdp_bitmap_planar_encode_rle_bytes(const BYTE* WINPR_RESTRICT pInBuffer, UINT32 inBufferSize, BYTE* WINPR_RESTRICT pOutBuffer, UINT32 outBufferSize) @@ -1394,7 +1394,7 @@ BOOL freerdp_bitmap_planar_compress_plane_rle(const BYTE* WINPR_RESTRICT inPlane return TRUE; } -static INLINE BOOL freerdp_bitmap_planar_compress_planes_rle(BYTE* WINPR_RESTRICT inPlanes[4], +static inline BOOL freerdp_bitmap_planar_compress_planes_rle(BYTE* WINPR_RESTRICT inPlanes[4], UINT32 width, UINT32 height, BYTE* WINPR_RESTRICT outPlanes, UINT32* WINPR_RESTRICT dstSizes, @@ -1483,7 +1483,7 @@ BYTE* freerdp_bitmap_planar_delta_encode_plane(const BYTE* WINPR_RESTRICT inPlan return outPlane; } -static INLINE BOOL freerdp_bitmap_planar_delta_encode_planes(BYTE* WINPR_RESTRICT inPlanes[4], +static inline BOOL freerdp_bitmap_planar_delta_encode_planes(BYTE* WINPR_RESTRICT inPlanes[4], UINT32 width, UINT32 height, BYTE* WINPR_RESTRICT outPlanes[4]) { diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index 8b5200546..afbc67d2a 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -56,7 +56,7 @@ typedef struct BOOL mode; } RFX_PROGRESSIVE_UPGRADE_STATE; -static INLINE void +static inline void progressive_component_codec_quant_read(wStream* WINPR_RESTRICT s, RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT quantVal) { @@ -78,7 +78,7 @@ progressive_component_codec_quant_read(wStream* WINPR_RESTRICT s, quantVal->HH1 = b >> 4; } -static INLINE void progressive_rfx_quant_add(const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q1, +static inline void progressive_rfx_quant_add(const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q1, const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q2, RFX_COMPONENT_CODEC_QUANT* dst) { @@ -94,7 +94,7 @@ static INLINE void progressive_rfx_quant_add(const RFX_COMPONENT_CODEC_QUANT* WI dst->LL3 = q1->LL3 + q2->LL3; /* LL3 */ } -static INLINE void progressive_rfx_quant_lsub(RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q, int val) +static inline void progressive_rfx_quant_lsub(RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q, int val) { q->HL1 -= val; /* HL1 */ q->LH1 -= val; /* LH1 */ @@ -108,7 +108,7 @@ static INLINE void progressive_rfx_quant_lsub(RFX_COMPONENT_CODEC_QUANT* WINPR_R q->LL3 -= val; /* LL3 */ } -static INLINE void progressive_rfx_quant_sub(const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q1, +static inline void progressive_rfx_quant_sub(const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q1, const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q2, RFX_COMPONENT_CODEC_QUANT* dst) { @@ -124,7 +124,7 @@ static INLINE void progressive_rfx_quant_sub(const RFX_COMPONENT_CODEC_QUANT* WI dst->LL3 = q1->LL3 - q2->LL3; /* LL3 */ } -static INLINE BOOL +static inline BOOL progressive_rfx_quant_lcmp_less_equal(const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q, int val) { if (q->HL1 > val) @@ -160,7 +160,7 @@ progressive_rfx_quant_lcmp_less_equal(const RFX_COMPONENT_CODEC_QUANT* WINPR_RES return TRUE; } -static INLINE BOOL +static inline BOOL progressive_rfx_quant_lcmp_greater_equal(const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q, int val) { if (q->HL1 < val) @@ -196,7 +196,7 @@ progressive_rfx_quant_lcmp_greater_equal(const RFX_COMPONENT_CODEC_QUANT* WINPR_ return TRUE; } -static INLINE BOOL +static inline BOOL progressive_rfx_quant_cmp_equal(const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q1, const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT q2) { @@ -233,7 +233,7 @@ progressive_rfx_quant_cmp_equal(const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT return TRUE; } -static INLINE BOOL progressive_set_surface_data(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline BOOL progressive_set_surface_data(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, UINT16 surfaceId, PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT pData) { @@ -247,7 +247,7 @@ static INLINE BOOL progressive_set_surface_data(PROGRESSIVE_CONTEXT* WINPR_RESTR return TRUE; } -static INLINE PROGRESSIVE_SURFACE_CONTEXT* +static inline PROGRESSIVE_SURFACE_CONTEXT* progressive_get_surface_data(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, UINT16 surfaceId) { void* key = (void*)(((ULONG_PTR)surfaceId) + 1); @@ -290,7 +290,7 @@ static void progressive_surface_context_free(void* ptr) winpr_aligned_free(surface); } -static INLINE RFX_PROGRESSIVE_TILE* progressive_tile_new(void) +static inline RFX_PROGRESSIVE_TILE* progressive_tile_new(void) { RFX_PROGRESSIVE_TILE* tile = winpr_aligned_calloc(1, sizeof(RFX_PROGRESSIVE_TILE), 32); if (!tile) @@ -323,7 +323,7 @@ fail: return NULL; } -static INLINE BOOL +static inline BOOL progressive_allocate_tile_cache(PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, size_t min) { size_t oldIndex = 0; @@ -387,7 +387,7 @@ static PROGRESSIVE_SURFACE_CONTEXT* progressive_surface_context_new(UINT16 surfa return surface; } -static INLINE BOOL +static inline BOOL progressive_surface_tile_replace(PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region, const RFX_PROGRESSIVE_TILE* WINPR_RESTRICT tile, BOOL upgrade) @@ -527,7 +527,7 @@ static int16_t clampi16(int val) return (int16_t)val; } -static INLINE void progressive_rfx_idwt_x(const INT16* WINPR_RESTRICT pLowBand, size_t nLowStep, +static inline void progressive_rfx_idwt_x(const INT16* WINPR_RESTRICT pLowBand, size_t nLowStep, const INT16* WINPR_RESTRICT pHighBand, size_t nHighStep, INT16* WINPR_RESTRICT pDstBand, size_t nDstStep, size_t nLowCount, size_t nHighCount, size_t nDstCount) @@ -596,7 +596,7 @@ static INLINE void progressive_rfx_idwt_x(const INT16* WINPR_RESTRICT pLowBand, } } -static INLINE void progressive_rfx_idwt_y(const INT16* WINPR_RESTRICT pLowBand, size_t nLowStep, +static inline void progressive_rfx_idwt_y(const INT16* WINPR_RESTRICT pLowBand, size_t nLowStep, const INT16* WINPR_RESTRICT pHighBand, size_t nHighStep, INT16* WINPR_RESTRICT pDstBand, size_t nDstStep, size_t nLowCount, size_t nHighCount, size_t nDstCount) @@ -671,12 +671,12 @@ static INLINE void progressive_rfx_idwt_y(const INT16* WINPR_RESTRICT pLowBand, } } -static INLINE size_t progressive_rfx_get_band_l_count(size_t level) +static inline size_t progressive_rfx_get_band_l_count(size_t level) { return (64 >> level) + 1; } -static INLINE size_t progressive_rfx_get_band_h_count(size_t level) +static inline size_t progressive_rfx_get_band_h_count(size_t level) { if (level == 1) return (64 >> 1) - 1; @@ -684,7 +684,7 @@ static INLINE size_t progressive_rfx_get_band_h_count(size_t level) return (64 + (1 << (level - 1))) >> level; } -static INLINE void progressive_rfx_dwt_2d_decode_block(INT16* WINPR_RESTRICT buffer, +static inline void progressive_rfx_dwt_2d_decode_block(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT temp, size_t level) { size_t nDstStepX = 0; @@ -736,7 +736,7 @@ void rfx_dwt_2d_extrapolate_decode(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RE progressive_rfx_dwt_2d_decode_block(&buffer[0], temp, 1); } -static INLINE int progressive_rfx_dwt_2d_decode(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline int progressive_rfx_dwt_2d_decode(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT current, BOOL coeffDiff, BOOL extrapolate, BOOL reverse) @@ -773,7 +773,7 @@ static INLINE int progressive_rfx_dwt_2d_decode(PROGRESSIVE_CONTEXT* WINPR_RESTR return 1; } -static INLINE void progressive_rfx_decode_block(const primitives_t* prims, +static inline void progressive_rfx_decode_block(const primitives_t* prims, INT16* WINPR_RESTRICT buffer, UINT32 length, UINT32 shift) { @@ -783,7 +783,7 @@ static INLINE void progressive_rfx_decode_block(const primitives_t* prims, prims->lShiftC_16s_inplace(buffer, shift, length); } -static INLINE int +static inline int progressive_rfx_decode_component(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT shift, const BYTE* WINPR_RESTRICT data, UINT32 length, @@ -832,7 +832,7 @@ progressive_rfx_decode_component(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive FALSE); } -static INLINE int +static inline int progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, RFX_PROGRESSIVE_TILE* WINPR_RESTRICT tile, PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region, @@ -973,7 +973,7 @@ fail: return rc; } -static INLINE INT16 progressive_rfx_srl_read(RFX_PROGRESSIVE_UPGRADE_STATE* WINPR_RESTRICT state, +static inline INT16 progressive_rfx_srl_read(RFX_PROGRESSIVE_UPGRADE_STATE* WINPR_RESTRICT state, UINT32 numBits) { WINPR_ASSERT(state); @@ -1062,7 +1062,7 @@ static INLINE INT16 progressive_rfx_srl_read(RFX_PROGRESSIVE_UPGRADE_STATE* WINP return (INT16)(sign ? -1 * (int)mag : (INT16)mag); } -static INLINE int +static inline int progressive_rfx_upgrade_state_finish(RFX_PROGRESSIVE_UPGRADE_STATE* WINPR_RESTRICT state) { UINT32 pad = 0; @@ -1090,7 +1090,7 @@ progressive_rfx_upgrade_state_finish(RFX_PROGRESSIVE_UPGRADE_STATE* WINPR_RESTRI return 1; } -static INLINE int progressive_rfx_upgrade_block(RFX_PROGRESSIVE_UPGRADE_STATE* WINPR_RESTRICT state, +static inline int progressive_rfx_upgrade_block(RFX_PROGRESSIVE_UPGRADE_STATE* WINPR_RESTRICT state, INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT sign, UINT32 length, UINT32 shift, WINPR_ATTR_UNUSED UINT32 bitPos, @@ -1151,7 +1151,7 @@ static INLINE int progressive_rfx_upgrade_block(RFX_PROGRESSIVE_UPGRADE_STATE* W return 1; } -static INLINE int progressive_rfx_upgrade_component( +static inline int progressive_rfx_upgrade_component( PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT shift, const RFX_COMPONENT_CODEC_QUANT* WINPR_RESTRICT bitPos, @@ -1249,7 +1249,7 @@ static INLINE int progressive_rfx_upgrade_component( TRUE); } -static INLINE int +static inline int progressive_decompress_tile_upgrade(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, RFX_PROGRESSIVE_TILE* WINPR_RESTRICT tile, PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region, @@ -1425,7 +1425,7 @@ fail: return status; } -static INLINE BOOL progressive_tile_read_upgrade( +static inline BOOL progressive_tile_read_upgrade( PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, UINT16 blockType, UINT32 blockLen, PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region, @@ -1503,11 +1503,12 @@ static INLINE BOOL progressive_tile_read_upgrade( return progressive_surface_tile_replace(surface, region, &tile, TRUE); } -static INLINE BOOL progressive_tile_read( - PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, BOOL simple, wStream* WINPR_RESTRICT s, - UINT16 blockType, UINT32 blockLen, PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, - PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region, - WINPR_ATTR_UNUSED const PROGRESSIVE_BLOCK_CONTEXT* WINPR_RESTRICT context) +static inline BOOL +progressive_tile_read(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, BOOL simple, + wStream* WINPR_RESTRICT s, UINT16 blockType, UINT32 blockLen, + PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, + PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region, + WINPR_ATTR_UNUSED const PROGRESSIVE_BLOCK_CONTEXT* WINPR_RESTRICT context) { RFX_PROGRESSIVE_TILE tile = { 0 }; size_t expect = simple ? 16 : 17; @@ -1593,11 +1594,12 @@ static void CALLBACK progressive_process_tiles_tile_work_callback(PTP_CALLBACK_I } } -static INLINE SSIZE_T progressive_process_tiles( - PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, - PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region, - PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, - const PROGRESSIVE_BLOCK_CONTEXT* WINPR_RESTRICT context) +static inline SSIZE_T +progressive_process_tiles(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, + wStream* WINPR_RESTRICT s, + PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region, + PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, + const PROGRESSIVE_BLOCK_CONTEXT* WINPR_RESTRICT context) { int status = 0; size_t end = 0; @@ -1742,7 +1744,7 @@ fail: return (SSIZE_T)(end - start); } -static INLINE SSIZE_T progressive_wb_sync(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline SSIZE_T progressive_wb_sync(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, UINT16 blockType, UINT32 blockLen) { @@ -1794,7 +1796,7 @@ static INLINE SSIZE_T progressive_wb_sync(PROGRESSIVE_CONTEXT* WINPR_RESTRICT pr return 0; } -static INLINE SSIZE_T progressive_wb_frame_begin(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline SSIZE_T progressive_wb_frame_begin(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, UINT16 blockType, UINT32 blockLen) { @@ -1846,7 +1848,7 @@ static INLINE SSIZE_T progressive_wb_frame_begin(PROGRESSIVE_CONTEXT* WINPR_REST return 0; } -static INLINE SSIZE_T progressive_wb_frame_end(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline SSIZE_T progressive_wb_frame_end(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, UINT16 blockType, UINT32 blockLen) { @@ -1884,7 +1886,7 @@ static INLINE SSIZE_T progressive_wb_frame_end(PROGRESSIVE_CONTEXT* WINPR_RESTRI return 0; } -static INLINE SSIZE_T progressive_wb_context(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline SSIZE_T progressive_wb_context(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, UINT16 blockType, UINT32 blockLen) { @@ -1932,9 +1934,10 @@ static INLINE SSIZE_T progressive_wb_context(PROGRESSIVE_CONTEXT* WINPR_RESTRICT return 0; } -static INLINE SSIZE_T progressive_wb_read_region_header( - PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, UINT16 blockType, - UINT32 blockLen, PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region) +static inline SSIZE_T +progressive_wb_read_region_header(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, + wStream* WINPR_RESTRICT s, UINT16 blockType, UINT32 blockLen, + PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region) { region->usedTiles = 0; @@ -2019,7 +2022,7 @@ static INLINE SSIZE_T progressive_wb_read_region_header( return rc; } -static INLINE SSIZE_T progressive_wb_skip_region(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline SSIZE_T progressive_wb_skip_region(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, UINT16 blockType, UINT32 blockLen) { @@ -2036,7 +2039,7 @@ static INLINE SSIZE_T progressive_wb_skip_region(PROGRESSIVE_CONTEXT* WINPR_REST return rc; } -static INLINE SSIZE_T progressive_wb_region(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline SSIZE_T progressive_wb_region(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, UINT16 blockType, UINT32 blockLen, PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, @@ -2157,7 +2160,7 @@ static INLINE SSIZE_T progressive_wb_region(PROGRESSIVE_CONTEXT* WINPR_RESTRICT return rc; } -static INLINE SSIZE_T progressive_parse_block(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline SSIZE_T progressive_parse_block(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, wStream* WINPR_RESTRICT s, PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, PROGRESSIVE_BLOCK_REGION* WINPR_RESTRICT region) @@ -2226,7 +2229,7 @@ static INLINE SSIZE_T progressive_parse_block(PROGRESSIVE_CONTEXT* WINPR_RESTRIC return rc; } -static INLINE BOOL update_tiles(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, +static inline BOOL update_tiles(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressive, PROGRESSIVE_SURFACE_CONTEXT* WINPR_RESTRICT surface, BYTE* WINPR_RESTRICT pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, diff --git a/libfreerdp/codec/region.c b/libfreerdp/codec/region.c index 334888589..d2d3353be 100644 --- a/libfreerdp/codec/region.c +++ b/libfreerdp/codec/region.c @@ -109,7 +109,7 @@ const RECTANGLE_16* region16_rects(const REGION16* region, UINT32* nbRects) return data->rects; } -static INLINE RECTANGLE_16* region16_rects_noconst(REGION16* region) +static inline RECTANGLE_16* region16_rects_noconst(REGION16* region) { WINPR_ASSERT(region); diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index 2ec4eb521..aaf38aa60 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -69,11 +69,11 @@ */ static const UINT32 rfx_default_quantization_values[] = { 6, 6, 6, 6, 7, 7, 8, 8, 8, 9 }; -static INLINE BOOL rfx_write_progressive_tile_simple(RFX_CONTEXT* WINPR_RESTRICT rfx, +static inline BOOL rfx_write_progressive_tile_simple(RFX_CONTEXT* WINPR_RESTRICT rfx, wStream* WINPR_RESTRICT s, const RFX_TILE* WINPR_RESTRICT tile); -static INLINE void rfx_profiler_create(RFX_CONTEXT* WINPR_RESTRICT context) +static inline void rfx_profiler_create(RFX_CONTEXT* WINPR_RESTRICT context) { if (!context || !context->priv) return; @@ -94,7 +94,7 @@ static INLINE void rfx_profiler_create(RFX_CONTEXT* WINPR_RESTRICT context) PROFILER_CREATE(context->priv->prof_rfx_encode_format_rgb, "rfx_encode_format_rgb") } -static INLINE void rfx_profiler_free(RFX_CONTEXT* WINPR_RESTRICT context) +static inline void rfx_profiler_free(RFX_CONTEXT* WINPR_RESTRICT context) { if (!context || !context->priv) return; @@ -115,7 +115,7 @@ static INLINE void rfx_profiler_free(RFX_CONTEXT* WINPR_RESTRICT context) PROFILER_FREE(context->priv->prof_rfx_encode_format_rgb) } -static INLINE void rfx_profiler_print(RFX_CONTEXT* WINPR_RESTRICT context) +static inline void rfx_profiler_print(RFX_CONTEXT* WINPR_RESTRICT context) { if (!context || !context->priv) return; @@ -139,7 +139,7 @@ static INLINE void rfx_profiler_print(RFX_CONTEXT* WINPR_RESTRICT context) PROFILER_PRINT_FOOTER } -static INLINE void rfx_tile_init(void* obj) +static inline void rfx_tile_init(void* obj) { RFX_TILE* tile = (RFX_TILE*)obj; if (tile) @@ -155,7 +155,7 @@ static INLINE void rfx_tile_init(void* obj) } } -static INLINE void* rfx_decoder_tile_new(const void* val) +static inline void* rfx_decoder_tile_new(const void* val) { const size_t size = 4ULL * 64ULL * 64ULL; RFX_TILE* tile = NULL; @@ -174,7 +174,7 @@ static INLINE void* rfx_decoder_tile_new(const void* val) return tile; } -static INLINE void rfx_decoder_tile_free(void* obj) +static inline void rfx_decoder_tile_free(void* obj) { RFX_TILE* tile = (RFX_TILE*)obj; @@ -187,13 +187,13 @@ static INLINE void rfx_decoder_tile_free(void* obj) } } -static INLINE void* rfx_encoder_tile_new(const void* val) +static inline void* rfx_encoder_tile_new(const void* val) { WINPR_UNUSED(val); return winpr_aligned_calloc(1, sizeof(RFX_TILE), 32); } -static INLINE void rfx_encoder_tile_free(void* obj) +static inline void rfx_encoder_tile_free(void* obj) { winpr_aligned_free(obj); } @@ -356,7 +356,7 @@ void rfx_context_free(RFX_CONTEXT* context) winpr_aligned_free(context); } -static INLINE RFX_TILE* rfx_message_get_tile(RFX_MESSAGE* WINPR_RESTRICT message, UINT32 index) +static inline RFX_TILE* rfx_message_get_tile(RFX_MESSAGE* WINPR_RESTRICT message, UINT32 index) { WINPR_ASSERT(message); WINPR_ASSERT(message->tiles); @@ -364,7 +364,7 @@ static INLINE RFX_TILE* rfx_message_get_tile(RFX_MESSAGE* WINPR_RESTRICT message return message->tiles[index]; } -static INLINE const RFX_RECT* rfx_message_get_rect_const(const RFX_MESSAGE* WINPR_RESTRICT message, +static inline const RFX_RECT* rfx_message_get_rect_const(const RFX_MESSAGE* WINPR_RESTRICT message, UINT32 index) { WINPR_ASSERT(message); @@ -373,7 +373,7 @@ static INLINE const RFX_RECT* rfx_message_get_rect_const(const RFX_MESSAGE* WINP return &message->rects[index]; } -static INLINE RFX_RECT* rfx_message_get_rect(RFX_MESSAGE* WINPR_RESTRICT message, UINT32 index) +static inline RFX_RECT* rfx_message_get_rect(RFX_MESSAGE* WINPR_RESTRICT message, UINT32 index) { WINPR_ASSERT(message); WINPR_ASSERT(message->rects); @@ -421,7 +421,7 @@ BOOL rfx_context_reset(RFX_CONTEXT* WINPR_RESTRICT context, UINT32 width, UINT32 return TRUE; } -static INLINE BOOL rfx_process_message_sync(RFX_CONTEXT* WINPR_RESTRICT context, +static inline BOOL rfx_process_message_sync(RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s) { UINT32 magic = 0; @@ -454,7 +454,7 @@ static INLINE BOOL rfx_process_message_sync(RFX_CONTEXT* WINPR_RESTRICT context, return TRUE; } -static INLINE BOOL rfx_process_message_codec_versions(RFX_CONTEXT* WINPR_RESTRICT context, +static inline BOOL rfx_process_message_codec_versions(RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s) { BYTE numCodecs = 0; @@ -498,7 +498,7 @@ static INLINE BOOL rfx_process_message_codec_versions(RFX_CONTEXT* WINPR_RESTRIC return TRUE; } -static INLINE BOOL rfx_process_message_channels(RFX_CONTEXT* WINPR_RESTRICT context, +static inline BOOL rfx_process_message_channels(RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s) { BYTE channelId = 0; @@ -555,7 +555,7 @@ static INLINE BOOL rfx_process_message_channels(RFX_CONTEXT* WINPR_RESTRICT cont return TRUE; } -static INLINE BOOL rfx_process_message_context(RFX_CONTEXT* WINPR_RESTRICT context, +static inline BOOL rfx_process_message_context(RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s) { BYTE ctxId = 0; @@ -608,7 +608,7 @@ static INLINE BOOL rfx_process_message_context(RFX_CONTEXT* WINPR_RESTRICT conte return TRUE; } -static INLINE BOOL rfx_process_message_frame_begin( +static inline BOOL rfx_process_message_frame_begin( RFX_CONTEXT* WINPR_RESTRICT context, WINPR_ATTR_UNUSED RFX_MESSAGE* WINPR_RESTRICT message, wStream* WINPR_RESTRICT s, UINT16* WINPR_RESTRICT pExpectedBlockType) { @@ -640,7 +640,7 @@ static INLINE BOOL rfx_process_message_frame_begin( return TRUE; } -static INLINE BOOL rfx_process_message_frame_end( +static inline BOOL rfx_process_message_frame_end( RFX_CONTEXT* WINPR_RESTRICT context, WINPR_ATTR_UNUSED RFX_MESSAGE* WINPR_RESTRICT message, WINPR_ATTR_UNUSED wStream* WINPR_RESTRICT s, UINT16* WINPR_RESTRICT pExpectedBlockType) { @@ -661,7 +661,7 @@ static INLINE BOOL rfx_process_message_frame_end( return TRUE; } -static INLINE BOOL rfx_resize_rects(RFX_MESSAGE* WINPR_RESTRICT message) +static inline BOOL rfx_resize_rects(RFX_MESSAGE* WINPR_RESTRICT message) { WINPR_ASSERT(message); @@ -673,7 +673,7 @@ static INLINE BOOL rfx_resize_rects(RFX_MESSAGE* WINPR_RESTRICT message) return TRUE; } -static INLINE BOOL rfx_process_message_region(RFX_CONTEXT* WINPR_RESTRICT context, +static inline BOOL rfx_process_message_region(RFX_CONTEXT* WINPR_RESTRICT context, RFX_MESSAGE* WINPR_RESTRICT message, wStream* WINPR_RESTRICT s, UINT16* WINPR_RESTRICT pExpectedBlockType) @@ -768,7 +768,7 @@ typedef struct RFX_CONTEXT* context; } RFX_TILE_PROCESS_WORK_PARAM; -static INLINE void CALLBACK +static inline void CALLBACK rfx_process_message_tile_work_callback(WINPR_ATTR_UNUSED PTP_CALLBACK_INSTANCE instance, void* context, WINPR_ATTR_UNUSED PTP_WORK work) { @@ -777,7 +777,7 @@ rfx_process_message_tile_work_callback(WINPR_ATTR_UNUSED PTP_CALLBACK_INSTANCE i rfx_decode_rgb(param->context, param->tile, param->tile->data, 64 * 4); } -static INLINE BOOL rfx_allocate_tiles(RFX_MESSAGE* WINPR_RESTRICT message, size_t count, +static inline BOOL rfx_allocate_tiles(RFX_MESSAGE* WINPR_RESTRICT message, size_t count, BOOL allocOnly) { WINPR_ASSERT(message); @@ -799,7 +799,7 @@ static INLINE BOOL rfx_allocate_tiles(RFX_MESSAGE* WINPR_RESTRICT message, size_ return TRUE; } -static INLINE BOOL rfx_process_message_tileset(RFX_CONTEXT* WINPR_RESTRICT context, +static inline BOOL rfx_process_message_tileset(RFX_CONTEXT* WINPR_RESTRICT context, RFX_MESSAGE* WINPR_RESTRICT message, wStream* WINPR_RESTRICT s, UINT16* WINPR_RESTRICT pExpectedBlockType) @@ -1427,7 +1427,7 @@ void rfx_message_free(RFX_CONTEXT* WINPR_RESTRICT context, RFX_MESSAGE* WINPR_RE winpr_aligned_free(message); } -static INLINE void rfx_update_context_properties(RFX_CONTEXT* WINPR_RESTRICT context) +static inline void rfx_update_context_properties(RFX_CONTEXT* WINPR_RESTRICT context) { UINT16 properties = 0; @@ -1442,7 +1442,7 @@ static INLINE void rfx_update_context_properties(RFX_CONTEXT* WINPR_RESTRICT con context->properties = properties; } -static INLINE void +static inline void rfx_write_message_sync(WINPR_ATTR_UNUSED const RFX_CONTEXT* WINPR_RESTRICT context, WINPR_ATTR_UNUSED wStream* WINPR_RESTRICT s) { @@ -1454,7 +1454,7 @@ rfx_write_message_sync(WINPR_ATTR_UNUSED const RFX_CONTEXT* WINPR_RESTRICT conte Stream_Write_UINT16(s, WF_VERSION_1_0); /* version (2 bytes) */ } -static INLINE void +static inline void rfx_write_message_codec_versions(WINPR_ATTR_UNUSED const RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s) { @@ -1467,7 +1467,7 @@ rfx_write_message_codec_versions(WINPR_ATTR_UNUSED const RFX_CONTEXT* WINPR_REST Stream_Write_UINT16(s, WF_VERSION_1_0); /* codecs.version (2 bytes) */ } -static INLINE void rfx_write_message_channels(const RFX_CONTEXT* WINPR_RESTRICT context, +static inline void rfx_write_message_channels(const RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s) { WINPR_ASSERT(context); @@ -1480,7 +1480,7 @@ static INLINE void rfx_write_message_channels(const RFX_CONTEXT* WINPR_RESTRICT Stream_Write_UINT16(s, context->height); /* Channel.height (2 bytes) */ } -static INLINE void rfx_write_message_context(RFX_CONTEXT* WINPR_RESTRICT context, +static inline void rfx_write_message_context(RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s) { UINT16 properties = 0; @@ -1502,7 +1502,7 @@ static INLINE void rfx_write_message_context(RFX_CONTEXT* WINPR_RESTRICT context rfx_update_context_properties(context); } -static INLINE BOOL rfx_compose_message_header(RFX_CONTEXT* WINPR_RESTRICT context, +static inline BOOL rfx_compose_message_header(RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s) { WINPR_ASSERT(context); @@ -1516,13 +1516,13 @@ static INLINE BOOL rfx_compose_message_header(RFX_CONTEXT* WINPR_RESTRICT contex return TRUE; } -static INLINE size_t rfx_tile_length(const RFX_TILE* WINPR_RESTRICT tile) +static inline size_t rfx_tile_length(const RFX_TILE* WINPR_RESTRICT tile) { WINPR_ASSERT(tile); return 19ull + tile->YLen + tile->CbLen + tile->CrLen; } -static INLINE BOOL rfx_write_tile(wStream* WINPR_RESTRICT s, const RFX_TILE* WINPR_RESTRICT tile) +static inline BOOL rfx_write_tile(wStream* WINPR_RESTRICT s, const RFX_TILE* WINPR_RESTRICT tile) { const size_t blockLen = rfx_tile_length(tile); if (blockLen > UINT32_MAX) @@ -1552,7 +1552,7 @@ struct S_RFX_TILE_COMPOSE_WORK_PARAM RFX_CONTEXT* context; }; -static INLINE void CALLBACK +static inline void CALLBACK rfx_compose_message_tile_work_callback(WINPR_ATTR_UNUSED PTP_CALLBACK_INSTANCE instance, void* context, WINPR_ATTR_UNUSED PTP_WORK work) { @@ -1561,7 +1561,7 @@ rfx_compose_message_tile_work_callback(WINPR_ATTR_UNUSED PTP_CALLBACK_INSTANCE i rfx_encode_rgb(param->context, param->tile); } -static INLINE BOOL computeRegion(const RFX_RECT* WINPR_RESTRICT rects, size_t numRects, +static inline BOOL computeRegion(const RFX_RECT* WINPR_RESTRICT rects, size_t numRects, REGION16* WINPR_RESTRICT region, size_t width, size_t height) { const RECTANGLE_16 mainRect = { 0, 0, WINPR_ASSERTING_INT_CAST(UINT16, width), @@ -1586,7 +1586,7 @@ static INLINE BOOL computeRegion(const RFX_RECT* WINPR_RESTRICT rects, size_t nu #define TILE_NO(v) ((v) / 64) -static INLINE BOOL setupWorkers(RFX_CONTEXT* WINPR_RESTRICT context, size_t nbTiles) +static inline BOOL setupWorkers(RFX_CONTEXT* WINPR_RESTRICT context, size_t nbTiles) { WINPR_ASSERT(context); @@ -1611,7 +1611,7 @@ static INLINE BOOL setupWorkers(RFX_CONTEXT* WINPR_RESTRICT context, size_t nbTi return TRUE; } -static INLINE BOOL rfx_ensure_tiles(RFX_MESSAGE* WINPR_RESTRICT message, size_t count) +static inline BOOL rfx_ensure_tiles(RFX_MESSAGE* WINPR_RESTRICT message, size_t count) { WINPR_ASSERT(message); @@ -1857,7 +1857,7 @@ skip_encoding_loop: return NULL; } -static INLINE BOOL rfx_clone_rects(RFX_MESSAGE* WINPR_RESTRICT dst, +static inline BOOL rfx_clone_rects(RFX_MESSAGE* WINPR_RESTRICT dst, const RFX_MESSAGE* WINPR_RESTRICT src) { WINPR_ASSERT(dst); @@ -1880,7 +1880,7 @@ static INLINE BOOL rfx_clone_rects(RFX_MESSAGE* WINPR_RESTRICT dst, return TRUE; } -static INLINE BOOL rfx_clone_quants(RFX_MESSAGE* WINPR_RESTRICT dst, +static inline BOOL rfx_clone_quants(RFX_MESSAGE* WINPR_RESTRICT dst, const RFX_MESSAGE* WINPR_RESTRICT src) { WINPR_ASSERT(dst); @@ -1899,7 +1899,7 @@ static INLINE BOOL rfx_clone_quants(RFX_MESSAGE* WINPR_RESTRICT dst, return TRUE; } -static INLINE RFX_MESSAGE* rfx_split_message(RFX_CONTEXT* WINPR_RESTRICT context, +static inline RFX_MESSAGE* rfx_split_message(RFX_CONTEXT* WINPR_RESTRICT context, RFX_MESSAGE* WINPR_RESTRICT message, size_t* WINPR_RESTRICT numMessages, size_t maxDataSize) { @@ -1979,7 +1979,7 @@ void rfx_message_list_free(RFX_MESSAGE_LIST* messages) free(messages); } -static INLINE RFX_MESSAGE_LIST* rfx_message_list_new(RFX_CONTEXT* WINPR_RESTRICT context, +static inline RFX_MESSAGE_LIST* rfx_message_list_new(RFX_CONTEXT* WINPR_RESTRICT context, RFX_MESSAGE* WINPR_RESTRICT messages, size_t count) { @@ -2015,7 +2015,7 @@ RFX_MESSAGE_LIST* rfx_encode_messages(RFX_CONTEXT* WINPR_RESTRICT context, return rfx_message_list_new(context, list, *numMessages); } -static INLINE BOOL rfx_write_message_tileset(RFX_CONTEXT* WINPR_RESTRICT context, +static inline BOOL rfx_write_message_tileset(RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s, const RFX_MESSAGE* WINPR_RESTRICT message) { @@ -2067,7 +2067,7 @@ static INLINE BOOL rfx_write_message_tileset(RFX_CONTEXT* WINPR_RESTRICT context return TRUE; } -static INLINE BOOL +static inline BOOL rfx_write_message_frame_begin(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s, const RFX_MESSAGE* WINPR_RESTRICT message) { @@ -2086,7 +2086,7 @@ rfx_write_message_frame_begin(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT cont return TRUE; } -static INLINE BOOL rfx_write_message_region(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT context, +static inline BOOL rfx_write_message_region(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s, const RFX_MESSAGE* WINPR_RESTRICT message) { @@ -2124,9 +2124,10 @@ static INLINE BOOL rfx_write_message_region(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR return TRUE; } -static INLINE BOOL rfx_write_message_frame_end( - WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT context, wStream* WINPR_RESTRICT s, - WINPR_ATTR_UNUSED const RFX_MESSAGE* WINPR_RESTRICT message) +static inline BOOL +rfx_write_message_frame_end(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT context, + wStream* WINPR_RESTRICT s, + WINPR_ATTR_UNUSED const RFX_MESSAGE* WINPR_RESTRICT message) { WINPR_ASSERT(context); WINPR_ASSERT(message); @@ -2207,7 +2208,7 @@ UINT32 rfx_message_get_frame_idx(const RFX_MESSAGE* WINPR_RESTRICT message) return message->frameIdx; } -static INLINE BOOL rfx_write_progressive_wb_sync(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT rfx, +static inline BOOL rfx_write_progressive_wb_sync(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT rfx, wStream* WINPR_RESTRICT s) { const UINT32 blockLen = 12; @@ -2224,8 +2225,9 @@ static INLINE BOOL rfx_write_progressive_wb_sync(WINPR_ATTR_UNUSED RFX_CONTEXT* return TRUE; } -static INLINE BOOL rfx_write_progressive_wb_context( - WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT rfx, wStream* WINPR_RESTRICT s) +static inline BOOL +rfx_write_progressive_wb_context(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT rfx, + wStream* WINPR_RESTRICT s) { const UINT32 blockLen = 10; WINPR_ASSERT(rfx); @@ -2242,7 +2244,7 @@ static INLINE BOOL rfx_write_progressive_wb_context( return TRUE; } -static INLINE BOOL rfx_write_progressive_region(RFX_CONTEXT* WINPR_RESTRICT rfx, +static inline BOOL rfx_write_progressive_region(RFX_CONTEXT* WINPR_RESTRICT rfx, wStream* WINPR_RESTRICT s, const RFX_MESSAGE* WINPR_RESTRICT msg) { @@ -2321,7 +2323,7 @@ static INLINE BOOL rfx_write_progressive_region(RFX_CONTEXT* WINPR_RESTRICT rfx, return (used == blockLen); } -static INLINE BOOL +static inline BOOL rfx_write_progressive_frame_begin(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT rfx, wStream* WINPR_RESTRICT s, const RFX_MESSAGE* WINPR_RESTRICT msg) { @@ -2341,8 +2343,9 @@ rfx_write_progressive_frame_begin(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT return TRUE; } -static INLINE BOOL rfx_write_progressive_frame_end( - WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT rfx, wStream* WINPR_RESTRICT s) +static inline BOOL +rfx_write_progressive_frame_end(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT rfx, + wStream* WINPR_RESTRICT s) { const UINT32 blockLen = 6; WINPR_ASSERT(rfx); @@ -2357,7 +2360,7 @@ static INLINE BOOL rfx_write_progressive_frame_end( return TRUE; } -static INLINE BOOL +static inline BOOL rfx_write_progressive_tile_simple(WINPR_ATTR_UNUSED RFX_CONTEXT* WINPR_RESTRICT rfx, wStream* WINPR_RESTRICT s, const RFX_TILE* WINPR_RESTRICT tile) { diff --git a/libfreerdp/codec/rfx_decode.c b/libfreerdp/codec/rfx_decode.c index abfcbc355..2fc669ce9 100644 --- a/libfreerdp/codec/rfx_decode.c +++ b/libfreerdp/codec/rfx_decode.c @@ -35,7 +35,7 @@ #include "rfx_decode.h" -static INLINE void rfx_decode_component(RFX_CONTEXT* WINPR_RESTRICT context, +static inline void rfx_decode_component(RFX_CONTEXT* WINPR_RESTRICT context, const UINT32* WINPR_RESTRICT quantization_values, const BYTE* WINPR_RESTRICT data, size_t size, INT16* WINPR_RESTRICT buffer) diff --git a/libfreerdp/codec/rfx_differential.h b/libfreerdp/codec/rfx_differential.h index 23d3ad406..5c54c0848 100644 --- a/libfreerdp/codec/rfx_differential.h +++ b/libfreerdp/codec/rfx_differential.h @@ -23,7 +23,7 @@ #include #include -static INLINE void rfx_differential_decode(INT16* WINPR_RESTRICT buffer, size_t size) +static inline void rfx_differential_decode(INT16* WINPR_RESTRICT buffer, size_t size) { INT16* ptr = buffer; INT16* end = &buffer[size - 1]; @@ -36,7 +36,7 @@ static INLINE void rfx_differential_decode(INT16* WINPR_RESTRICT buffer, size_t } } -static INLINE void rfx_differential_encode(INT16* WINPR_RESTRICT buffer, size_t size) +static inline void rfx_differential_encode(INT16* WINPR_RESTRICT buffer, size_t size) { INT16 n1 = buffer[0]; for (size_t x = 0; x < size - 1; x++) diff --git a/libfreerdp/codec/rfx_dwt.c b/libfreerdp/codec/rfx_dwt.c index 198251928..014e3abe6 100644 --- a/libfreerdp/codec/rfx_dwt.c +++ b/libfreerdp/codec/rfx_dwt.c @@ -28,7 +28,7 @@ #include "rfx_dwt.h" -static INLINE void rfx_dwt_2d_decode_block(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT idwt, +static inline void rfx_dwt_2d_decode_block(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT idwt, size_t subband_width) { const size_t total_width = subband_width << 1; diff --git a/libfreerdp/codec/rfx_quantization.c b/libfreerdp/codec/rfx_quantization.c index f46a10f8d..6fd474edf 100644 --- a/libfreerdp/codec/rfx_quantization.c +++ b/libfreerdp/codec/rfx_quantization.c @@ -44,7 +44,7 @@ * LL3 4032 8x8 64 */ -static INLINE void rfx_quantization_decode_block(const primitives_t* WINPR_RESTRICT prims, +static inline void rfx_quantization_decode_block(const primitives_t* WINPR_RESTRICT prims, INT16* WINPR_RESTRICT buffer, UINT32 buffer_size, UINT32 factor) { @@ -72,7 +72,7 @@ void rfx_quantization_decode(INT16* WINPR_RESTRICT buffer, const UINT32* WINPR_R rfx_quantization_decode_block(prims, &buffer[4032], 64, quantVals[0] - 1); /* LL3 */ } -static INLINE void rfx_quantization_encode_block(INT16* WINPR_RESTRICT buffer, size_t buffer_size, +static inline void rfx_quantization_encode_block(INT16* WINPR_RESTRICT buffer, size_t buffer_size, UINT32 factor) { if (factor == 0) diff --git a/libfreerdp/codec/rfx_rlgr.c b/libfreerdp/codec/rfx_rlgr.c index 620f0b85c..c7ab6a950 100644 --- a/libfreerdp/codec/rfx_rlgr.c +++ b/libfreerdp/codec/rfx_rlgr.c @@ -98,7 +98,7 @@ static BOOL CALLBACK rfx_rlgr_init(PINIT_ONCE once, PVOID param, PVOID* context) return TRUE; } -static INLINE UINT32 lzcnt_s(UINT32 x) +static inline UINT32 lzcnt_s(UINT32 x) { if (!x) return 32; diff --git a/libfreerdp/codec/test/TestFreeRDPCodecRemoteFX.c b/libfreerdp/codec/test/TestFreeRDPCodecRemoteFX.c index 74359bc98..3e2aa0a11 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecRemoteFX.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecRemoteFX.c @@ -800,7 +800,7 @@ static UINT32 srefImage #define FORMAT_SIZE 4ULL #define FORMAT PIXEL_FORMAT_XRGB32 -static INLINE size_t fuzzyCompare(BYTE b1, BYTE b2) +static inline size_t fuzzyCompare(BYTE b1, BYTE b2) { if (b1 > b2) return b1 - b2; diff --git a/libfreerdp/codec/xcrush.c b/libfreerdp/codec/xcrush.c index 80bef28f7..9bb723f85 100644 --- a/libfreerdp/codec/xcrush.c +++ b/libfreerdp/codec/xcrush.c @@ -766,7 +766,7 @@ static int xcrush_generate_output(XCRUSH_CONTEXT* WINPR_RESTRICT xcrush, return 1; } -static INLINE size_t xcrush_copy_bytes_no_overlap(BYTE* WINPR_RESTRICT dst, +static inline size_t xcrush_copy_bytes_no_overlap(BYTE* WINPR_RESTRICT dst, const BYTE* WINPR_RESTRICT src, size_t num) { // src and dst overlaps @@ -784,7 +784,7 @@ static INLINE size_t xcrush_copy_bytes_no_overlap(BYTE* WINPR_RESTRICT dst, return num; } -static INLINE size_t xcrush_copy_bytes(BYTE* dst, const BYTE* src, size_t num) +static inline size_t xcrush_copy_bytes(BYTE* dst, const BYTE* src, size_t num) { WINPR_ASSERT(dst); WINPR_ASSERT(src); diff --git a/libfreerdp/codec/yuv.c b/libfreerdp/codec/yuv.c index 8f4005663..0fb099e89 100644 --- a/libfreerdp/codec/yuv.c +++ b/libfreerdp/codec/yuv.c @@ -64,7 +64,7 @@ struct S_YUV_CONTEXT YUV_COMBINE_WORK_PARAM* work_combined_params; }; -static INLINE BOOL avc420_yuv_to_rgb(const BYTE* WINPR_RESTRICT pYUVData[3], +static inline BOOL avc420_yuv_to_rgb(const BYTE* WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], const RECTANGLE_16* WINPR_RESTRICT rect, UINT32 nDstStep, BYTE* WINPR_RESTRICT pDstData, DWORD DstFormat) @@ -97,7 +97,7 @@ static INLINE BOOL avc420_yuv_to_rgb(const BYTE* WINPR_RESTRICT pYUVData[3], return TRUE; } -static INLINE BOOL avc444_yuv_to_rgb(const BYTE* WINPR_RESTRICT pYUVData[3], +static inline BOOL avc444_yuv_to_rgb(const BYTE* WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], const RECTANGLE_16* WINPR_RESTRICT rect, UINT32 nDstStep, BYTE* WINPR_RESTRICT pDstData, DWORD DstFormat) @@ -257,7 +257,7 @@ void yuv_context_free(YUV_CONTEXT* context) winpr_aligned_free(context); } -static INLINE YUV_PROCESS_WORK_PARAM pool_decode_param(const RECTANGLE_16* WINPR_RESTRICT rect, +static inline YUV_PROCESS_WORK_PARAM pool_decode_param(const RECTANGLE_16* WINPR_RESTRICT rect, YUV_CONTEXT* WINPR_RESTRICT context, const BYTE* WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], UINT32 DstFormat, @@ -442,7 +442,7 @@ fail: return rc; } -static INLINE BOOL check_rect(const YUV_CONTEXT* WINPR_RESTRICT yuv, +static inline BOOL check_rect(const YUV_CONTEXT* WINPR_RESTRICT yuv, const RECTANGLE_16* WINPR_RESTRICT rect, UINT32 nDstWidth, UINT32 nDstHeight) { @@ -495,7 +495,7 @@ static void CALLBACK yuv444_combine_work_callback(PTP_CALLBACK_INSTANCE instance WLog_WARN(TAG, "YUV420CombineToYUV444 failed"); } -static INLINE YUV_COMBINE_WORK_PARAM +static inline YUV_COMBINE_WORK_PARAM pool_decode_rect_param(const RECTANGLE_16* WINPR_RESTRICT rect, YUV_CONTEXT* WINPR_RESTRICT context, BYTE type, const BYTE* WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], BYTE* WINPR_RESTRICT pYUVDstData[3], const UINT32 iDstStride[3]) @@ -728,10 +728,11 @@ static void CALLBACK yuv444v2_encode_work_callback(PTP_CALLBACK_INSTANCE instanc } } -static INLINE YUV_ENCODE_WORK_PARAM pool_encode_fill( - const RECTANGLE_16* WINPR_RESTRICT rect, YUV_CONTEXT* WINPR_RESTRICT context, - const BYTE* WINPR_RESTRICT pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, const UINT32 iStride[], - BYTE* WINPR_RESTRICT pYUVLumaData[], BYTE* WINPR_RESTRICT pYUVChromaData[]) +static inline YUV_ENCODE_WORK_PARAM +pool_encode_fill(const RECTANGLE_16* WINPR_RESTRICT rect, YUV_CONTEXT* WINPR_RESTRICT context, + const BYTE* WINPR_RESTRICT pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, + const UINT32 iStride[], BYTE* WINPR_RESTRICT pYUVLumaData[], + BYTE* WINPR_RESTRICT pYUVChromaData[]) { YUV_ENCODE_WORK_PARAM current = { 0 }; diff --git a/libfreerdp/codec/zgfx.c b/libfreerdp/codec/zgfx.c index 2a5c85453..d0277cc22 100644 --- a/libfreerdp/codec/zgfx.c +++ b/libfreerdp/codec/zgfx.c @@ -116,7 +116,7 @@ static const ZGFX_TOKEN ZGFX_TOKEN_TABLE[] = { { 0 } }; -static INLINE BOOL zgfx_GetBits(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, UINT32 nbits) +static inline BOOL zgfx_GetBits(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, UINT32 nbits) { if (!zgfx) return FALSE; @@ -138,7 +138,7 @@ static INLINE BOOL zgfx_GetBits(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, UINT32 nbits) return TRUE; } -static INLINE void zgfx_history_buffer_ring_write(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, +static inline void zgfx_history_buffer_ring_write(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, const BYTE* WINPR_RESTRICT src, size_t count) { if (count <= 0) @@ -169,7 +169,7 @@ static INLINE void zgfx_history_buffer_ring_write(ZGFX_CONTEXT* WINPR_RESTRICT z } } -static INLINE void zgfx_history_buffer_ring_read(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, int offset, +static inline void zgfx_history_buffer_ring_read(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, int offset, BYTE* WINPR_RESTRICT dst, UINT32 count) { UINT32 front = 0; @@ -220,7 +220,7 @@ static INLINE void zgfx_history_buffer_ring_read(ZGFX_CONTEXT* WINPR_RESTRICT zg } while ((bytesLeft -= bytes) > 0); } -static INLINE BOOL zgfx_decompress_segment(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, +static inline BOOL zgfx_decompress_segment(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, wStream* WINPR_RESTRICT stream, size_t segmentSize) { BYTE c = 0; @@ -380,7 +380,7 @@ static INLINE BOOL zgfx_decompress_segment(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, return TRUE; } -static INLINE BOOL zgfx_append(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, +static inline BOOL zgfx_append(ZGFX_CONTEXT* WINPR_RESTRICT zgfx, BYTE** WINPR_RESTRICT ppConcatenated, size_t uncompressedSize, size_t* WINPR_RESTRICT pUsed) { diff --git a/libfreerdp/common/addin.c b/libfreerdp/common/addin.c index 5cfe369f4..13ca18815 100644 --- a/libfreerdp/common/addin.c +++ b/libfreerdp/common/addin.c @@ -34,7 +34,7 @@ #include #define TAG FREERDP_TAG("addin") -static INLINE BOOL is_path_required(LPCSTR path, size_t len) +static inline BOOL is_path_required(LPCSTR path, size_t len) { if (!path || (len <= 1)) return FALSE; diff --git a/libfreerdp/core/aad.c b/libfreerdp/core/aad.c index a6a33501e..242891751 100644 --- a/libfreerdp/core/aad.c +++ b/libfreerdp/core/aad.c @@ -162,7 +162,7 @@ static BOOL json_get_string_alloc(wLog* wlog, WINPR_JSON* json, const char* key, return *result != NULL; } -static INLINE const char* aad_auth_result_to_string(DWORD code) +static inline const char* aad_auth_result_to_string(DWORD code) { #define ERROR_CASE(cd, x) \ if ((cd) == (DWORD)(x)) \ diff --git a/libfreerdp/core/input.h b/libfreerdp/core/input.h index 9a1585d2a..242fc4421 100644 --- a/libfreerdp/core/input.h +++ b/libfreerdp/core/input.h @@ -43,7 +43,7 @@ typedef struct UINT16 lastY; } rdp_input_internal; -static INLINE rdp_input_internal* input_cast(rdpInput* input) +static inline rdp_input_internal* input_cast(rdpInput* input) { union { diff --git a/libfreerdp/core/orders.c b/libfreerdp/core/orders.c index d171e0b67..fc30cdc4c 100644 --- a/libfreerdp/core/orders.c +++ b/libfreerdp/core/orders.c @@ -594,7 +594,7 @@ static const char* altsec_order_string(BYTE orderType) } WINPR_PRAGMA_DIAG_POP -static INLINE BOOL update_read_coord(wStream* s, INT32* coord, BOOL delta) +static inline BOOL update_read_coord(wStream* s, INT32* coord, BOOL delta) { INT8 lsi8 = 0; INT16 lsi16 = 0; @@ -622,7 +622,7 @@ static INLINE BOOL update_read_coord(wStream* s, INT32* coord, BOOL delta) #define update_write_coord(s, coord) \ update_write_coord_int((s), (coord), #coord, __FILE__, __func__, __LINE__) -static INLINE BOOL update_write_coord_int(wStream* s, INT32 coord, const char* name, +static inline BOOL update_write_coord_int(wStream* s, INT32 coord, const char* name, const char* file, const char* fkt, size_t line) { if ((coord < 0) || (coord > UINT16_MAX)) @@ -640,7 +640,7 @@ static INLINE BOOL update_write_coord_int(wStream* s, INT32 coord, const char* n Stream_Write_UINT16(s, (UINT16)coord); return TRUE; } -static INLINE BOOL update_read_color(wStream* s, UINT32* color) +static inline BOOL update_read_color(wStream* s, UINT32* color) { BYTE byte = 0; @@ -656,7 +656,7 @@ static INLINE BOOL update_read_color(wStream* s, UINT32* color) *color |= ((UINT32)byte << 16) & 0xFF0000; return TRUE; } -static INLINE BOOL update_write_color(wStream* s, UINT32 color) +static inline BOOL update_write_color(wStream* s, UINT32 color) { BYTE byte = 0; byte = (color & 0xFF); @@ -667,7 +667,7 @@ static INLINE BOOL update_write_color(wStream* s, UINT32 color) Stream_Write_UINT8(s, byte); return TRUE; } -static INLINE BOOL update_read_colorref(wStream* s, UINT32* color) +static inline BOOL update_read_colorref(wStream* s, UINT32* color) { BYTE byte = 0; @@ -684,11 +684,11 @@ static INLINE BOOL update_read_colorref(wStream* s, UINT32* color) Stream_Seek_UINT8(s); return TRUE; } -static INLINE BOOL update_read_color_quad(wStream* s, UINT32* color) +static inline BOOL update_read_color_quad(wStream* s, UINT32* color) { return update_read_colorref(s, color); } -static INLINE void update_write_color_quad(wStream* s, UINT32 color) +static inline void update_write_color_quad(wStream* s, UINT32 color) { BYTE byte = 0; byte = (color >> 16) & 0xFF; @@ -698,7 +698,7 @@ static INLINE void update_write_color_quad(wStream* s, UINT32 color) byte = color & 0xFF; Stream_Write_UINT8(s, byte); } -static INLINE BOOL update_read_2byte_unsigned(wStream* s, UINT32* value) +static inline BOOL update_read_2byte_unsigned(wStream* s, UINT32* value) { BYTE byte = 0; @@ -723,7 +723,7 @@ static INLINE BOOL update_read_2byte_unsigned(wStream* s, UINT32* value) return TRUE; } -static INLINE BOOL update_write_2byte_unsigned(wStream* s, UINT32 value) +static inline BOOL update_write_2byte_unsigned(wStream* s, UINT32 value) { BYTE byte = 0; @@ -745,7 +745,7 @@ static INLINE BOOL update_write_2byte_unsigned(wStream* s, UINT32 value) return TRUE; } -static INLINE BOOL update_read_2byte_signed(wStream* s, INT32* value) +static inline BOOL update_read_2byte_signed(wStream* s, INT32* value) { BYTE byte = 0; BOOL negative = 0; @@ -771,7 +771,7 @@ static INLINE BOOL update_read_2byte_signed(wStream* s, INT32* value) return TRUE; } -static INLINE BOOL update_write_2byte_signed(wStream* s, INT32 value) +static inline BOOL update_write_2byte_signed(wStream* s, INT32 value) { BYTE byte = 0; BOOL negative = FALSE; @@ -808,7 +808,7 @@ static INLINE BOOL update_write_2byte_signed(wStream* s, INT32 value) return TRUE; } -static INLINE BOOL update_read_4byte_unsigned(wStream* s, UINT32* value) +static inline BOOL update_read_4byte_unsigned(wStream* s, UINT32* value) { if (!Stream_CheckAndLogRequiredLength(TAG, s, 1)) return FALSE; @@ -849,7 +849,7 @@ static INLINE BOOL update_read_4byte_unsigned(wStream* s, UINT32* value) return TRUE; } -static INLINE BOOL update_write_4byte_unsigned(wStream* s, UINT32 value) +static inline BOOL update_write_4byte_unsigned(wStream* s, UINT32 value) { BYTE byte = 0; @@ -890,7 +890,7 @@ static INLINE BOOL update_write_4byte_unsigned(wStream* s, UINT32 value) return TRUE; } -static INLINE BOOL update_read_delta(wStream* s, INT32* value) +static inline BOOL update_read_delta(wStream* s, INT32* value) { BYTE byte = 0; UINT32 uvalue = 0; @@ -918,7 +918,7 @@ static INLINE BOOL update_read_delta(wStream* s, INT32* value) return TRUE; } -static INLINE BOOL update_read_brush(wStream* s, rdpBrush* brush, BYTE fieldFlags) +static inline BOOL update_read_brush(wStream* s, rdpBrush* brush, BYTE fieldFlags) { if (fieldFlags & ORDER_FIELD_01) { @@ -981,7 +981,7 @@ static INLINE BOOL update_read_brush(wStream* s, rdpBrush* brush, BYTE fieldFlag return TRUE; } -static INLINE BOOL update_write_brush(wStream* s, rdpBrush* brush, BYTE fieldFlags) +static inline BOOL update_write_brush(wStream* s, rdpBrush* brush, BYTE fieldFlags) { if (fieldFlags & ORDER_FIELD_01) { @@ -1039,7 +1039,7 @@ static INLINE BOOL update_write_brush(wStream* s, rdpBrush* brush, BYTE fieldFla return TRUE; } -static INLINE BOOL update_read_delta_rects(wStream* s, DELTA_RECT* rectangles, const UINT32* nr) +static inline BOOL update_read_delta_rects(wStream* s, DELTA_RECT* rectangles, const UINT32* nr) { UINT32 number = *nr; BYTE flags = 0; @@ -1104,7 +1104,7 @@ static INLINE BOOL update_read_delta_rects(wStream* s, DELTA_RECT* rectangles, c return TRUE; } -static INLINE BOOL update_read_delta_points(wStream* s, DELTA_POINT** points, UINT32 number, +static inline BOOL update_read_delta_points(wStream* s, DELTA_POINT** points, UINT32 number, WINPR_ATTR_UNUSED INT16 x, WINPR_ATTR_UNUSED INT16 y) { BYTE flags = 0; @@ -1155,7 +1155,7 @@ static BOOL order_field_flag_is_set(const ORDER_INFO* orderInfo, BYTE number) return set; } -static INLINE BOOL read_order_field_byte(const char* orderName, const ORDER_INFO* orderInfo, +static inline BOOL read_order_field_byte(const char* orderName, const ORDER_INFO* orderInfo, wStream* s, BYTE number, UINT32* target, BOOL optional) { WINPR_ASSERT(orderName); @@ -1174,7 +1174,7 @@ static INLINE BOOL read_order_field_byte(const char* orderName, const ORDER_INFO return TRUE; } -static INLINE BOOL read_order_field_2bytes(const char* orderName, const ORDER_INFO* orderInfo, +static inline BOOL read_order_field_2bytes(const char* orderName, const ORDER_INFO* orderInfo, wStream* s, BYTE number, UINT32* target1, UINT32* target2, BOOL optional) { @@ -1196,7 +1196,7 @@ static INLINE BOOL read_order_field_2bytes(const char* orderName, const ORDER_IN return TRUE; } -static INLINE BOOL read_order_field_uint16(const char* orderName, const ORDER_INFO* orderInfo, +static inline BOOL read_order_field_uint16(const char* orderName, const ORDER_INFO* orderInfo, wStream* s, BYTE number, UINT32* target, BOOL optional) { WINPR_ASSERT(orderName); @@ -1217,7 +1217,7 @@ static INLINE BOOL read_order_field_uint16(const char* orderName, const ORDER_IN return TRUE; } -static INLINE BOOL read_order_field_int16(const char* orderName, const ORDER_INFO* orderInfo, +static inline BOOL read_order_field_int16(const char* orderName, const ORDER_INFO* orderInfo, wStream* s, BYTE number, INT32* target, BOOL optional) { WINPR_ASSERT(orderName); @@ -1238,7 +1238,7 @@ static INLINE BOOL read_order_field_int16(const char* orderName, const ORDER_INF return TRUE; } -static INLINE BOOL read_order_field_uint32(const char* orderName, const ORDER_INFO* orderInfo, +static inline BOOL read_order_field_uint32(const char* orderName, const ORDER_INFO* orderInfo, wStream* s, BYTE number, UINT32* target, BOOL optional) { WINPR_ASSERT(orderName); @@ -1259,7 +1259,7 @@ static INLINE BOOL read_order_field_uint32(const char* orderName, const ORDER_IN return TRUE; } -static INLINE BOOL read_order_field_coord(const char* orderName, const ORDER_INFO* orderInfo, +static inline BOOL read_order_field_coord(const char* orderName, const ORDER_INFO* orderInfo, wStream* s, UINT32 NO, INT32* TARGET, BOOL optional) { WINPR_ASSERT(orderName); @@ -1276,7 +1276,7 @@ static INLINE BOOL read_order_field_coord(const char* orderName, const ORDER_INF return update_read_coord(s, TARGET, orderInfo->deltaCoordinates); } -static INLINE BOOL read_order_field_color(const char* orderName, const ORDER_INFO* orderInfo, +static inline BOOL read_order_field_color(const char* orderName, const ORDER_INFO* orderInfo, wStream* s, UINT32 NO, UINT32* TARGET, BOOL optional) { WINPR_ASSERT(orderName); @@ -1295,7 +1295,7 @@ static INLINE BOOL read_order_field_color(const char* orderName, const ORDER_INF return TRUE; } -static INLINE BOOL FIELD_SKIP_BUFFER16(wStream* s, UINT32 TARGET_LEN) +static inline BOOL FIELD_SKIP_BUFFER16(wStream* s, UINT32 TARGET_LEN) { if (!Stream_CheckAndLogRequiredLength(TAG, s, 2)) return FALSE; diff --git a/libfreerdp/core/tcp.h b/libfreerdp/core/tcp.h index 7512d932d..efa9f9fa8 100644 --- a/libfreerdp/core/tcp.h +++ b/libfreerdp/core/tcp.h @@ -54,40 +54,40 @@ #define BIO_C_WAIT_WRITE 1108 #define BIO_C_SET_HANDLE 1109 -static INLINE long BIO_set_socket(BIO* b, SOCKET s, long c) +static inline long BIO_set_socket(BIO* b, SOCKET s, long c) { return BIO_ctrl(b, BIO_C_SET_SOCKET, c, (void*)(intptr_t)s); } -static INLINE long BIO_get_socket(BIO* b, SOCKET* c) +static inline long BIO_get_socket(BIO* b, SOCKET* c) { return BIO_ctrl(b, BIO_C_GET_SOCKET, 0, c); } -static INLINE long BIO_get_event(BIO* b, HANDLE* c) +static inline long BIO_get_event(BIO* b, HANDLE* c) { return BIO_ctrl(b, BIO_C_GET_EVENT, 0, (void*)c); } -static INLINE long BIO_set_handle(BIO* b, HANDLE h) +static inline long BIO_set_handle(BIO* b, HANDLE h) { return BIO_ctrl(b, BIO_C_SET_HANDLE, 0, h); } -static INLINE long BIO_set_nonblock(BIO* b, long c) +static inline long BIO_set_nonblock(BIO* b, long c) { return BIO_ctrl(b, BIO_C_SET_NONBLOCK, c, NULL); } -static INLINE long BIO_read_blocked(BIO* b) +static inline long BIO_read_blocked(BIO* b) { return BIO_ctrl(b, BIO_C_READ_BLOCKED, 0, NULL); } -static INLINE long BIO_write_blocked(BIO* b) +static inline long BIO_write_blocked(BIO* b) { return BIO_ctrl(b, BIO_C_WRITE_BLOCKED, 0, NULL); } -static INLINE long BIO_wait_read(BIO* b, long c) +static inline long BIO_wait_read(BIO* b, long c) { return BIO_ctrl(b, BIO_C_WAIT_READ, c, NULL); } -static INLINE long BIO_wait_write(BIO* b, long c) +static inline long BIO_wait_write(BIO* b, long c) { return BIO_ctrl(b, BIO_C_WAIT_WRITE, c, NULL); } diff --git a/libfreerdp/core/update.h b/libfreerdp/core/update.h index e16054454..1c883fdc1 100644 --- a/libfreerdp/core/update.h +++ b/libfreerdp/core/update.h @@ -120,7 +120,7 @@ typedef struct BOOL glyph_v2; } rdp_secondary_update_internal; -static INLINE rdp_update_internal* update_cast(rdpUpdate* update) +static inline rdp_update_internal* update_cast(rdpUpdate* update) { union { @@ -133,7 +133,7 @@ static INLINE rdp_update_internal* update_cast(rdpUpdate* update) return cnv.internal; } -static INLINE rdp_altsec_update_internal* altsec_update_cast(rdpAltSecUpdate* update) +static inline rdp_altsec_update_internal* altsec_update_cast(rdpAltSecUpdate* update) { union { @@ -146,7 +146,7 @@ static INLINE rdp_altsec_update_internal* altsec_update_cast(rdpAltSecUpdate* up return cnv.internal; } -static INLINE rdp_primary_update_internal* primary_update_cast(rdpPrimaryUpdate* update) +static inline rdp_primary_update_internal* primary_update_cast(rdpPrimaryUpdate* update) { union { @@ -159,7 +159,7 @@ static INLINE rdp_primary_update_internal* primary_update_cast(rdpPrimaryUpdate* return cnv.internal; } -static INLINE rdp_secondary_update_internal* secondary_update_cast(rdpSecondaryUpdate* update) +static inline rdp_secondary_update_internal* secondary_update_cast(rdpSecondaryUpdate* update) { union { diff --git a/libfreerdp/crypto/base64.c b/libfreerdp/crypto/base64.c index 315da9203..091e9a7e2 100644 --- a/libfreerdp/crypto/base64.c +++ b/libfreerdp/crypto/base64.c @@ -302,7 +302,7 @@ static const signed char dec_base64[] = { -1, /* 127 177 7F 01111111 DEL  Delete */ }; -static INLINE char* base64_encode_ex(const BYTE* WINPR_RESTRICT alphabet, +static inline char* base64_encode_ex(const BYTE* WINPR_RESTRICT alphabet, const BYTE* WINPR_RESTRICT data, size_t length, BOOL pad, BOOL crLf, size_t lineSize) { @@ -392,13 +392,13 @@ static INLINE char* base64_encode_ex(const BYTE* WINPR_RESTRICT alphabet, return ret; } -static INLINE char* base64_encode(const BYTE* WINPR_RESTRICT alphabet, +static inline char* base64_encode(const BYTE* WINPR_RESTRICT alphabet, const BYTE* WINPR_RESTRICT data, size_t length, BOOL pad) { return base64_encode_ex(alphabet, data, length, pad, FALSE, 64); } -static INLINE int base64_decode_char(const signed char* WINPR_RESTRICT alphabet, char c) +static inline int base64_decode_char(const signed char* WINPR_RESTRICT alphabet, char c) { if (c <= '\0') return -1; @@ -406,7 +406,7 @@ static INLINE int base64_decode_char(const signed char* WINPR_RESTRICT alphabet, return alphabet[(size_t)c]; } -static INLINE void* base64_decode(const signed char* WINPR_RESTRICT alphabet, +static inline void* base64_decode(const signed char* WINPR_RESTRICT alphabet, const char* WINPR_RESTRICT s, size_t length, size_t* WINPR_RESTRICT data_len, BOOL pad) { diff --git a/libfreerdp/crypto/opensslcompat.h b/libfreerdp/crypto/opensslcompat.h index 82a50f995..aaded44ce 100644 --- a/libfreerdp/crypto/opensslcompat.h +++ b/libfreerdp/crypto/opensslcompat.h @@ -69,7 +69,7 @@ void RSA_get0_key(const RSA* r, const BIGNUM** n, const BIGNUM** e, const BIGNUM #if defined(LIBRESSL_VERSION_NUMBER) || \ (defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER < 0x1010000fL)) -static INLINE STACK_OF(X509) * sk_X509_deep_copy(const STACK_OF(X509) * sk, +static inline STACK_OF(X509) * sk_X509_deep_copy(const STACK_OF(X509) * sk, X509* (*copyfunc)(const X509*), void (*freefunc)(X509*)) { @@ -106,7 +106,7 @@ fail: * While the TYPE_dup function take non const arguments * the TYPE_sk versions require the arguments to be const... */ -static INLINE X509* X509_const_dup(const X509* x509) +static inline X509* X509_const_dup(const X509* x509) { X509* ptr = WINPR_CAST_CONST_PTR_AWAY(x509, X509*); return X509_dup(ptr); diff --git a/libfreerdp/gdi/bitmap.c b/libfreerdp/gdi/bitmap.c index 372f242d4..80a9cd861 100644 --- a/libfreerdp/gdi/bitmap.c +++ b/libfreerdp/gdi/bitmap.c @@ -73,7 +73,7 @@ BYTE* gdi_GetPointer(HGDI_BITMAP hBmp, UINT32 X, UINT32 Y) * @return the color written */ -static INLINE UINT32 gdi_SetPixelBmp(HGDI_BITMAP hBmp, UINT32 X, UINT32 Y, UINT32 crColor) +static inline UINT32 gdi_SetPixelBmp(HGDI_BITMAP hBmp, UINT32 X, UINT32 Y, UINT32 crColor) { BYTE* p = &hBmp->data[(Y * hBmp->scanline) + X * FreeRDPGetBytesPerPixel(hBmp->format)]; FreeRDPWriteColor(p, hBmp->format, crColor); @@ -283,7 +283,7 @@ static UINT32 process_rop(UINT32 src, UINT32 dst, UINT32 pat, const char* rop, U return stack[0]; } -static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, INT32 nXDest, INT32 nYDest, +static inline BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, INT32 nXDest, INT32 nYDest, INT32 nXSrc, INT32 nYSrc, INT32 x, INT32 y, BOOL useSrc, BOOL usePat, UINT32 style, const char* rop, const gdiPalette* palette) diff --git a/libfreerdp/gdi/brush.h b/libfreerdp/gdi/brush.h index 6845c5d73..c13aa20d2 100644 --- a/libfreerdp/gdi/brush.h +++ b/libfreerdp/gdi/brush.h @@ -38,7 +38,7 @@ extern "C" FREERDP_LOCAL HGDI_BRUSH gdi_CreatePatternBrush(HGDI_BITMAP hbmp); FREERDP_LOCAL HGDI_BRUSH gdi_CreateHatchBrush(HGDI_BITMAP hbmp); - static INLINE UINT32 gdi_GetBrushStyle(HGDI_DC hdc) + static inline UINT32 gdi_GetBrushStyle(HGDI_DC hdc) { if (!hdc || !hdc->brush) return GDI_BS_NULL; diff --git a/libfreerdp/gdi/gdi.h b/libfreerdp/gdi/gdi.h index e1c86d3c8..4c0ffa628 100644 --- a/libfreerdp/gdi/gdi.h +++ b/libfreerdp/gdi/gdi.h @@ -32,7 +32,7 @@ FREERDP_LOCAL BOOL gdi_bitmap_update(rdpContext* context, const BITMAP_UPDATE* b FREERDP_LOCAL gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, BYTE* data); FREERDP_LOCAL void gdi_bitmap_free_ex(gdiBitmap* gdi_bmp); -static INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, INT32 x, INT32 y) +static inline BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, INT32 x, INT32 y) { HGDI_BITMAP hBmp = (HGDI_BITMAP)hdcBmp->selectedObject; @@ -59,7 +59,7 @@ static INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, INT32 x, INT32 y) * @param y dest y-coordinate * @return color pointer */ -static INLINE BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, UINT32 x, UINT32 y) +static inline BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, UINT32 x, UINT32 y) { BYTE* p = NULL; UINT32 brushStyle = gdi_GetBrushStyle(hdcBrush); diff --git a/libfreerdp/gdi/region.c b/libfreerdp/gdi/region.c index 91fbb8d84..6a973454f 100644 --- a/libfreerdp/gdi/region.c +++ b/libfreerdp/gdi/region.c @@ -440,7 +440,7 @@ BOOL gdi_CRgnToCRect(INT32 x, INT32 y, INT32 w, INT32 h, INT32* left, INT32* top * @return nonzero if there is an overlap, 0 otherwise */ -INLINE BOOL gdi_CopyOverlap(INT32 x, INT32 y, INT32 width, INT32 height, INT32 srcx, INT32 srcy) +inline BOOL gdi_CopyOverlap(INT32 x, INT32 y, INT32 width, INT32 height, INT32 srcx, INT32 srcy) { GDI_RECT dst; GDI_RECT src; @@ -471,7 +471,7 @@ INLINE BOOL gdi_CopyOverlap(INT32 x, INT32 y, INT32 width, INT32 height, INT32 s * @return nonzero if successful, 0 otherwise */ -INLINE BOOL gdi_SetRect(GDI_RECT* rc, INT32 xLeft, INT32 yTop, INT32 xRight, INT32 yBottom) +inline BOOL gdi_SetRect(GDI_RECT* rc, INT32 xLeft, INT32 yTop, INT32 xRight, INT32 yBottom) { if (!rc) return FALSE; @@ -497,7 +497,7 @@ INLINE BOOL gdi_SetRect(GDI_RECT* rc, INT32 xLeft, INT32 yTop, INT32 xRight, INT * @return nonzero if successful, 0 otherwise */ -INLINE BOOL gdi_SetRgn(GDI_RGN* hRgn, INT32 nXLeft, INT32 nYLeft, INT32 nWidth, INT32 nHeight) +inline BOOL gdi_SetRgn(GDI_RGN* hRgn, INT32 nXLeft, INT32 nYLeft, INT32 nWidth, INT32 nHeight) { if (!hRgn) return FALSE; @@ -523,7 +523,7 @@ INLINE BOOL gdi_SetRgn(GDI_RGN* hRgn, INT32 nXLeft, INT32 nYLeft, INT32 nWidth, * @return nonzero if successful, 0 otherwise */ -INLINE BOOL gdi_SetRectRgn(GDI_RGN* hRgn, INT32 nLeftRect, INT32 nTopRect, INT32 nRightRect, +inline BOOL gdi_SetRectRgn(GDI_RGN* hRgn, INT32 nLeftRect, INT32 nTopRect, INT32 nRightRect, INT32 nBottomRect) { if (!gdi_CRectToRgn(nLeftRect, nTopRect, nRightRect, nBottomRect, hRgn)) @@ -541,7 +541,7 @@ INLINE BOOL gdi_SetRectRgn(GDI_RGN* hRgn, INT32 nLeftRect, INT32 nTopRect, INT32 * @return nonzero if both regions are equal, 0 otherwise */ -INLINE BOOL gdi_EqualRgn(const GDI_RGN* hSrcRgn1, const GDI_RGN* hSrcRgn2) +inline BOOL gdi_EqualRgn(const GDI_RGN* hSrcRgn1, const GDI_RGN* hSrcRgn2) { WINPR_ASSERT(hSrcRgn1); WINPR_ASSERT(hSrcRgn2); @@ -563,7 +563,7 @@ INLINE BOOL gdi_EqualRgn(const GDI_RGN* hSrcRgn1, const GDI_RGN* hSrcRgn2) * @return nonzero if successful, 0 otherwise */ -INLINE BOOL gdi_CopyRect(GDI_RECT* dst, const GDI_RECT* src) +inline BOOL gdi_CopyRect(GDI_RECT* dst, const GDI_RECT* src) { if (!dst || !src) return FALSE; @@ -584,7 +584,7 @@ INLINE BOOL gdi_CopyRect(GDI_RECT* dst, const GDI_RECT* src) * @return nonzero if the point is inside, 0 otherwise */ -INLINE BOOL gdi_PtInRect(const GDI_RECT* rc, INT32 x, INT32 y) +inline BOOL gdi_PtInRect(const GDI_RECT* rc, INT32 x, INT32 y) { /* * points on the left and top sides are considered in, @@ -612,7 +612,7 @@ INLINE BOOL gdi_PtInRect(const GDI_RECT* rc, INT32 x, INT32 y) * @return nonzero on success, 0 otherwise */ -INLINE BOOL gdi_InvalidateRegion(HGDI_DC hdc, INT32 x, INT32 y, INT32 w, INT32 h) +inline BOOL gdi_InvalidateRegion(HGDI_DC hdc, INT32 x, INT32 y, INT32 w, INT32 h) { GDI_RECT inv; GDI_RECT rgn; diff --git a/libfreerdp/primitives/neon/prim_YUV_neon.c b/libfreerdp/primitives/neon/prim_YUV_neon.c index 7cafde53a..b7f2ef031 100644 --- a/libfreerdp/primitives/neon/prim_YUV_neon.c +++ b/libfreerdp/primitives/neon/prim_YUV_neon.c @@ -35,7 +35,7 @@ static primitives_t* generic = NULL; -static INLINE uint8x8_t neon_YUV2R_single(uint16x8_t C, int16x8_t D, int16x8_t E) +static inline uint8x8_t neon_YUV2R_single(uint16x8_t C, int16x8_t D, int16x8_t E) { /* R = (256 * Y + 403 * (V - 128)) >> 8 */ const int32x4_t Ch = vreinterpretq_s32_u32(vmovl_u16(vget_high_u16(C))); @@ -51,14 +51,14 @@ static INLINE uint8x8_t neon_YUV2R_single(uint16x8_t C, int16x8_t D, int16x8_t E return vqmovun_s16(ce); } -static INLINE uint8x8x2_t neon_YUV2R(uint16x8x2_t C, int16x8x2_t D, int16x8x2_t E) +static inline uint8x8x2_t neon_YUV2R(uint16x8x2_t C, int16x8x2_t D, int16x8x2_t E) { uint8x8x2_t res = { { neon_YUV2R_single(C.val[0], D.val[0], E.val[0]), neon_YUV2R_single(C.val[1], D.val[1], E.val[1]) } }; return res; } -static INLINE uint8x8_t neon_YUV2G_single(uint16x8_t C, int16x8_t D, int16x8_t E) +static inline uint8x8_t neon_YUV2G_single(uint16x8_t C, int16x8_t D, int16x8_t E) { /* G = (256L * Y - 48 * (U - 128) - 120 * (V - 128)) >> 8 */ const int16x8_t d48 = vmulq_n_s16(D, 48); @@ -78,14 +78,14 @@ static INLINE uint8x8_t neon_YUV2G_single(uint16x8_t C, int16x8_t D, int16x8_t E return vqmovun_s16(cde); } -static INLINE uint8x8x2_t neon_YUV2G(uint16x8x2_t C, int16x8x2_t D, int16x8x2_t E) +static inline uint8x8x2_t neon_YUV2G(uint16x8x2_t C, int16x8x2_t D, int16x8x2_t E) { uint8x8x2_t res = { { neon_YUV2G_single(C.val[0], D.val[0], E.val[0]), neon_YUV2G_single(C.val[1], D.val[1], E.val[1]) } }; return res; } -static INLINE uint8x8_t neon_YUV2B_single(uint16x8_t C, int16x8_t D, int16x8_t E) +static inline uint8x8_t neon_YUV2B_single(uint16x8_t C, int16x8_t D, int16x8_t E) { /* B = (256L * Y + 475 * (U - 128)) >> 8*/ const int32x4_t Ch = vreinterpretq_s32_u32(vmovl_u16(vget_high_u16(C))); @@ -101,7 +101,7 @@ static INLINE uint8x8_t neon_YUV2B_single(uint16x8_t C, int16x8_t D, int16x8_t E return vqmovun_s16(cd); } -static INLINE uint8x8x2_t neon_YUV2B(uint16x8x2_t C, int16x8x2_t D, int16x8x2_t E) +static inline uint8x8x2_t neon_YUV2B(uint16x8x2_t C, int16x8x2_t D, int16x8x2_t E) { uint8x8x2_t res = { { neon_YUV2B_single(C.val[0], D.val[0], E.val[0]), neon_YUV2B_single(C.val[1], D.val[1], E.val[1]) } }; @@ -118,7 +118,7 @@ static inline void neon_store_bgrx(BYTE* WINPR_RESTRICT pRGB, uint8x8_t r, uint8 vst4_u8(pRGB, bgrx); } -static INLINE void neon_YuvToRgbPixel(BYTE* pRGB, uint8x8x2_t Y, int16x8x2_t D, int16x8x2_t E, +static inline void neon_YuvToRgbPixel(BYTE* pRGB, uint8x8x2_t Y, int16x8x2_t D, int16x8x2_t E, const uint8_t rPos, const uint8_t gPos, const uint8_t bPos, const uint8_t aPos) { @@ -144,7 +144,7 @@ static inline int16x8x2_t loadUV(const BYTE* WINPR_RESTRICT pV, size_t x) return vzipq_s16(E, E); } -static INLINE void neon_write_pixel(BYTE* pRGB, BYTE Y, BYTE U, BYTE V, const uint8_t rPos, +static inline void neon_write_pixel(BYTE* pRGB, BYTE Y, BYTE U, BYTE V, const uint8_t rPos, const uint8_t gPos, const uint8_t bPos, const uint8_t aPos) { const BYTE r = YUV2R(Y, U, V); @@ -156,7 +156,7 @@ static INLINE void neon_write_pixel(BYTE* pRGB, BYTE Y, BYTE U, BYTE V, const ui pRGB[bPos] = b; } -static INLINE void neon_YUV420ToX_DOUBLE_ROW(const BYTE* WINPR_RESTRICT pY[2], +static inline void neon_YUV420ToX_DOUBLE_ROW(const BYTE* WINPR_RESTRICT pY[2], const BYTE* WINPR_RESTRICT pU, const BYTE* WINPR_RESTRICT pV, BYTE* WINPR_RESTRICT pRGB[2], size_t width, @@ -199,7 +199,7 @@ static INLINE void neon_YUV420ToX_DOUBLE_ROW(const BYTE* WINPR_RESTRICT pY[2], } } -static INLINE void neon_YUV420ToX_SINGLE_ROW(const BYTE* WINPR_RESTRICT pY, +static inline void neon_YUV420ToX_SINGLE_ROW(const BYTE* WINPR_RESTRICT pY, const BYTE* WINPR_RESTRICT pU, const BYTE* WINPR_RESTRICT pV, BYTE* WINPR_RESTRICT pRGB, size_t width, @@ -234,7 +234,7 @@ static INLINE void neon_YUV420ToX_SINGLE_ROW(const BYTE* WINPR_RESTRICT pY, } } -static INLINE pstatus_t neon_YUV420ToX(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], +static inline pstatus_t neon_YUV420ToX(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, const prim_size_t* WINPR_RESTRICT roi, const uint8_t rPos, const uint8_t gPos, const uint8_t bPos, const uint8_t aPos) @@ -368,7 +368,7 @@ static inline void neon_avgUV(uint8x16_t pU[2]) pU[0] = u; } -static INLINE pstatus_t neon_YUV444ToX_SINGLE_ROW(const BYTE* WINPR_RESTRICT pY, +static inline pstatus_t neon_YUV444ToX_SINGLE_ROW(const BYTE* WINPR_RESTRICT pY, const BYTE* WINPR_RESTRICT pU, const BYTE* WINPR_RESTRICT pV, BYTE* WINPR_RESTRICT pRGB, size_t width, @@ -407,7 +407,7 @@ static INLINE pstatus_t neon_YUV444ToX_SINGLE_ROW(const BYTE* WINPR_RESTRICT pY, return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t neon_YUV444ToX_DOUBLE_ROW(const BYTE* WINPR_RESTRICT pY[2], +static inline pstatus_t neon_YUV444ToX_DOUBLE_ROW(const BYTE* WINPR_RESTRICT pY[2], const BYTE* WINPR_RESTRICT pU[2], const BYTE* WINPR_RESTRICT pV[2], BYTE* WINPR_RESTRICT pRGB[2], size_t width, @@ -464,7 +464,7 @@ static INLINE pstatus_t neon_YUV444ToX_DOUBLE_ROW(const BYTE* WINPR_RESTRICT pY[ return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t neon_YUV444ToX(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], +static inline pstatus_t neon_YUV444ToX(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, const prim_size_t* WINPR_RESTRICT roi, const uint8_t rPos, const uint8_t gPos, const uint8_t bPos, const uint8_t aPos) diff --git a/libfreerdp/primitives/prim_add.c b/libfreerdp/primitives/prim_add.c index 38e2c93b9..c6b3bf1e0 100644 --- a/libfreerdp/primitives/prim_add.c +++ b/libfreerdp/primitives/prim_add.c @@ -27,7 +27,7 @@ /* ---------------------------------------------------------------------------- * 16-bit signed add with saturation (under and over). */ -static INLINE INT16 add(INT16 a, INT16 b) +static inline INT16 add(INT16 a, INT16 b) { INT32 k = (INT32)a + (INT32)b; diff --git a/libfreerdp/primitives/prim_colors.c b/libfreerdp/primitives/prim_colors.c index 404485808..17390e614 100644 --- a/libfreerdp/primitives/prim_colors.c +++ b/libfreerdp/primitives/prim_colors.c @@ -330,7 +330,7 @@ general_RGBToYCbCr_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], INT32 srcSte return PRIMITIVES_SUCCESS; } -static INLINE void writeScanlineGeneric(BYTE* dst, DWORD formatSize, UINT32 DstFormat, +static inline void writeScanlineGeneric(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, const INT16* g, const INT16* b, DWORD width) { fkt_writePixel writePixel = getPixelWriteFunction(DstFormat, FALSE); @@ -347,7 +347,7 @@ static INLINE void writeScanlineGeneric(BYTE* dst, DWORD formatSize, UINT32 DstF } } -static INLINE void writeScanlineRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, +static inline void writeScanlineRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, const INT16* g, const INT16* b, DWORD width) { WINPR_UNUSED(formatSize); @@ -364,7 +364,7 @@ static INLINE void writeScanlineRGB(BYTE* dst, DWORD formatSize, UINT32 DstForma } } -static INLINE void writeScanlineBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, +static inline void writeScanlineBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, const INT16* g, const INT16* b, DWORD width) { WINPR_UNUSED(formatSize); @@ -381,7 +381,7 @@ static INLINE void writeScanlineBGR(BYTE* dst, DWORD formatSize, UINT32 DstForma } } -static INLINE void writeScanlineBGRX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, +static inline void writeScanlineBGRX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, const INT16* g, const INT16* b, DWORD width) { WINPR_UNUSED(formatSize); @@ -399,7 +399,7 @@ static INLINE void writeScanlineBGRX(BYTE* dst, DWORD formatSize, UINT32 DstForm } } -static INLINE void writeScanlineRGBX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, +static inline void writeScanlineRGBX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, const INT16* g, const INT16* b, DWORD width) { WINPR_UNUSED(formatSize); @@ -417,7 +417,7 @@ static INLINE void writeScanlineRGBX(BYTE* dst, DWORD formatSize, UINT32 DstForm } } -static INLINE void writeScanlineXBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, +static inline void writeScanlineXBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, const INT16* g, const INT16* b, DWORD width) { WINPR_UNUSED(formatSize); @@ -435,7 +435,7 @@ static INLINE void writeScanlineXBGR(BYTE* dst, DWORD formatSize, UINT32 DstForm } } -static INLINE void writeScanlineXRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, +static inline void writeScanlineXRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r, const INT16* g, const INT16* b, DWORD width) { WINPR_UNUSED(formatSize); @@ -456,7 +456,7 @@ static INLINE void writeScanlineXRGB(BYTE* dst, DWORD formatSize, UINT32 DstForm typedef void (*fkt_writeScanline)(BYTE*, DWORD, UINT32, const INT16*, const INT16*, const INT16*, DWORD); -static INLINE fkt_writeScanline getScanlineWriteFunction(DWORD format) +static inline fkt_writeScanline getScanlineWriteFunction(DWORD format) { switch (format) { diff --git a/libfreerdp/primitives/prim_copy.c b/libfreerdp/primitives/prim_copy.c index 5980ecc34..76bd51acf 100644 --- a/libfreerdp/primitives/prim_copy.c +++ b/libfreerdp/primitives/prim_copy.c @@ -142,7 +142,7 @@ static pstatus_t general_copy_8u_AC4r(const BYTE* WINPR_RESTRICT pSrc, INT32 src return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t generic_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstData, +static inline pstatus_t generic_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, @@ -183,11 +183,12 @@ static INLINE pstatus_t generic_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDs return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t generic_image_copy_bgrx32_bgrx32( - BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, - UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, UINT32 nSrcStep, UINT32 nXSrc, - UINT32 nYSrc, int64_t srcVMultiplier, int64_t srcVOffset, int64_t dstVMultiplier, - int64_t dstVOffset) +static inline pstatus_t +generic_image_copy_bgrx32_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, + UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, + const BYTE* WINPR_RESTRICT pSrcData, UINT32 nSrcStep, UINT32 nXSrc, + UINT32 nYSrc, int64_t srcVMultiplier, int64_t srcVOffset, + int64_t dstVMultiplier, int64_t dstVOffset) { const int64_t srcByte = 4; @@ -282,7 +283,7 @@ pstatus_t generic_image_copy_no_overlap_memcpy( return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t generic_image_copy_no_overlap_dst_alpha( +static inline pstatus_t generic_image_copy_no_overlap_dst_alpha( BYTE* WINPR_RESTRICT pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, DWORD SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* WINPR_RESTRICT palette, @@ -344,7 +345,7 @@ static INLINE pstatus_t generic_image_copy_no_overlap_dst_alpha( nXSrc, nYSrc, palette, srcVMultiplier, srcVOffset, dstVMultiplier, dstVOffset); } -static INLINE pstatus_t generic_image_copy_no_overlap_no_alpha( +static inline pstatus_t generic_image_copy_no_overlap_no_alpha( BYTE* WINPR_RESTRICT pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, DWORD SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* WINPR_RESTRICT palette, diff --git a/libfreerdp/primitives/prim_internal.h b/libfreerdp/primitives/prim_internal.h index 63877920d..66c03a856 100644 --- a/libfreerdp/primitives/prim_internal.h +++ b/libfreerdp/primitives/prim_internal.h @@ -41,7 +41,7 @@ #define HAVE_CPU_OPTIMIZED_PRIMITIVES 1 #endif -static INLINE BYTE* writePixelBGRA(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, +static inline BYTE* writePixelBGRA(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { WINPR_UNUSED(formatSize); @@ -54,7 +54,7 @@ static INLINE BYTE* writePixelBGRA(BYTE* dst, DWORD formatSize, UINT32 format, B return dst; } -static INLINE BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, +static inline BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { WINPR_UNUSED(formatSize); @@ -69,7 +69,7 @@ static INLINE BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format, B return dst; } -static INLINE BYTE* writePixelRGBA(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, +static inline BYTE* writePixelRGBA(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { WINPR_UNUSED(formatSize); @@ -82,7 +82,7 @@ static INLINE BYTE* writePixelRGBA(BYTE* dst, DWORD formatSize, UINT32 format, B return dst; } -static INLINE BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, +static inline BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { WINPR_UNUSED(formatSize); @@ -97,7 +97,7 @@ static INLINE BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format, B return dst; } -static INLINE BYTE* writePixelABGR(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, +static inline BYTE* writePixelABGR(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { WINPR_UNUSED(formatSize); @@ -110,7 +110,7 @@ static INLINE BYTE* writePixelABGR(BYTE* dst, DWORD formatSize, UINT32 format, B return dst; } -static INLINE BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, +static inline BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { WINPR_UNUSED(formatSize); @@ -124,7 +124,7 @@ static INLINE BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format, B return dst; } -static INLINE BYTE* writePixelARGB(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, +static inline BYTE* writePixelARGB(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { WINPR_UNUSED(formatSize); @@ -137,7 +137,7 @@ static INLINE BYTE* writePixelARGB(BYTE* dst, DWORD formatSize, UINT32 format, B return dst; } -static INLINE BYTE* writePixelXRGB(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, +static inline BYTE* writePixelXRGB(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { WINPR_UNUSED(formatSize); @@ -151,7 +151,7 @@ static INLINE BYTE* writePixelXRGB(BYTE* dst, DWORD formatSize, UINT32 format, B return dst; } -static INLINE BYTE* writePixelGenericAlpha(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, +static inline BYTE* writePixelGenericAlpha(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { UINT32 color = FreeRDPGetColor(format, R, G, B, A); @@ -159,7 +159,7 @@ static INLINE BYTE* writePixelGenericAlpha(BYTE* dst, DWORD formatSize, UINT32 f return dst + formatSize; } -static INLINE BYTE* writePixelGeneric(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, +static inline BYTE* writePixelGeneric(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { UINT32 color = FreeRDPGetColor(format, R, G, B, A); @@ -169,7 +169,7 @@ static INLINE BYTE* writePixelGeneric(BYTE* dst, DWORD formatSize, UINT32 format typedef BYTE* (*fkt_writePixel)(BYTE*, DWORD, UINT32, BYTE, BYTE, BYTE, BYTE); -static INLINE fkt_writePixel getPixelWriteFunction(DWORD format, BOOL useAlpha) +static inline fkt_writePixel getPixelWriteFunction(DWORD format, BOOL useAlpha) { switch (format) { @@ -194,7 +194,7 @@ static INLINE fkt_writePixel getPixelWriteFunction(DWORD format, BOOL useAlpha) } } -static INLINE BYTE CLIP(INT64 X) +static inline BYTE CLIP(INT64 X) { if (X > 255L) return 255L; @@ -205,7 +205,7 @@ static INLINE BYTE CLIP(INT64 X) return (BYTE)X; } -static INLINE BYTE CONDITIONAL_CLIP(INT32 in, BYTE original) +static inline BYTE CONDITIONAL_CLIP(INT32 in, BYTE original) { BYTE out = CLIP(in); BYTE diff = 0; @@ -223,36 +223,36 @@ static INLINE BYTE CONDITIONAL_CLIP(INT32 in, BYTE original) * | G | = ( | 256 -48 -120 | | U - 128 | ) >> 8 * | B | ( | 256 475 0 | | V - 128 | ) */ -static INLINE INT32 C(INT32 Y) +static inline INT32 C(INT32 Y) { return (Y)-0; } -static INLINE INT32 D(INT32 U) +static inline INT32 D(INT32 U) { return (U)-128; } -static INLINE INT32 E(INT32 V) +static inline INT32 E(INT32 V) { return (V)-128; } -static INLINE BYTE YUV2R(INT32 Y, INT32 U, INT32 V) +static inline BYTE YUV2R(INT32 Y, INT32 U, INT32 V) { const INT32 r = (256 * C(Y) + 0 * D(U) + 403 * E(V)); const INT32 r8 = r >> 8; return CLIP(r8); } -static INLINE BYTE YUV2G(INT32 Y, INT32 U, INT32 V) +static inline BYTE YUV2G(INT32 Y, INT32 U, INT32 V) { const INT32 g = (256 * C(Y) - 48 * D(U) - 120 * E(V)); const INT32 g8 = g >> 8; return CLIP(g8); } -static INLINE BYTE YUV2B(INT32 Y, INT32 U, INT32 V) +static inline BYTE YUV2B(INT32 Y, INT32 U, INT32 V) { const INT32 b = (256 * C(Y) + 475 * D(U) + 0 * E(V)); const INT32 b8 = b >> 8; @@ -264,19 +264,19 @@ static INLINE BYTE YUV2B(INT32 Y, INT32 U, INT32 V) * | U | = ( | -29 -99 128 | | G | ) >> 8 + | 128 | * | V | ( | 128 -116 -12 | | B | ) | 128 | */ -static INLINE BYTE RGB2Y(INT32 R, INT32 G, INT32 B) +static inline BYTE RGB2Y(INT32 R, INT32 G, INT32 B) { const INT32 val = ((54 * R + 183 * G + 18 * B) >> 8); return WINPR_ASSERTING_INT_CAST(BYTE, val); } -static INLINE BYTE RGB2U(INT32 R, INT32 G, INT32 B) +static inline BYTE RGB2U(INT32 R, INT32 G, INT32 B) { const INT32 val = (((-29 * R - 99 * G + 128 * B) >> 8) + 128); return WINPR_ASSERTING_INT_CAST(BYTE, val); } -static INLINE BYTE RGB2V(INT32 R, INT32 G, INT32 B) +static inline BYTE RGB2V(INT32 R, INT32 G, INT32 B) { const INT32 val = (((128 * R - 116 * G - 12 * B) >> 8) + 128); return WINPR_ASSERTING_INT_CAST(BYTE, val); diff --git a/libfreerdp/primitives/prim_shift.c b/libfreerdp/primitives/prim_shift.c index 838158687..ea5120768 100644 --- a/libfreerdp/primitives/prim_shift.c +++ b/libfreerdp/primitives/prim_shift.c @@ -24,13 +24,13 @@ #include "prim_shift.h" /* ------------------------------------------------------------------------- */ -static INLINE INT16 shift(INT16 val, UINT32 sh) +static inline INT16 shift(INT16 val, UINT32 sh) { const INT16 rc = (int16_t)(((UINT32)val << sh) & 0xFFFF); return WINPR_ASSERTING_INT_CAST(INT16, rc); } -static INLINE pstatus_t general_lShiftC_16s_inplace(INT16* WINPR_RESTRICT pSrcDst, UINT32 val, +static inline pstatus_t general_lShiftC_16s_inplace(INT16* WINPR_RESTRICT pSrcDst, UINT32 val, UINT32 len) { if (val == 0) @@ -44,7 +44,7 @@ static INLINE pstatus_t general_lShiftC_16s_inplace(INT16* WINPR_RESTRICT pSrcDs return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t general_lShiftC_16s(const INT16* WINPR_RESTRICT pSrc, UINT32 val, +static inline pstatus_t general_lShiftC_16s(const INT16* WINPR_RESTRICT pSrc, UINT32 val, INT16* WINPR_RESTRICT pDst, UINT32 len) { if (val == 0) @@ -59,7 +59,7 @@ static INLINE pstatus_t general_lShiftC_16s(const INT16* WINPR_RESTRICT pSrc, UI } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_rShiftC_16s(const INT16* WINPR_RESTRICT pSrc, UINT32 val, +static inline pstatus_t general_rShiftC_16s(const INT16* WINPR_RESTRICT pSrc, UINT32 val, INT16* WINPR_RESTRICT pDst, UINT32 len) { if (val == 0) @@ -74,7 +74,7 @@ static INLINE pstatus_t general_rShiftC_16s(const INT16* WINPR_RESTRICT pSrc, UI } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_lShiftC_16u(const UINT16* WINPR_RESTRICT pSrc, UINT32 val, +static inline pstatus_t general_lShiftC_16u(const UINT16* WINPR_RESTRICT pSrc, UINT32 val, UINT16* WINPR_RESTRICT pDst, UINT32 len) { if (val == 0) @@ -89,7 +89,7 @@ static INLINE pstatus_t general_lShiftC_16u(const UINT16* WINPR_RESTRICT pSrc, U } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_rShiftC_16u(const UINT16* WINPR_RESTRICT pSrc, UINT32 val, +static inline pstatus_t general_rShiftC_16u(const UINT16* WINPR_RESTRICT pSrc, UINT32 val, UINT16* WINPR_RESTRICT pDst, UINT32 len) { if (val == 0) @@ -104,7 +104,7 @@ static INLINE pstatus_t general_rShiftC_16u(const UINT16* WINPR_RESTRICT pSrc, U } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_shiftC_16s(const INT16* WINPR_RESTRICT pSrc, INT32 val, +static inline pstatus_t general_shiftC_16s(const INT16* WINPR_RESTRICT pSrc, INT32 val, INT16* WINPR_RESTRICT pDst, UINT32 len) { if (val == 0) @@ -117,7 +117,7 @@ static INLINE pstatus_t general_shiftC_16s(const INT16* WINPR_RESTRICT pSrc, INT } /* ------------------------------------------------------------------------- */ -static INLINE pstatus_t general_shiftC_16u(const UINT16* WINPR_RESTRICT pSrc, INT32 val, +static inline pstatus_t general_shiftC_16u(const UINT16* WINPR_RESTRICT pSrc, INT32 val, UINT16* WINPR_RESTRICT pDst, UINT32 len) { if (val == 0) diff --git a/libfreerdp/primitives/sse/prim_YUV_sse4.1.c b/libfreerdp/primitives/sse/prim_YUV_sse4.1.c index 381cf860b..1ea3e0145 100644 --- a/libfreerdp/primitives/sse/prim_YUV_sse4.1.c +++ b/libfreerdp/primitives/sse/prim_YUV_sse4.1.c @@ -597,7 +597,7 @@ static inline void sse41_BGRX_TO_YUV(const BYTE* WINPR_RESTRICT pLine1, BYTE* WI /* compute the luma (Y) component from a single rgb source line */ -static INLINE void sse41_RGBToYUV420_BGRX_Y(const BYTE* WINPR_RESTRICT src, BYTE* dst, UINT32 width) +static inline void sse41_RGBToYUV420_BGRX_Y(const BYTE* WINPR_RESTRICT src, BYTE* dst, UINT32 width) { const __m128i y_factors = BGRX_Y_FACTORS; const __m128i* argb = (const __m128i*)src; @@ -641,7 +641,7 @@ static INLINE void sse41_RGBToYUV420_BGRX_Y(const BYTE* WINPR_RESTRICT src, BYTE /* compute the chrominance (UV) components from two rgb source lines */ -static INLINE void sse41_RGBToYUV420_BGRX_UV(const BYTE* WINPR_RESTRICT src1, +static inline void sse41_RGBToYUV420_BGRX_UV(const BYTE* WINPR_RESTRICT src1, const BYTE* WINPR_RESTRICT src2, BYTE* WINPR_RESTRICT dst1, BYTE* WINPR_RESTRICT dst2, UINT32 width) @@ -782,7 +782,7 @@ static pstatus_t sse41_RGBToYUV420(const BYTE* WINPR_RESTRICT pSrc, UINT32 srcFo /* sse41 RGB -> AVC444-YUV conversion **/ /****************************************************************************/ -static INLINE void sse41_RGBToAVC444YUV_BGRX_DOUBLE_ROW( +static inline void sse41_RGBToAVC444YUV_BGRX_DOUBLE_ROW( const BYTE* WINPR_RESTRICT srcEven, const BYTE* WINPR_RESTRICT srcOdd, BYTE* WINPR_RESTRICT b1Even, BYTE* WINPR_RESTRICT b1Odd, BYTE* WINPR_RESTRICT b2, BYTE* WINPR_RESTRICT b3, BYTE* WINPR_RESTRICT b4, BYTE* WINPR_RESTRICT b5, @@ -1070,7 +1070,7 @@ static pstatus_t sse41_RGBToAVC444YUV(const BYTE* WINPR_RESTRICT pSrc, UINT32 sr * b8 -> vChromaDst1 * b9 -> vChromaDst2 */ -static INLINE void sse41_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( +static inline void sse41_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW( const BYTE* WINPR_RESTRICT srcEven, const BYTE* WINPR_RESTRICT srcOdd, BYTE* WINPR_RESTRICT yLumaDstEven, BYTE* WINPR_RESTRICT yLumaDstOdd, BYTE* WINPR_RESTRICT uLumaDst, BYTE* WINPR_RESTRICT vLumaDst, diff --git a/libfreerdp/primitives/sse/prim_copy_avx2.c b/libfreerdp/primitives/sse/prim_copy_avx2.c index 5bc8b0089..c48db558c 100644 --- a/libfreerdp/primitives/sse/prim_copy_avx2.c +++ b/libfreerdp/primitives/sse/prim_copy_avx2.c @@ -39,7 +39,7 @@ static inline __m256i mm256_set_epu32(uint32_t i0, uint32_t i1, uint32_t i2, uin (int32_t)i5, (int32_t)i6, (int32_t)i7); } -static INLINE pstatus_t avx2_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, +static inline pstatus_t avx2_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, @@ -103,7 +103,7 @@ static INLINE pstatus_t avx2_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstDa return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t avx2_image_copy_bgrx32_bgrx32(BYTE* WINPR_RESTRICT pDstData, +static inline pstatus_t avx2_image_copy_bgrx32_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, diff --git a/libfreerdp/primitives/sse/prim_copy_sse4_1.c b/libfreerdp/primitives/sse/prim_copy_sse4_1.c index 422ff8e79..df96c36cd 100644 --- a/libfreerdp/primitives/sse/prim_copy_sse4_1.c +++ b/libfreerdp/primitives/sse/prim_copy_sse4_1.c @@ -33,7 +33,7 @@ #include #include -static INLINE pstatus_t sse_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, +static inline pstatus_t sse_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, @@ -84,7 +84,7 @@ static INLINE pstatus_t sse_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstDat return PRIMITIVES_SUCCESS; } -static INLINE pstatus_t sse_image_copy_bgrx32_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, +static inline pstatus_t sse_image_copy_bgrx32_bgrx32(BYTE* WINPR_RESTRICT pDstData, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index e2e038e58..aa7a52fea 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -108,7 +108,7 @@ static BOOL BitmapUpdateProxyEx(rdpShadowClient* client, const BITMAP_UPDATE* bi return TRUE; } -static INLINE BOOL shadow_client_rdpgfx_new_surface(rdpShadowClient* client) +static inline BOOL shadow_client_rdpgfx_new_surface(rdpShadowClient* client) { UINT error = CHANNEL_RC_OK; RDPGFX_CREATE_SURFACE_PDU createSurface; @@ -151,7 +151,7 @@ static INLINE BOOL shadow_client_rdpgfx_new_surface(rdpShadowClient* client) return TRUE; } -static INLINE BOOL shadow_client_rdpgfx_release_surface(rdpShadowClient* client) +static inline BOOL shadow_client_rdpgfx_release_surface(rdpShadowClient* client) { UINT error = CHANNEL_RC_OK; RDPGFX_DELETE_SURFACE_PDU pdu; @@ -174,7 +174,7 @@ static INLINE BOOL shadow_client_rdpgfx_release_surface(rdpShadowClient* client) return TRUE; } -static INLINE BOOL shadow_client_rdpgfx_reset_graphic(rdpShadowClient* client) +static inline BOOL shadow_client_rdpgfx_reset_graphic(rdpShadowClient* client) { UINT error = CHANNEL_RC_OK; RDPGFX_RESET_GRAPHICS_PDU pdu = { 0 }; @@ -206,7 +206,7 @@ static INLINE BOOL shadow_client_rdpgfx_reset_graphic(rdpShadowClient* client) return TRUE; } -static INLINE void shadow_client_free_queued_message(void* obj) +static inline void shadow_client_free_queued_message(void* obj) { wMessage* message = (wMessage*)obj; @@ -345,7 +345,7 @@ fail: return FALSE; } -static INLINE void shadow_client_mark_invalid(rdpShadowClient* client, UINT32 numRects, +static inline void shadow_client_mark_invalid(rdpShadowClient* client, UINT32 numRects, const RECTANGLE_16* rects) { RECTANGLE_16 screenRegion; @@ -387,7 +387,7 @@ static INLINE void shadow_client_mark_invalid(rdpShadowClient* client, UINT32 nu * * @return TRUE if width/height changed. */ -static INLINE BOOL shadow_client_recalc_desktop_size(rdpShadowClient* client) +static inline BOOL shadow_client_recalc_desktop_size(rdpShadowClient* client) { INT32 width = 0; INT32 height = 0; @@ -592,7 +592,7 @@ static BOOL shadow_client_post_connect(freerdp_peer* peer) } /* Convert rects in sub rect coordinate to client/surface coordinate */ -static INLINE void shadow_client_convert_rects(rdpShadowClient* client, RECTANGLE_16* dst, +static inline void shadow_client_convert_rects(rdpShadowClient* client, RECTANGLE_16* dst, const RECTANGLE_16* src, UINT32 numRects) { WINPR_ASSERT(client); @@ -794,7 +794,7 @@ fail: return rc; } -static INLINE void shadow_client_common_frame_acknowledge(rdpShadowClient* client, UINT32 frameId) +static inline void shadow_client_common_frame_acknowledge(rdpShadowClient* client, UINT32 frameId) { /* * Record the last client acknowledged frame id to @@ -1130,7 +1130,7 @@ static UINT shadow_client_rdpgfx_caps_advertise(RdpgfxServerContext* context, return CHANNEL_RC_UNSUPPORTED_VERSION; } -static INLINE UINT32 rdpgfx_estimate_h264_avc420(RDPGFX_AVC420_BITMAP_STREAM* havc420) +static inline UINT32 rdpgfx_estimate_h264_avc420(RDPGFX_AVC420_BITMAP_STREAM* havc420) { /* H264 metadata + H264 stream. See rdpgfx_write_h264_avc420 */ WINPR_ASSERT(havc420); @@ -2095,7 +2095,7 @@ static BOOL shadow_client_surface_update(rdpShadowClient* client, REGION16* regi * * @return TRUE on success */ -static INLINE BOOL shadow_client_no_surface_update(rdpShadowClient* client, +static inline BOOL shadow_client_no_surface_update(rdpShadowClient* client, SHADOW_GFX_STATUS* pStatus) { rdpShadowServer* server = NULL; diff --git a/winpr/include/winpr/bitstream.h b/winpr/include/winpr/bitstream.h index c1974e74b..32e19a9c2 100644 --- a/winpr/include/winpr/bitstream.h +++ b/winpr/include/winpr/bitstream.h @@ -48,7 +48,7 @@ extern "C" { #endif - static INLINE void BitStream_Prefetch(wBitStream* _bs) + static inline void BitStream_Prefetch(wBitStream* _bs) { WINPR_ASSERT(_bs); @@ -65,7 +65,7 @@ extern "C" (_bs->prefetch) |= ((UINT32)_bs->pointer[7] << 0); } - static INLINE void BitStream_Fetch(wBitStream* _bs) + static inline void BitStream_Fetch(wBitStream* _bs) { WINPR_ASSERT(_bs); (_bs->accumulator) = 0; @@ -82,7 +82,7 @@ extern "C" BitStream_Prefetch(_bs); } - static INLINE void BitStream_Flush(wBitStream* _bs) + static inline void BitStream_Flush(wBitStream* _bs) { WINPR_ASSERT(_bs); const intptr_t diff = _bs->pointer - _bs->buffer; @@ -96,7 +96,7 @@ extern "C" _bs->pointer[3] = (_bs->accumulator >> 0) & 0xFF; } - static INLINE void BitStream_Shift(wBitStream* _bs, UINT32 _nbits) + static inline void BitStream_Shift(wBitStream* _bs, UINT32 _nbits) { WINPR_ASSERT(_bs); if (_nbits == 0) @@ -135,14 +135,14 @@ extern "C" } } - static INLINE void BitStream_Shift32(wBitStream* _bs) + static inline void BitStream_Shift32(wBitStream* _bs) { WINPR_ASSERT(_bs); BitStream_Shift(_bs, 16); BitStream_Shift(_bs, 16); } - static INLINE void BitStream_Write_Bits(wBitStream* _bs, UINT32 _bits, UINT32 _nbits) + static inline void BitStream_Write_Bits(wBitStream* _bs, UINT32 _bits, UINT32 _nbits) { WINPR_ASSERT(_bs); _bs->position += _nbits; @@ -167,7 +167,7 @@ extern "C" } } - static INLINE size_t BitStream_GetRemainingLength(wBitStream* _bs) + static inline size_t BitStream_GetRemainingLength(wBitStream* _bs) { WINPR_ASSERT(_bs); return (_bs->length - _bs->position); diff --git a/winpr/include/winpr/collections.h b/winpr/include/winpr/collections.h index 5824810ac..19b73884e 100644 --- a/winpr/include/winpr/collections.h +++ b/winpr/include/winpr/collections.h @@ -821,20 +821,20 @@ extern "C" typedef void (*p##name##EventHandler)(void* context, const name##EventArgs* e) #define DEFINE_EVENT_RAISE(name) \ - static INLINE int PubSub_On##name(wPubSub* pubSub, void* context, const name##EventArgs* e) \ + static inline int PubSub_On##name(wPubSub* pubSub, void* context, const name##EventArgs* e) \ { \ WINPR_ASSERT(e); \ return PubSub_OnEvent(pubSub, #name, context, &e->e); \ } #define DEFINE_EVENT_SUBSCRIBE(name) \ - static INLINE int PubSub_Subscribe##name(wPubSub* pubSub, p##name##EventHandler EventHandler) \ + static inline int PubSub_Subscribe##name(wPubSub* pubSub, p##name##EventHandler EventHandler) \ { \ return PubSub_Subscribe(pubSub, #name, EventHandler); \ } #define DEFINE_EVENT_UNSUBSCRIBE(name) \ - static INLINE int PubSub_Unsubscribe##name(wPubSub* pubSub, \ + static inline int PubSub_Unsubscribe##name(wPubSub* pubSub, \ p##name##EventHandler EventHandler) \ { \ return PubSub_Unsubscribe(pubSub, #name, EventHandler); \ diff --git a/winpr/include/winpr/crt.h b/winpr/include/winpr/crt.h index cf7c48cc9..c96f8cea8 100644 --- a/winpr/include/winpr/crt.h +++ b/winpr/include/winpr/crt.h @@ -52,28 +52,28 @@ WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER #endif /* _strtoi64 */ #ifndef _rotl -static INLINE UINT32 _rotl(UINT32 value, int shift) +static inline UINT32 _rotl(UINT32 value, int shift) { return (value << shift) | (value >> (32 - shift)); } #endif /* _rotl */ #ifndef _rotl64 -static INLINE UINT64 _rotl64(UINT64 value, int shift) +static inline UINT64 _rotl64(UINT64 value, int shift) { return (value << shift) | (value >> (64 - shift)); } #endif /* _rotl64 */ #ifndef _rotr -static INLINE UINT32 _rotr(UINT32 value, int shift) +static inline UINT32 _rotr(UINT32 value, int shift) { return (value >> shift) | (value << (32 - shift)); } #endif /* _rotr */ #ifndef _rotr64 -static INLINE UINT64 _rotr64(UINT64 value, int shift) +static inline UINT64 _rotr64(UINT64 value, int shift) { return (value >> shift) | (value << (64 - shift)); } @@ -86,13 +86,13 @@ static INLINE UINT64 _rotr64(UINT64 value, int shift) #else -static INLINE UINT32 _byteswap_ulong(UINT32 _val) +static inline UINT32 _byteswap_ulong(UINT32 _val) { return (((_val) >> 24) | (((_val)&0x00FF0000) >> 8) | (((_val)&0x0000FF00) << 8) | ((_val) << 24)); } -static INLINE UINT64 _byteswap_uint64(UINT64 _val) +static inline UINT64 _byteswap_uint64(UINT64 _val) { return (((_val) << 56) | (((_val) << 40) & 0xFF000000000000) | (((_val) << 24) & 0xFF0000000000) | (((_val) << 8) & 0xFF00000000) | @@ -108,7 +108,7 @@ static INLINE UINT64 _byteswap_uint64(UINT64 _val) #else -static INLINE UINT16 _byteswap_ushort(UINT16 _val) +static inline UINT16 _byteswap_ushort(UINT16 _val) { return WINPR_CXX_COMPAT_CAST(UINT16, ((_val) >> 8U) | ((_val) << 8U)); } diff --git a/winpr/include/winpr/endian.h b/winpr/include/winpr/endian.h index ba0b76513..98ebf9bc1 100644 --- a/winpr/include/winpr/endian.h +++ b/winpr/include/winpr/endian.h @@ -35,27 +35,27 @@ extern "C" { #endif - static INLINE UINT8 winpr_Data_Get_UINT8(const void* d) + static inline UINT8 winpr_Data_Get_UINT8(const void* d) { WINPR_ASSERT(d); const UINT8* ptr = WINPR_ENDIAN_CAST(const UINT8*, d); return *ptr; } - static INLINE INT8 winpr_Data_Get_INT8(const void* d) + static inline INT8 winpr_Data_Get_INT8(const void* d) { WINPR_ASSERT(d); const INT8* ptr = WINPR_ENDIAN_CAST(const INT8*, d); return *ptr; } - static INLINE UINT16 winpr_Data_Get_UINT16_NE(const void* d) + static inline UINT16 winpr_Data_Get_UINT16_NE(const void* d) { const UINT16* ptr = WINPR_ENDIAN_CAST(const UINT16*, d); return *ptr; } - static INLINE UINT16 winpr_Data_Get_UINT16(const void* d) + static inline UINT16 winpr_Data_Get_UINT16(const void* d) { WINPR_ASSERT(d); const UINT8* ptr = WINPR_ENDIAN_CAST(const UINT8*, d); @@ -69,7 +69,7 @@ extern "C" return v; } - static INLINE UINT16 winpr_Data_Get_UINT16_BE(const void* d) + static inline UINT16 winpr_Data_Get_UINT16_BE(const void* d) { WINPR_ASSERT(d); const UINT8* ptr = WINPR_ENDIAN_CAST(const UINT8*, d); @@ -83,33 +83,33 @@ extern "C" return v; } - static INLINE INT16 winpr_Data_Get_INT16_NE(const void* d) + static inline INT16 winpr_Data_Get_INT16_NE(const void* d) { WINPR_ASSERT(d); const INT16* ptr = WINPR_ENDIAN_CAST(const INT16*, d); return *ptr; } - static INLINE INT16 winpr_Data_Get_INT16(const void* d) + static inline INT16 winpr_Data_Get_INT16(const void* d) { const UINT16 u16 = winpr_Data_Get_UINT16(d); return WINPR_ENDIAN_CAST(INT16, u16); } - static INLINE INT16 winpr_Data_Get_INT16_BE(const void* d) + static inline INT16 winpr_Data_Get_INT16_BE(const void* d) { const UINT16 u16 = winpr_Data_Get_UINT16_BE(d); return WINPR_ENDIAN_CAST(INT16, u16); } - static INLINE UINT32 winpr_Data_Get_UINT32_NE(const void* d) + static inline UINT32 winpr_Data_Get_UINT32_NE(const void* d) { WINPR_ASSERT(d); const UINT32* ptr = WINPR_ENDIAN_CAST(const UINT32*, d); return *ptr; } - static INLINE UINT32 winpr_Data_Get_UINT32(const void* d) + static inline UINT32 winpr_Data_Get_UINT32(const void* d) { WINPR_ASSERT(d); const UINT8* ptr = WINPR_ENDIAN_CAST(const UINT8*, d); @@ -123,7 +123,7 @@ extern "C" return v; } - static INLINE UINT32 winpr_Data_Get_UINT32_BE(const void* d) + static inline UINT32 winpr_Data_Get_UINT32_BE(const void* d) { WINPR_ASSERT(d); const UINT8* ptr = WINPR_ENDIAN_CAST(const UINT8*, d); @@ -137,33 +137,33 @@ extern "C" return v; } - static INLINE INT32 winpr_Data_Get_INT32_NE(const void* d) + static inline INT32 winpr_Data_Get_INT32_NE(const void* d) { WINPR_ASSERT(d); const INT32* ptr = WINPR_ENDIAN_CAST(const INT32*, d); return *ptr; } - static INLINE INT32 winpr_Data_Get_INT32(const void* d) + static inline INT32 winpr_Data_Get_INT32(const void* d) { const UINT32 u32 = winpr_Data_Get_UINT32(d); return WINPR_ENDIAN_CAST(INT32, u32); } - static INLINE INT32 winpr_Data_Get_INT32_BE(const void* d) + static inline INT32 winpr_Data_Get_INT32_BE(const void* d) { const UINT32 u32 = winpr_Data_Get_UINT32_BE(d); return WINPR_ENDIAN_CAST(INT32, u32); } - static INLINE UINT64 winpr_Data_Get_UINT64_NE(const void* d) + static inline UINT64 winpr_Data_Get_UINT64_NE(const void* d) { WINPR_ASSERT(d); const UINT64* ptr = WINPR_ENDIAN_CAST(const UINT64*, d); return *ptr; } - static INLINE UINT64 winpr_Data_Get_UINT64(const void* d) + static inline UINT64 winpr_Data_Get_UINT64(const void* d) { WINPR_ASSERT(d); const UINT8* ptr = WINPR_ENDIAN_CAST(const UINT8*, d); @@ -177,7 +177,7 @@ extern "C" return v; } - static INLINE UINT64 winpr_Data_Get_UINT64_BE(const void* d) + static inline UINT64 winpr_Data_Get_UINT64_BE(const void* d) { WINPR_ASSERT(d); const UINT8* ptr = WINPR_ENDIAN_CAST(const UINT8*, d); @@ -191,47 +191,47 @@ extern "C" return v; } - static INLINE INT64 winpr_Data_Get_INT64_NE(const void* d) + static inline INT64 winpr_Data_Get_INT64_NE(const void* d) { WINPR_ASSERT(d); const INT64* b = WINPR_ENDIAN_CAST(const INT64*, d); return *b; } - static INLINE INT64 winpr_Data_Get_INT64(const void* d) + static inline INT64 winpr_Data_Get_INT64(const void* d) { const UINT64 u64 = winpr_Data_Get_UINT64(d); return WINPR_ENDIAN_CAST(INT64, u64); } - static INLINE INT64 winpr_Data_Get_INT64_BE(const void* d) + static inline INT64 winpr_Data_Get_INT64_BE(const void* d) { const UINT64 u64 = winpr_Data_Get_UINT64_BE(d); return WINPR_ENDIAN_CAST(INT64, u64); } - static INLINE void winpr_Data_Write_UINT8_NE(void* d, UINT8 v) + static inline void winpr_Data_Write_UINT8_NE(void* d, UINT8 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); *b = v; } - static INLINE void winpr_Data_Write_UINT8(void* d, UINT8 v) + static inline void winpr_Data_Write_UINT8(void* d, UINT8 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); *b = v; } - static INLINE void winpr_Data_Write_UINT16_NE(void* d, UINT16 v) + static inline void winpr_Data_Write_UINT16_NE(void* d, UINT16 v) { WINPR_ASSERT(d); UINT16* b = WINPR_ENDIAN_CAST(UINT16*, d); *b = v; } - static INLINE void winpr_Data_Write_UINT16(void* d, UINT16 v) + static inline void winpr_Data_Write_UINT16(void* d, UINT16 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -239,7 +239,7 @@ extern "C" b[1] = (v >> 8) & 0xFF; } - static INLINE void winpr_Data_Write_UINT16_BE(void* d, UINT16 v) + static inline void winpr_Data_Write_UINT16_BE(void* d, UINT16 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -247,14 +247,14 @@ extern "C" b[0] = (v >> 8) & 0xFF; } - static INLINE void winpr_Data_Write_UINT32_NE(void* d, UINT32 v) + static inline void winpr_Data_Write_UINT32_NE(void* d, UINT32 v) { WINPR_ASSERT(d); UINT32* b = WINPR_ENDIAN_CAST(UINT32*, d); *b = v; } - static INLINE void winpr_Data_Write_UINT32(void* d, UINT32 v) + static inline void winpr_Data_Write_UINT32(void* d, UINT32 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -262,7 +262,7 @@ extern "C" winpr_Data_Write_UINT16(b + 2, (v >> 16) & 0xFFFF); } - static INLINE void winpr_Data_Write_UINT32_BE(void* d, UINT32 v) + static inline void winpr_Data_Write_UINT32_BE(void* d, UINT32 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -270,14 +270,14 @@ extern "C" winpr_Data_Write_UINT16_BE(b + 2, v & 0xFFFF); } - static INLINE void winpr_Data_Write_UINT64_NE(void* d, UINT64 v) + static inline void winpr_Data_Write_UINT64_NE(void* d, UINT64 v) { WINPR_ASSERT(d); UINT64* b = WINPR_ENDIAN_CAST(UINT64*, d); *b = v; } - static INLINE void winpr_Data_Write_UINT64(void* d, UINT64 v) + static inline void winpr_Data_Write_UINT64(void* d, UINT64 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -285,7 +285,7 @@ extern "C" winpr_Data_Write_UINT32(b + 4, (v >> 32) & 0xFFFFFFFF); } - static INLINE void winpr_Data_Write_UINT64_BE(void* d, UINT64 v) + static inline void winpr_Data_Write_UINT64_BE(void* d, UINT64 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -293,28 +293,28 @@ extern "C" winpr_Data_Write_UINT32_BE(b + 4, v & 0xFFFFFFFF); } - static INLINE void winpr_Data_Write_INT8_NE(void* d, INT8 v) + static inline void winpr_Data_Write_INT8_NE(void* d, INT8 v) { WINPR_ASSERT(d); INT8* b = WINPR_ENDIAN_CAST(INT8*, d); *b = v; } - static INLINE void winpr_Data_Write_INT8(void* d, INT8 v) + static inline void winpr_Data_Write_INT8(void* d, INT8 v) { WINPR_ASSERT(d); INT8* b = WINPR_ENDIAN_CAST(INT8*, d); *b = v; } - static INLINE void winpr_Data_Write_INT16_NE(void* d, INT16 v) + static inline void winpr_Data_Write_INT16_NE(void* d, INT16 v) { WINPR_ASSERT(d); INT16* b = WINPR_ENDIAN_CAST(INT16*, d); *b = v; } - static INLINE void winpr_Data_Write_INT16(void* d, INT16 v) + static inline void winpr_Data_Write_INT16(void* d, INT16 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -322,7 +322,7 @@ extern "C" b[1] = (v >> 8) & 0xFF; } - static INLINE void winpr_Data_Write_INT16_BE(void* d, INT16 v) + static inline void winpr_Data_Write_INT16_BE(void* d, INT16 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -330,14 +330,14 @@ extern "C" b[0] = (v >> 8) & 0xFF; } - static INLINE void winpr_Data_Write_INT32_NE(void* d, INT32 v) + static inline void winpr_Data_Write_INT32_NE(void* d, INT32 v) { WINPR_ASSERT(d); INT32* pu = WINPR_ENDIAN_CAST(INT32*, d); *pu = v; } - static INLINE void winpr_Data_Write_INT32(void* d, INT32 v) + static inline void winpr_Data_Write_INT32(void* d, INT32 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -345,7 +345,7 @@ extern "C" winpr_Data_Write_UINT16(b + 2, (v >> 16) & 0xFFFF); } - static INLINE void winpr_Data_Write_INT32_BE(void* d, INT32 v) + static inline void winpr_Data_Write_INT32_BE(void* d, INT32 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -353,14 +353,14 @@ extern "C" winpr_Data_Write_UINT16_BE(b + 2, v & 0xFFFF); } - static INLINE void winpr_Data_Write_INT64_NE(void* d, INT64 v) + static inline void winpr_Data_Write_INT64_NE(void* d, INT64 v) { WINPR_ASSERT(d); INT64* pu = WINPR_ENDIAN_CAST(INT64*, d); *pu = v; } - static INLINE void winpr_Data_Write_INT64(void* d, INT64 v) + static inline void winpr_Data_Write_INT64(void* d, INT64 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); @@ -368,7 +368,7 @@ extern "C" winpr_Data_Write_UINT32(b + 4, (v >> 32) & 0xFFFFFFFF); } - static INLINE void winpr_Data_Write_INT64_BE(void* d, INT64 v) + static inline void winpr_Data_Write_INT64_BE(void* d, INT64 v) { WINPR_ASSERT(d); BYTE* b = WINPR_ENDIAN_CAST(BYTE*, d); diff --git a/winpr/include/winpr/error.h b/winpr/include/winpr/error.h index ad50f5a7f..f7d598279 100644 --- a/winpr/include/winpr/error.h +++ b/winpr/include/winpr/error.h @@ -148,7 +148,7 @@ WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO #define ERROR_CAST(t, val) WINPR_CXX_COMPAT_CAST(t, val) -static INLINE HRESULT HRESULT_FROM_WIN32(unsigned long x) +static inline HRESULT HRESULT_FROM_WIN32(unsigned long x) { HRESULT hx = ERROR_CAST(HRESULT, x); if (hx <= 0) diff --git a/winpr/include/winpr/intrin.h b/winpr/include/winpr/intrin.h index 0e61d4dfd..b121ccd73 100644 --- a/winpr/include/winpr/intrin.h +++ b/winpr/include/winpr/intrin.h @@ -33,13 +33,13 @@ #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) -static INLINE UINT32 __lzcnt(UINT32 _val32) +static inline UINT32 __lzcnt(UINT32 _val32) { return ((UINT32)__builtin_clz(_val32)); } #if !(defined(__MINGW32__) && defined(__clang__)) -static INLINE UINT16 __lzcnt16(UINT16 _val16) +static inline UINT16 __lzcnt16(UINT16 _val16) { return ((UINT16)(__builtin_clz((UINT32)_val16) - 16)); } @@ -47,7 +47,7 @@ static INLINE UINT16 __lzcnt16(UINT16 _val16) #else /* (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2) */ -static INLINE UINT32 __lzcnt(UINT32 x) +static inline UINT32 __lzcnt(UINT32 x) { unsigned y; int n = 32; @@ -81,7 +81,7 @@ static INLINE UINT32 __lzcnt(UINT32 x) return n - x; } -static INLINE UINT16 __lzcnt16(UINT16 x) +static inline UINT16 __lzcnt16(UINT16 x) { return ((UINT16)__lzcnt((UINT32)x)); } diff --git a/winpr/include/winpr/nt.h b/winpr/include/winpr/nt.h index 61e1a21de..b6327b18a 100644 --- a/winpr/include/winpr/nt.h +++ b/winpr/include/winpr/nt.h @@ -1262,8 +1262,8 @@ /* Defined in winternl.h, always define since we do not include this header */ /* defined in ntstatus.h */ -#if !defined(NTSTATUS_FROM_WIN32) && !defined(INLINE_NTSTATUS_FROM_WIN32) -static INLINE NTSTATUS NTSTATUS_FROM_WIN32(long x) +#if !defined(NTSTATUS_FROM_WIN32) && !defined(inline_NTSTATUS_FROM_WIN32) +static inline NTSTATUS NTSTATUS_FROM_WIN32(long x) { return x <= 0 ? STATUS_CAST(NTSTATUS, x) : STATUS_CAST(NTSTATUS, ((x)&0x0000FFFF) | (0x7 << 16) | 0xC0000000); diff --git a/winpr/include/winpr/platform.h b/winpr/include/winpr/platform.h index 7c27e5e93..e740b5351 100644 --- a/winpr/include/winpr/platform.h +++ b/winpr/include/winpr/platform.h @@ -532,11 +532,7 @@ WINPR_PRAGMA_DIAG_POP #define WINPR_NORETURN(obj) obj #endif -#ifdef _WIN32 -#define INLINE __inline -#else #define INLINE inline -#endif #ifdef WINPR_DLL #if defined _WIN32 || defined __CYGWIN__ diff --git a/winpr/include/winpr/pool.h b/winpr/include/winpr/pool.h index ba38d0a96..41531be75 100644 --- a/winpr/include/winpr/pool.h +++ b/winpr/include/winpr/pool.h @@ -247,29 +247,29 @@ extern "C" /* Callback Environment */ - static INLINE VOID InitializeThreadpoolEnvironment(PTP_CALLBACK_ENVIRON pcbe) + static inline VOID InitializeThreadpoolEnvironment(PTP_CALLBACK_ENVIRON pcbe) { const TP_CALLBACK_ENVIRON empty = { 0 }; *pcbe = empty; pcbe->Version = 1; } - static INLINE VOID DestroyThreadpoolEnvironment(WINPR_ATTR_UNUSED PTP_CALLBACK_ENVIRON pcbe) + static inline VOID DestroyThreadpoolEnvironment(WINPR_ATTR_UNUSED PTP_CALLBACK_ENVIRON pcbe) { /* no actions, this may change in a future release. */ } - static INLINE VOID SetThreadpoolCallbackPool(PTP_CALLBACK_ENVIRON pcbe, PTP_POOL ptpp) + static inline VOID SetThreadpoolCallbackPool(PTP_CALLBACK_ENVIRON pcbe, PTP_POOL ptpp) { pcbe->Pool = ptpp; } - static INLINE VOID SetThreadpoolCallbackRunsLong(PTP_CALLBACK_ENVIRON pcbe) + static inline VOID SetThreadpoolCallbackRunsLong(PTP_CALLBACK_ENVIRON pcbe) { pcbe->u.s.LongFunction = 1; } - static INLINE VOID SetThreadpoolCallbackLibrary(PTP_CALLBACK_ENVIRON pcbe, PVOID mod) + static inline VOID SetThreadpoolCallbackLibrary(PTP_CALLBACK_ENVIRON pcbe, PVOID mod) { pcbe->RaceDll = mod; } diff --git a/winpr/include/winpr/stream.h b/winpr/include/winpr/stream.h index 8ef97b2ee..abfd45dca 100644 --- a/winpr/include/winpr/stream.h +++ b/winpr/include/winpr/stream.h @@ -51,7 +51,7 @@ extern "C" BOOL isOwner; } wStream; - static INLINE size_t Stream_Capacity(const wStream* _s); + static inline size_t Stream_Capacity(const wStream* _s); WINPR_API size_t Stream_GetRemainingCapacity(const wStream* _s); WINPR_API size_t Stream_GetRemainingLength(const wStream* _s); @@ -120,14 +120,14 @@ extern "C" size_t nmemb, size_t size, const char* fmt, va_list args); - static INLINE void Stream_Seek(wStream* s, size_t _offset) + static inline void Stream_Seek(wStream* s, size_t _offset) { WINPR_ASSERT(s); WINPR_ASSERT(Stream_GetRemainingCapacity(s) >= _offset); s->pointer += (_offset); } - static INLINE void Stream_Rewind(wStream* s, size_t _offset) + static inline void Stream_Rewind(wStream* s, size_t _offset) { size_t cur = 0; WINPR_ASSERT(s); @@ -140,7 +140,7 @@ extern "C" s->pointer = s->buffer; } - static INLINE UINT8 stream_read_u8(wStream* _s, BOOL seek) + static inline UINT8 stream_read_u8(wStream* _s, BOOL seek) { WINPR_ASSERT(_s); WINPR_ASSERT(Stream_GetRemainingLength(_s) >= sizeof(UINT8)); @@ -151,7 +151,7 @@ extern "C" return v; } - static INLINE INT8 stream_read_i8(wStream* _s, BOOL seek) + static inline INT8 stream_read_i8(wStream* _s, BOOL seek) { const INT8 v = winpr_Data_Get_INT8(_s->pointer); if (seek) @@ -159,7 +159,7 @@ extern "C" return v; } - static INLINE UINT16 stream_read_u16_le(wStream* _s, BOOL seek) + static inline UINT16 stream_read_u16_le(wStream* _s, BOOL seek) { const size_t typesize = sizeof(UINT16); WINPR_ASSERT(_s); @@ -171,7 +171,7 @@ extern "C" return v; } - static INLINE UINT16 stream_read_u16_be(wStream* _s, BOOL seek) + static inline UINT16 stream_read_u16_be(wStream* _s, BOOL seek) { const size_t typesize = sizeof(UINT16); WINPR_ASSERT(_s); @@ -183,7 +183,7 @@ extern "C" return v; } - static INLINE INT16 stream_read_i16_le(wStream* _s, BOOL seek) + static inline INT16 stream_read_i16_le(wStream* _s, BOOL seek) { const size_t typesize = sizeof(INT16); WINPR_ASSERT(_s); @@ -195,7 +195,7 @@ extern "C" return v; } - static INLINE INT16 stream_read_i16_be(wStream* _s, BOOL seek) + static inline INT16 stream_read_i16_be(wStream* _s, BOOL seek) { const size_t typesize = sizeof(INT16); WINPR_ASSERT(_s); @@ -207,7 +207,7 @@ extern "C" return v; } - static INLINE UINT32 stream_read_u32_le(wStream* _s, BOOL seek) + static inline UINT32 stream_read_u32_le(wStream* _s, BOOL seek) { const size_t typesize = sizeof(UINT32); WINPR_ASSERT(_s); @@ -219,7 +219,7 @@ extern "C" return v; } - static INLINE UINT32 stream_read_u32_be(wStream* _s, BOOL seek) + static inline UINT32 stream_read_u32_be(wStream* _s, BOOL seek) { const size_t typesize = sizeof(UINT32); WINPR_ASSERT(_s); @@ -231,7 +231,7 @@ extern "C" return v; } - static INLINE INT32 stream_read_i32_le(wStream* _s, BOOL seek) + static inline INT32 stream_read_i32_le(wStream* _s, BOOL seek) { const size_t typesize = sizeof(INT32); WINPR_ASSERT(_s); @@ -243,7 +243,7 @@ extern "C" return v; } - static INLINE INT32 stream_read_i32_be(wStream* _s, BOOL seek) + static inline INT32 stream_read_i32_be(wStream* _s, BOOL seek) { const size_t typesize = sizeof(INT32); WINPR_ASSERT(_s); @@ -255,7 +255,7 @@ extern "C" return v; } - static INLINE UINT64 stream_read_u64_le(wStream* _s, BOOL seek) + static inline UINT64 stream_read_u64_le(wStream* _s, BOOL seek) { const size_t typesize = sizeof(UINT64); WINPR_ASSERT(_s); @@ -267,7 +267,7 @@ extern "C" return v; } - static INLINE UINT64 stream_read_u64_be(wStream* _s, BOOL seek) + static inline UINT64 stream_read_u64_be(wStream* _s, BOOL seek) { const size_t typesize = sizeof(UINT64); WINPR_ASSERT(_s); @@ -279,7 +279,7 @@ extern "C" return v; } - static INLINE INT64 stream_read_i64_le(wStream* _s, BOOL seek) + static inline INT64 stream_read_i64_le(wStream* _s, BOOL seek) { const size_t typesize = sizeof(INT64); WINPR_ASSERT(_s); @@ -291,7 +291,7 @@ extern "C" return v; } - static INLINE INT64 stream_read_i64_be(wStream* _s, BOOL seek) + static inline INT64 stream_read_i64_be(wStream* _s, BOOL seek) { const size_t typesize = sizeof(INT64); WINPR_ASSERT(_s); @@ -309,7 +309,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT8 Stream_Get_UINT8(wStream* _s) + static inline UINT8 Stream_Get_UINT8(wStream* _s) { return stream_read_u8(_s, TRUE); } @@ -320,7 +320,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT8 Stream_Get_INT8(wStream* _s) + static inline INT8 Stream_Get_INT8(wStream* _s) { return stream_read_i8(_s, TRUE); } @@ -331,7 +331,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT16 Stream_Get_UINT16(wStream* _s) + static inline UINT16 Stream_Get_UINT16(wStream* _s) { return stream_read_u16_le(_s, TRUE); } @@ -342,7 +342,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT16 Stream_Get_INT16(wStream* _s) + static inline INT16 Stream_Get_INT16(wStream* _s) { return stream_read_i16_le(_s, TRUE); } @@ -353,7 +353,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT16 Stream_Get_UINT16_BE(wStream* _s) + static inline UINT16 Stream_Get_UINT16_BE(wStream* _s) { return stream_read_u16_be(_s, TRUE); } @@ -364,7 +364,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT16 Stream_Get_INT16_BE(wStream* _s) + static inline INT16 Stream_Get_INT16_BE(wStream* _s) { return stream_read_i16_be(_s, TRUE); } @@ -375,7 +375,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT32 Stream_Get_UINT32(wStream* _s) + static inline UINT32 Stream_Get_UINT32(wStream* _s) { return stream_read_u32_le(_s, TRUE); } @@ -386,7 +386,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT32 Stream_Get_INT32(wStream* _s) + static inline INT32 Stream_Get_INT32(wStream* _s) { return stream_read_i32_le(_s, TRUE); } @@ -397,7 +397,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT32 Stream_Get_UINT32_BE(wStream* _s) + static inline UINT32 Stream_Get_UINT32_BE(wStream* _s) { return stream_read_u32_be(_s, TRUE); } @@ -408,7 +408,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT32 Stream_Get_INT32_BE(wStream* _s) + static inline INT32 Stream_Get_INT32_BE(wStream* _s) { return stream_read_i32_be(_s, TRUE); } @@ -419,7 +419,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT64 Stream_Get_UINT64(wStream* _s) + static inline UINT64 Stream_Get_UINT64(wStream* _s) { return stream_read_u64_le(_s, TRUE); } @@ -430,7 +430,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT64 Stream_Get_INT64(wStream* _s) + static inline INT64 Stream_Get_INT64(wStream* _s) { return stream_read_i64_le(_s, TRUE); } @@ -441,7 +441,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT64 Stream_Get_UINT64_BE(wStream* _s) + static inline UINT64 Stream_Get_UINT64_BE(wStream* _s) { return stream_read_u64_be(_s, TRUE); } @@ -452,7 +452,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT64 Stream_Get_INT64_BE(wStream* _s) + static inline INT64 Stream_Get_INT64_BE(wStream* _s) { return stream_read_i64_be(_s, TRUE); } @@ -463,7 +463,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT8 Stream_Peek_Get_UINT8(wStream* _s) + static inline UINT8 Stream_Peek_Get_UINT8(wStream* _s) { return stream_read_u8(_s, FALSE); } @@ -474,7 +474,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT8 Stream_Peek_Get_INT8(wStream* _s) + static inline INT8 Stream_Peek_Get_INT8(wStream* _s) { return stream_read_i8(_s, FALSE); } @@ -485,7 +485,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT16 Stream_Peek_Get_UINT16(wStream* _s) + static inline UINT16 Stream_Peek_Get_UINT16(wStream* _s) { return stream_read_u16_le(_s, FALSE); } @@ -496,7 +496,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT16 Stream_Peek_Get_INT16(wStream* _s) + static inline INT16 Stream_Peek_Get_INT16(wStream* _s) { return stream_read_i16_le(_s, FALSE); } @@ -507,7 +507,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT16 Stream_Peek_Get_UINT16_BE(wStream* _s) + static inline UINT16 Stream_Peek_Get_UINT16_BE(wStream* _s) { return stream_read_u16_be(_s, FALSE); } @@ -518,7 +518,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT16 Stream_Peek_Get_INT16_BE(wStream* _s) + static inline INT16 Stream_Peek_Get_INT16_BE(wStream* _s) { return stream_read_i16_be(_s, FALSE); } @@ -529,7 +529,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT32 Stream_Peek_Get_UINT32(wStream* _s) + static inline UINT32 Stream_Peek_Get_UINT32(wStream* _s) { return stream_read_u32_le(_s, FALSE); } @@ -540,7 +540,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT32 Stream_Peek_Get_INT32(wStream* _s) + static inline INT32 Stream_Peek_Get_INT32(wStream* _s) { return stream_read_i32_le(_s, FALSE); } @@ -551,7 +551,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT32 Stream_Peek_Get_UINT32_BE(wStream* _s) + static inline UINT32 Stream_Peek_Get_UINT32_BE(wStream* _s) { return stream_read_u32_be(_s, FALSE); } @@ -562,7 +562,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT32 Stream_Peek_Get_INT32_BE(wStream* _s) + static inline INT32 Stream_Peek_Get_INT32_BE(wStream* _s) { return stream_read_i32_be(_s, FALSE); } @@ -573,7 +573,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT64 Stream_Peek_Get_UINT64(wStream* _s) + static inline UINT64 Stream_Peek_Get_UINT64(wStream* _s) { return stream_read_u64_le(_s, FALSE); } @@ -584,7 +584,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT64 Stream_Peek_Get_INT64(wStream* _s) + static inline INT64 Stream_Peek_Get_INT64(wStream* _s) { return stream_read_i64_le(_s, FALSE); } @@ -595,7 +595,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE UINT64 Stream_Peek_Get_UINT64_BE(wStream* _s) + static inline UINT64 Stream_Peek_Get_UINT64_BE(wStream* _s) { return stream_read_u64_be(_s, FALSE); } @@ -606,7 +606,7 @@ extern "C" * @return an integer * @since version 3.9.0 */ - static INLINE INT64 Stream_Peek_Get_INT64_BE(wStream* _s) + static inline INT64 Stream_Peek_Get_INT64_BE(wStream* _s) { return stream_read_i64_be(_s, FALSE); } @@ -695,7 +695,7 @@ extern "C" _v = stream_read_i64_be(_s, TRUE); \ } while (0) - static INLINE void Stream_Read(wStream* _s, void* _b, size_t _n) + static inline void Stream_Read(wStream* _s, void* _b, size_t _n) { WINPR_ASSERT(_s); WINPR_ASSERT(_b || (_n == 0)); @@ -788,7 +788,7 @@ extern "C" _v = stream_read_i64_be(_s, FALSE); \ } while (0) - static INLINE void Stream_Peek(const wStream* _s, void* _b, size_t _n) + static inline void Stream_Peek(const wStream* _s, void* _b, size_t _n) { WINPR_ASSERT(_s); WINPR_ASSERT(_b || (_n == 0)); @@ -811,7 +811,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_INT8_unchecked(wStream* _s, INT8 _v) + static inline void Stream_Write_INT8_unchecked(wStream* _s, INT8 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -836,7 +836,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_UINT8_unchecked(wStream* _s, UINT8 _v) + static inline void Stream_Write_UINT8_unchecked(wStream* _s, UINT8 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -862,7 +862,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_INT16_unchecked(wStream* _s, INT16 _v) + static inline void Stream_Write_INT16_unchecked(wStream* _s, INT16 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -888,7 +888,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_UINT16_unchecked(wStream* _s, UINT16 _v) + static inline void Stream_Write_UINT16_unchecked(wStream* _s, UINT16 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -914,7 +914,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_UINT16_BE_unchecked(wStream* _s, UINT16 _v) + static inline void Stream_Write_UINT16_BE_unchecked(wStream* _s, UINT16 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -942,7 +942,7 @@ extern "C" * * @since version 3.10.0 */ - static INLINE void Stream_Write_INT16_BE_unchecked(wStream* _s, INT16 _v) + static inline void Stream_Write_INT16_BE_unchecked(wStream* _s, INT16 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -968,7 +968,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_UINT24_BE_unchecked(wStream* _s, UINT32 _v) + static inline void Stream_Write_UINT24_BE_unchecked(wStream* _s, UINT32 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -996,7 +996,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_INT32_unchecked(wStream* _s, INT32 _v) + static inline void Stream_Write_INT32_unchecked(wStream* _s, INT32 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -1024,7 +1024,7 @@ extern "C" * * @since version 3.10.0 */ - static INLINE void Stream_Write_INT32_BE_unchecked(wStream* _s, INT32 _v) + static inline void Stream_Write_INT32_BE_unchecked(wStream* _s, INT32 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -1050,7 +1050,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_UINT32_unchecked(wStream* _s, UINT32 _v) + static inline void Stream_Write_UINT32_unchecked(wStream* _s, UINT32 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -1076,7 +1076,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_UINT32_BE_unchecked(wStream* _s, UINT32 _v) + static inline void Stream_Write_UINT32_BE_unchecked(wStream* _s, UINT32 _v) { WINPR_ASSERT(Stream_GetRemainingCapacity(_s) >= 4); @@ -1090,7 +1090,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_UINT64(wStream* _s, UINT64 _v) + static inline void Stream_Write_UINT64(wStream* _s, UINT64 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -1106,7 +1106,7 @@ extern "C" * \param _s The stream to write to, must not be \b NULL * \param _v The value to write */ - static INLINE void Stream_Write_UINT64_BE(wStream* _s, UINT64 _v) + static inline void Stream_Write_UINT64_BE(wStream* _s, UINT64 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -1123,7 +1123,7 @@ extern "C" * \param _v The value to write * \since version 3.10.0 */ - static INLINE void Stream_Write_INT64(wStream* _s, INT64 _v) + static inline void Stream_Write_INT64(wStream* _s, INT64 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -1140,7 +1140,7 @@ extern "C" * \param _v The value to write * \since version 3.10.0 */ - static INLINE void Stream_Write_INT64_BE(wStream* _s, INT64 _v) + static inline void Stream_Write_INT64_BE(wStream* _s, INT64 _v) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->pointer); @@ -1150,7 +1150,7 @@ extern "C" _s->pointer += 8; } - static INLINE void Stream_Write(wStream* _s, const void* _b, size_t _n) + static inline void Stream_Write(wStream* _s, const void* _b, size_t _n) { if (_n > 0) { @@ -1162,41 +1162,41 @@ extern "C" } } - static INLINE void Stream_Seek_UINT8(wStream* _s) + static inline void Stream_Seek_UINT8(wStream* _s) { Stream_Seek(_s, sizeof(UINT8)); } - static INLINE void Stream_Seek_UINT16(wStream* _s) + static inline void Stream_Seek_UINT16(wStream* _s) { Stream_Seek(_s, sizeof(UINT16)); } - static INLINE void Stream_Seek_UINT32(wStream* _s) + static inline void Stream_Seek_UINT32(wStream* _s) { Stream_Seek(_s, sizeof(UINT32)); } - static INLINE void Stream_Seek_UINT64(wStream* _s) + static inline void Stream_Seek_UINT64(wStream* _s) { Stream_Seek(_s, sizeof(UINT64)); } - static INLINE void Stream_Rewind_UINT8(wStream* _s) + static inline void Stream_Rewind_UINT8(wStream* _s) { Stream_Rewind(_s, sizeof(UINT8)); } - static INLINE void Stream_Rewind_UINT16(wStream* _s) + static inline void Stream_Rewind_UINT16(wStream* _s) { Stream_Rewind(_s, sizeof(UINT16)); } - static INLINE void Stream_Rewind_UINT32(wStream* _s) + static inline void Stream_Rewind_UINT32(wStream* _s) { Stream_Rewind(_s, sizeof(UINT32)); } - static INLINE void Stream_Rewind_UINT64(wStream* _s) + static inline void Stream_Rewind_UINT64(wStream* _s) { Stream_Rewind(_s, sizeof(UINT64)); } - static INLINE void Stream_Fill(wStream* _s, int _v, size_t _n) + static inline void Stream_Fill(wStream* _s, int _v, size_t _n) { WINPR_ASSERT(_s); WINPR_ASSERT(Stream_GetRemainingCapacity(_s) >= (_n)); @@ -1204,12 +1204,12 @@ extern "C" Stream_Seek(_s, _n); } - static INLINE void Stream_Zero(wStream* _s, size_t _n) + static inline void Stream_Zero(wStream* _s, size_t _n) { Stream_Fill(_s, '\0', _n); } - static INLINE void Stream_Copy(wStream* _src, wStream* _dst, size_t _n) + static inline void Stream_Copy(wStream* _src, wStream* _dst, size_t _n) { WINPR_ASSERT(_src); WINPR_ASSERT(_dst); @@ -1227,7 +1227,7 @@ extern "C" */ #define Stream_BufferAs(s, type) WINPR_STREAM_CAST(type*, Stream_Buffer(s)) - static INLINE BYTE* Stream_Buffer(wStream* _s) + static inline BYTE* Stream_Buffer(wStream* _s) { WINPR_ASSERT(_s); return _s->buffer; @@ -1238,7 +1238,7 @@ extern "C" * @since version 3.9.0 */ #define Stream_ConstBufferAs(s, type) WINPR_STREAM_CAST(type*, Stream_ConstBuffer(s)) - static INLINE const BYTE* Stream_ConstBuffer(const wStream* _s) + static inline const BYTE* Stream_ConstBuffer(const wStream* _s) { WINPR_ASSERT(_s); return _s->buffer; @@ -1254,13 +1254,13 @@ extern "C" #define Stream_PointerAs(s, type) WINPR_STREAM_CAST(type*, Stream_Pointer(s)) - static INLINE void* Stream_Pointer(wStream* _s) + static inline void* Stream_Pointer(wStream* _s) { WINPR_ASSERT(_s); return _s->pointer; } - static INLINE const void* Stream_ConstPointer(const wStream* _s) + static inline const void* Stream_ConstPointer(const wStream* _s) { WINPR_ASSERT(_s); return _s->pointer; @@ -1283,7 +1283,7 @@ extern "C" WINPR_API void Stream_SetCapacity(wStream* _s, size_t capacity)); #endif - static INLINE size_t Stream_Length(const wStream* _s) + static inline size_t Stream_Length(const wStream* _s) { WINPR_ASSERT(_s); return _s->length; @@ -1292,7 +1292,7 @@ extern "C" #define Stream_GetLength(_s, _l) _l = Stream_Length(_s) WINPR_API BOOL Stream_SetLength(wStream* _s, size_t _l); - static INLINE size_t Stream_Capacity(const wStream* _s) + static inline size_t Stream_Capacity(const wStream* _s) { WINPR_ASSERT(_s); return _s->capacity; @@ -1300,7 +1300,7 @@ extern "C" #define Stream_GetCapacity(_s, _c) _c = Stream_Capacity(_s); - static INLINE size_t Stream_GetPosition(const wStream* _s) + static inline size_t Stream_GetPosition(const wStream* _s) { WINPR_ASSERT(_s); WINPR_ASSERT(_s->buffer <= _s->pointer); @@ -1311,7 +1311,7 @@ extern "C" WINPR_API void Stream_SealLength(wStream* _s); - static INLINE void Stream_Clear(wStream* _s) + static inline void Stream_Clear(wStream* _s) { WINPR_ASSERT(_s); memset(_s->buffer, 0, _s->capacity); diff --git a/winpr/libwinpr/crt/alignment.c b/winpr/libwinpr/crt/alignment.c index 24db9bc0a..bc3fa6e51 100644 --- a/winpr/libwinpr/crt/alignment.c +++ b/winpr/libwinpr/crt/alignment.c @@ -163,7 +163,7 @@ void* winpr_aligned_offset_realloc(void* memblock, size_t size, size_t alignment return newMemblock; } -static INLINE size_t cMIN(size_t a, size_t b) +static inline size_t cMIN(size_t a, size_t b) { if (a > b) return b; diff --git a/winpr/libwinpr/handle/handle.h b/winpr/libwinpr/handle/handle.h index 5abe218dc..774385dbd 100644 --- a/winpr/libwinpr/handle/handle.h +++ b/winpr/libwinpr/handle/handle.h @@ -113,7 +113,7 @@ typedef struct HANDLE_OPS* ops; } WINPR_HANDLE; -static INLINE BOOL WINPR_HANDLE_IS_HANDLED(HANDLE handle, ULONG type, BOOL invalidValue) +static inline BOOL WINPR_HANDLE_IS_HANDLED(HANDLE handle, ULONG type, BOOL invalidValue) { WINPR_HANDLE* pWinprHandle = (WINPR_HANDLE*)handle; BOOL invalid = !pWinprHandle; @@ -133,7 +133,7 @@ static INLINE BOOL WINPR_HANDLE_IS_HANDLED(HANDLE handle, ULONG type, BOOL inval return TRUE; } -static INLINE void WINPR_HANDLE_SET_TYPE_AND_MODE(void* _handle, ULONG _type, ULONG _mode) +static inline void WINPR_HANDLE_SET_TYPE_AND_MODE(void* _handle, ULONG _type, ULONG _mode) { WINPR_HANDLE* hdl = (WINPR_HANDLE*)_handle; @@ -141,7 +141,7 @@ static INLINE void WINPR_HANDLE_SET_TYPE_AND_MODE(void* _handle, ULONG _type, UL hdl->Mode = _mode; } -static INLINE BOOL winpr_Handle_GetInfo(HANDLE handle, ULONG* pType, WINPR_HANDLE** pObject) +static inline BOOL winpr_Handle_GetInfo(HANDLE handle, ULONG* pType, WINPR_HANDLE** pObject) { WINPR_HANDLE* wHandle = NULL; @@ -163,7 +163,7 @@ static INLINE BOOL winpr_Handle_GetInfo(HANDLE handle, ULONG* pType, WINPR_HANDL return TRUE; } -static INLINE int winpr_Handle_getFd(HANDLE handle) +static inline int winpr_Handle_getFd(HANDLE handle) { WINPR_HANDLE* hdl = NULL; ULONG type = 0; @@ -177,7 +177,7 @@ static INLINE int winpr_Handle_getFd(HANDLE handle) return hdl->ops->GetFd(handle); } -static INLINE DWORD winpr_Handle_cleanup(HANDLE handle) +static inline DWORD winpr_Handle_cleanup(HANDLE handle) { WINPR_HANDLE* hdl = NULL; ULONG type = 0; diff --git a/winpr/libwinpr/sspi/Kerberos/kerberos.c b/winpr/libwinpr/sspi/Kerberos/kerberos.c index 2d6f9ffd2..c96635ccf 100644 --- a/winpr/libwinpr/sspi/Kerberos/kerberos.c +++ b/winpr/libwinpr/sspi/Kerberos/kerberos.c @@ -218,7 +218,7 @@ static krb5_error_code krb5_prompter(krb5_context context, void* data, return 0; } -static INLINE krb5glue_key get_key(struct krb5glue_keyset* keyset) +static inline krb5glue_key get_key(struct krb5glue_keyset* keyset) { return keyset->acceptor_key ? keyset->acceptor_key : keyset->initiator_key ? keyset->initiator_key diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c index 8dd801c22..4aaad001a 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_av_pairs.c @@ -87,13 +87,13 @@ static const char* get_av_pair_string(UINT16 pair) static BOOL ntlm_av_pair_check(const NTLM_AV_PAIR* pAvPair, size_t cbAvPair); static NTLM_AV_PAIR* ntlm_av_pair_next(NTLM_AV_PAIR* pAvPairList, size_t* pcbAvPairList); -static INLINE void ntlm_av_pair_set_id(NTLM_AV_PAIR* pAvPair, UINT16 id) +static inline void ntlm_av_pair_set_id(NTLM_AV_PAIR* pAvPair, UINT16 id) { WINPR_ASSERT(pAvPair); winpr_Data_Write_UINT16(&pAvPair->AvId, id); } -static INLINE void ntlm_av_pair_set_len(NTLM_AV_PAIR* pAvPair, UINT16 len) +static inline void ntlm_av_pair_set_len(NTLM_AV_PAIR* pAvPair, UINT16 len) { WINPR_ASSERT(pAvPair); winpr_Data_Write_UINT16(&pAvPair->AvLen, len); @@ -111,7 +111,7 @@ static BOOL ntlm_av_pair_list_init(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairLis return TRUE; } -static INLINE BOOL ntlm_av_pair_get_id(const NTLM_AV_PAIR* pAvPair, size_t size, UINT16* pair) +static inline BOOL ntlm_av_pair_get_id(const NTLM_AV_PAIR* pAvPair, size_t size, UINT16* pair) { if (!pAvPair || !pair) return FALSE; @@ -144,7 +144,7 @@ ULONG ntlm_av_pair_list_length(NTLM_AV_PAIR* pAvPairList, size_t cbAvPairList) return (ULONG)size; } -static INLINE BOOL ntlm_av_pair_get_len(const NTLM_AV_PAIR* pAvPair, size_t size, size_t* pAvLen) +static inline BOOL ntlm_av_pair_get_len(const NTLM_AV_PAIR* pAvPair, size_t size, size_t* pAvLen) { if (!pAvPair) return FALSE; diff --git a/winpr/libwinpr/sspi/sspi_gss.h b/winpr/libwinpr/sspi/sspi_gss.h index 205f86afb..449bcdb22 100644 --- a/winpr/libwinpr/sspi/sspi_gss.h +++ b/winpr/libwinpr/sspi/sspi_gss.h @@ -69,7 +69,7 @@ typedef struct #define GSS_CHECKSUM_TYPE 0x8003 -static INLINE BOOL sspi_gss_oid_compare(const WinPrAsn1_OID* oid1, const WinPrAsn1_OID* oid2) +static inline BOOL sspi_gss_oid_compare(const WinPrAsn1_OID* oid1, const WinPrAsn1_OID* oid2) { WINPR_ASSERT(oid1); WINPR_ASSERT(oid2); diff --git a/winpr/libwinpr/thread/apc.c b/winpr/libwinpr/thread/apc.c index b775f23cc..7b3e66754 100644 --- a/winpr/libwinpr/thread/apc.c +++ b/winpr/libwinpr/thread/apc.c @@ -92,7 +92,7 @@ void apc_register(WINPR_THREAD* thread, WINPR_APC_ITEM* addItem) pthread_mutex_unlock(&apc->mutex); } -static INLINE void apc_item_remove(APC_QUEUE* apc, WINPR_APC_ITEM* item) +static inline void apc_item_remove(APC_QUEUE* apc, WINPR_APC_ITEM* item) { WINPR_ASSERT(apc); WINPR_ASSERT(item); diff --git a/winpr/libwinpr/utils/collections/HashTable.c b/winpr/libwinpr/utils/collections/HashTable.c index 773a2320b..35b0e4904 100644 --- a/winpr/libwinpr/utils/collections/HashTable.c +++ b/winpr/libwinpr/utils/collections/HashTable.c @@ -104,7 +104,7 @@ void HashTable_StringFree(void* str) winpr_ObjectStringFree(str); } -static INLINE BOOL HashTable_IsProbablePrime(size_t oddNumber) +static inline BOOL HashTable_IsProbablePrime(size_t oddNumber) { for (size_t i = 3; i < 51; i += 2) { @@ -117,7 +117,7 @@ static INLINE BOOL HashTable_IsProbablePrime(size_t oddNumber) return TRUE; /* maybe */ } -static INLINE size_t HashTable_CalculateIdealNumOfBuckets(wHashTable* table) +static inline size_t HashTable_CalculateIdealNumOfBuckets(wHashTable* table) { WINPR_ASSERT(table); @@ -136,7 +136,7 @@ static INLINE size_t HashTable_CalculateIdealNumOfBuckets(wHashTable* table) return idealNumOfBuckets; } -static INLINE void HashTable_Rehash(wHashTable* table, size_t numOfBuckets) +static inline void HashTable_Rehash(wHashTable* table, size_t numOfBuckets) { UINT32 hashValue = 0; wKeyValuePair* nextPair = NULL; @@ -179,7 +179,7 @@ static INLINE void HashTable_Rehash(wHashTable* table, size_t numOfBuckets) table->numOfBuckets = numOfBuckets; } -static INLINE BOOL HashTable_Equals(wHashTable* table, const wKeyValuePair* pair, const void* key) +static inline BOOL HashTable_Equals(wHashTable* table, const wKeyValuePair* pair, const void* key) { WINPR_ASSERT(table); WINPR_ASSERT(pair); @@ -187,7 +187,7 @@ static INLINE BOOL HashTable_Equals(wHashTable* table, const wKeyValuePair* pair return table->key.fnObjectEquals(key, pair->key); } -static INLINE wKeyValuePair* HashTable_Get(wHashTable* table, const void* key) +static inline wKeyValuePair* HashTable_Get(wHashTable* table, const void* key) { UINT32 hashValue = 0; wKeyValuePair* pair = NULL; @@ -205,21 +205,21 @@ static INLINE wKeyValuePair* HashTable_Get(wHashTable* table, const void* key) return pair; } -static INLINE void disposeKey(wHashTable* table, void* key) +static inline void disposeKey(wHashTable* table, void* key) { WINPR_ASSERT(table); if (table->key.fnObjectFree) table->key.fnObjectFree(key); } -static INLINE void disposeValue(wHashTable* table, void* value) +static inline void disposeValue(wHashTable* table, void* value) { WINPR_ASSERT(table); if (table->value.fnObjectFree) table->value.fnObjectFree(value); } -static INLINE void disposePair(wHashTable* table, wKeyValuePair* pair) +static inline void disposePair(wHashTable* table, wKeyValuePair* pair) { WINPR_ASSERT(table); if (!pair) @@ -229,7 +229,7 @@ static INLINE void disposePair(wHashTable* table, wKeyValuePair* pair) free(pair); } -static INLINE void setKey(wHashTable* table, wKeyValuePair* pair, const void* key) +static inline void setKey(wHashTable* table, wKeyValuePair* pair, const void* key) { WINPR_ASSERT(table); if (!pair) @@ -249,7 +249,7 @@ static INLINE void setKey(wHashTable* table, wKeyValuePair* pair, const void* ke } } -static INLINE void setValue(wHashTable* table, wKeyValuePair* pair, const void* value) +static inline void setValue(wHashTable* table, wKeyValuePair* pair, const void* value) { WINPR_ASSERT(table); if (!pair) diff --git a/winpr/libwinpr/utils/collections/StreamPool.c b/winpr/libwinpr/utils/collections/StreamPool.c index f85e439f9..6e1ac74c9 100644 --- a/winpr/libwinpr/utils/collections/StreamPool.c +++ b/winpr/libwinpr/utils/collections/StreamPool.c @@ -87,7 +87,7 @@ static struct s_StreamPoolEntry add_entry(wStream* s) * Lock the stream pool */ -static INLINE void StreamPool_Lock(wStreamPool* pool) +static inline void StreamPool_Lock(wStreamPool* pool) { WINPR_ASSERT(pool); if (pool->synchronized) @@ -98,7 +98,7 @@ static INLINE void StreamPool_Lock(wStreamPool* pool) * Unlock the stream pool */ -static INLINE void StreamPool_Unlock(wStreamPool* pool) +static inline void StreamPool_Unlock(wStreamPool* pool) { WINPR_ASSERT(pool); if (pool->synchronized) diff --git a/winpr/test/TestIntrinsics.c b/winpr/test/TestIntrinsics.c index e9a657bb1..e9096d2e1 100644 --- a/winpr/test/TestIntrinsics.c +++ b/winpr/test/TestIntrinsics.c @@ -6,7 +6,7 @@ static BOOL g_LZCNT = FALSE; -static INLINE UINT32 lzcnt_s(UINT32 x) +static inline UINT32 lzcnt_s(UINT32 x) { if (!x) return 32;