From 49bce0436c05a2a22693daa147be2f45d66c0791 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 30 May 2024 00:39:37 +0200 Subject: [PATCH] [codec,bulk] restrict keyword --- libfreerdp/codec/bulk.c | 16 +++++++++------- libfreerdp/codec/bulk.h | 14 ++++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/libfreerdp/codec/bulk.c b/libfreerdp/codec/bulk.c index 1f5beb3e1..f1f77d49d 100644 --- a/libfreerdp/codec/bulk.c +++ b/libfreerdp/codec/bulk.c @@ -73,7 +73,7 @@ static INLINE const char* bulk_get_compression_flags_string(UINT32 flags) } #endif -static UINT32 bulk_compression_level(rdpBulk* bulk) +static UINT32 bulk_compression_level(rdpBulk* WINPR_RESTRICT bulk) { rdpSettings* settings = NULL; WINPR_ASSERT(bulk); @@ -86,7 +86,7 @@ static UINT32 bulk_compression_level(rdpBulk* bulk) return bulk->CompressionLevel; } -UINT32 bulk_compression_max_size(rdpBulk* bulk) +UINT32 bulk_compression_max_size(rdpBulk* WINPR_RESTRICT bulk) { WINPR_ASSERT(bulk); bulk_compression_level(bulk); @@ -146,8 +146,9 @@ static INLINE int bulk_compress_validate(rdpBulk* bulk, const BYTE* pSrcData, UI } #endif -int bulk_decompress(rdpBulk* bulk, const BYTE* pSrcData, UINT32 SrcSize, const BYTE** ppDstData, - UINT32* pDstSize, UINT32 flags) +int bulk_decompress(rdpBulk* WINPR_RESTRICT bulk, const BYTE* WINPR_RESTRICT pSrcData, + UINT32 SrcSize, const BYTE** WINPR_RESTRICT ppDstData, + UINT32* WINPR_RESTRICT pDstSize, UINT32 flags) { UINT32 type = 0; int status = -1; @@ -239,8 +240,9 @@ int bulk_decompress(rdpBulk* bulk, const BYTE* pSrcData, UINT32 SrcSize, const B return status; } -int bulk_compress(rdpBulk* bulk, const BYTE* pSrcData, UINT32 SrcSize, const BYTE** ppDstData, - UINT32* pDstSize, UINT32* pFlags) +int bulk_compress(rdpBulk* WINPR_RESTRICT bulk, const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcSize, + const BYTE** WINPR_RESTRICT ppDstData, UINT32* WINPR_RESTRICT pDstSize, + UINT32* WINPR_RESTRICT pFlags) { int status = -1; rdpMetrics* metrics = NULL; @@ -324,7 +326,7 @@ int bulk_compress(rdpBulk* bulk, const BYTE* pSrcData, UINT32 SrcSize, const BYT return status; } -void bulk_reset(rdpBulk* bulk) +void bulk_reset(rdpBulk* WINPR_RESTRICT bulk) { WINPR_ASSERT(bulk); diff --git a/libfreerdp/codec/bulk.h b/libfreerdp/codec/bulk.h index 4c8540613..c1dfeb302 100644 --- a/libfreerdp/codec/bulk.h +++ b/libfreerdp/codec/bulk.h @@ -28,14 +28,16 @@ typedef struct rdp_bulk rdpBulk; #define BULK_COMPRESSION_FLAGS_MASK 0xE0 #define BULK_COMPRESSION_TYPE_MASK 0x0F -FREERDP_LOCAL UINT32 bulk_compression_max_size(rdpBulk* bulk); +FREERDP_LOCAL UINT32 bulk_compression_max_size(rdpBulk* WINPR_RESTRICT bulk); -FREERDP_LOCAL int bulk_decompress(rdpBulk* bulk, const BYTE* pSrcData, UINT32 SrcSize, - const BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); -FREERDP_LOCAL int bulk_compress(rdpBulk* bulk, const BYTE* pSrcData, UINT32 SrcSize, - const BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); +FREERDP_LOCAL int bulk_decompress(rdpBulk* WINPR_RESTRICT bulk, const BYTE* WINPR_RESTRICT pSrcData, + UINT32 SrcSize, const BYTE** WINPR_RESTRICT ppDstData, + UINT32* WINPR_RESTRICT pDstSize, UINT32 flags); +FREERDP_LOCAL int bulk_compress(rdpBulk* WINPR_RESTRICT bulk, const BYTE* WINPR_RESTRICT pSrcData, + UINT32 SrcSize, const BYTE** WINPR_RESTRICT ppDstData, + UINT32* WINPR_RESTRICT pDstSize, UINT32* WINPR_RESTRICT pFlags); -FREERDP_LOCAL void bulk_reset(rdpBulk* bulk); +FREERDP_LOCAL void bulk_reset(rdpBulk* WINPR_RESTRICT bulk); FREERDP_LOCAL void bulk_free(rdpBulk* bulk);