diff --git a/include/freerdp/codec/interleaved.h b/include/freerdp/codec/interleaved.h index 964fb0471..9bc8b96fc 100644 --- a/include/freerdp/codec/interleaved.h +++ b/include/freerdp/codec/interleaved.h @@ -33,22 +33,27 @@ extern "C" typedef struct S_BITMAP_INTERLEAVED_CONTEXT BITMAP_INTERLEAVED_CONTEXT; - FREERDP_API BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, - const BYTE* pSrcData, UINT32 SrcSize, UINT32 nSrcWidth, - UINT32 nSrcHeight, UINT32 bpp, BYTE* pDstData, - UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, - UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, - const gdiPalette* palette); + FREERDP_API BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* WINPR_RESTRICT interleaved, + const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcSize, + UINT32 nSrcWidth, UINT32 nSrcHeight, UINT32 bpp, + BYTE* WINPR_RESTRICT pDstData, UINT32 DstFormat, + UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, + UINT32 nDstWidth, UINT32 nDstHeight, + const gdiPalette* WINPR_RESTRICT palette); - FREERDP_API BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pDstData, - UINT32* pDstSize, UINT32 nWidth, UINT32 nHeight, - const BYTE* pSrcData, UINT32 SrcFormat, UINT32 nSrcStep, - UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette, + FREERDP_API BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* WINPR_RESTRICT interleaved, + BYTE* WINPR_RESTRICT pDstData, + UINT32* WINPR_RESTRICT pDstSize, UINT32 nWidth, + UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, + UINT32 SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, + UINT32 nYSrc, const gdiPalette* WINPR_RESTRICT palette, UINT32 bpp); - FREERDP_API BOOL bitmap_interleaved_context_reset(BITMAP_INTERLEAVED_CONTEXT* interleaved); + FREERDP_API BOOL + bitmap_interleaved_context_reset(BITMAP_INTERLEAVED_CONTEXT* WINPR_RESTRICT interleaved); - FREERDP_API void bitmap_interleaved_context_free(BITMAP_INTERLEAVED_CONTEXT* interleaved); + FREERDP_API void + bitmap_interleaved_context_free(BITMAP_INTERLEAVED_CONTEXT* WINPR_RESTRICT interleaved); WINPR_ATTR_MALLOC(bitmap_interleaved_context_free, 1) FREERDP_API BITMAP_INTERLEAVED_CONTEXT* bitmap_interleaved_context_new(BOOL Compressor); diff --git a/libfreerdp/codec/include/bitmap.c b/libfreerdp/codec/include/bitmap.c index af8338711..c51f61352 100644 --- a/libfreerdp/codec/include/bitmap.c +++ b/libfreerdp/codec/include/bitmap.c @@ -24,7 +24,8 @@ /** * Write a foreground/background image to a destination buffer. */ -static INLINE BYTE* WRITEFGBGIMAGE(BYTE* pbDest, const BYTE* pbDestEnd, UINT32 rowDelta, +static INLINE BYTE* WRITEFGBGIMAGE(BYTE* WINPR_RESTRICT pbDest, + const BYTE* WINPR_RESTRICT pbDestEnd, UINT32 rowDelta, BYTE bitmask, PIXEL fgPel, INT32 cBits) { PIXEL xorPixel; @@ -58,7 +59,8 @@ static INLINE BYTE* WRITEFGBGIMAGE(BYTE* pbDest, const BYTE* pbDestEnd, UINT32 r * Write a foreground/background image to a destination buffer * for the first line of compressed data. */ -static INLINE BYTE* WRITEFIRSTLINEFGBGIMAGE(BYTE* pbDest, const BYTE* pbDestEnd, BYTE bitmask, +static INLINE BYTE* WRITEFIRSTLINEFGBGIMAGE(BYTE* WINPR_RESTRICT pbDest, + const BYTE* WINPR_RESTRICT pbDestEnd, BYTE bitmask, PIXEL fgPel, UINT32 cBits) { BYTE mask = 0x01; @@ -89,8 +91,9 @@ static INLINE BYTE* WRITEFIRSTLINEFGBGIMAGE(BYTE* pbDest, const BYTE* pbDestEnd, /** * Decompress an RLE compressed bitmap. */ -static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, BYTE* pbDestBuffer, - UINT32 rowDelta, UINT32 width, UINT32 height) +static INLINE BOOL RLEDECOMPRESS(const BYTE* WINPR_RESTRICT pbSrcBuffer, UINT32 cbSrcBuffer, + BYTE* WINPR_RESTRICT pbDestBuffer, UINT32 rowDelta, UINT32 width, + UINT32 height) { #if defined(WITH_DEBUG_CODECS) char sbuffer[128] = { 0 }; diff --git a/libfreerdp/codec/interleaved.c b/libfreerdp/codec/interleaved.c index af32cab46..ae3950bc1 100644 --- a/libfreerdp/codec/interleaved.c +++ b/libfreerdp/codec/interleaved.c @@ -525,11 +525,12 @@ struct S_BITMAP_INTERLEAVED_CONTEXT wStream* bts; }; -BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, const BYTE* pSrcData, - UINT32 SrcSize, UINT32 nSrcWidth, UINT32 nSrcHeight, UINT32 bpp, - BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, - UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, - const gdiPalette* palette) +BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* WINPR_RESTRICT interleaved, + const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcSize, UINT32 nSrcWidth, + UINT32 nSrcHeight, UINT32 bpp, BYTE* WINPR_RESTRICT pDstData, + UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, + UINT32 nDstWidth, UINT32 nDstHeight, + const gdiPalette* WINPR_RESTRICT palette) { UINT32 scanline = 0; UINT32 SrcFormat = 0; @@ -632,10 +633,11 @@ BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, const BYTE* return TRUE; } -BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pDstData, UINT32* pDstSize, - UINT32 nWidth, UINT32 nHeight, const BYTE* pSrcData, UINT32 SrcFormat, - UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette, - UINT32 bpp) +BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* WINPR_RESTRICT interleaved, + BYTE* WINPR_RESTRICT pDstData, UINT32* pDstSize, UINT32 nWidth, + UINT32 nHeight, const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcFormat, + UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, + const gdiPalette* WINPR_RESTRICT palette, UINT32 bpp) { BOOL status = 0; wStream* s = NULL; @@ -705,7 +707,7 @@ BOOL interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pDstDat return status; } -BOOL bitmap_interleaved_context_reset(BITMAP_INTERLEAVED_CONTEXT* interleaved) +BOOL bitmap_interleaved_context_reset(BITMAP_INTERLEAVED_CONTEXT* WINPR_RESTRICT interleaved) { if (!interleaved) return FALSE; @@ -743,7 +745,7 @@ fail: return NULL; } -void bitmap_interleaved_context_free(BITMAP_INTERLEAVED_CONTEXT* interleaved) +void bitmap_interleaved_context_free(BITMAP_INTERLEAVED_CONTEXT* WINPR_RESTRICT interleaved) { if (!interleaved) return;