From c84655cd621642a0d5f73df75393037591f81875 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 12 Sep 2024 14:28:46 +0200 Subject: [PATCH] [warnings] remove const params Avoid const TYPE* const type declarations --- include/freerdp/primitives.h | 30 +++++----- libfreerdp/codec/progressive.c | 6 +- libfreerdp/core/gateway/rpc_fault.c | 12 ++-- libfreerdp/core/info.c | 5 +- libfreerdp/core/license.c | 35 ++++++----- libfreerdp/locale/locale.c | 6 +- libfreerdp/primitives/neon/prim_YUV_neon.c | 35 +++++------ libfreerdp/primitives/neon/prim_colors_neon.c | 29 +++++----- .../primitives/opencl/prim_YUV_opencl.c | 12 ++-- libfreerdp/primitives/prim_YUV.c | 18 +++--- libfreerdp/primitives/prim_colors.c | 39 +++++++------ libfreerdp/primitives/sse/prim_YUV_ssse3.c | 28 +++++---- libfreerdp/primitives/sse/prim_colors_sse2.c | 52 ++++++++--------- winpr/include/winpr/json.h | 58 +++++++++---------- winpr/include/winpr/strlst.h | 6 +- winpr/libwinpr/comm/comm_ioctl.c | 2 +- winpr/libwinpr/sspi/sspi_winpr.c | 2 +- winpr/libwinpr/utils/json/json.c | 58 +++++++++---------- winpr/libwinpr/utils/strlst.c | 6 +- 19 files changed, 212 insertions(+), 227 deletions(-) diff --git a/include/freerdp/primitives.h b/include/freerdp/primitives.h index 88dd5e89d..7cea33b32 100644 --- a/include/freerdp/primitives.h +++ b/include/freerdp/primitives.h @@ -118,21 +118,19 @@ typedef pstatus_t (*__rShiftC_16u_t)(const UINT16* pSrc, UINT32 val, UINT16* pSr typedef pstatus_t (*__shiftC_16s_t)(const INT16* pSrc, INT32 val, INT16* pSrcDst, UINT32 len); typedef pstatus_t (*__shiftC_16u_t)(const UINT16* pSrc, INT32 val, UINT16* pSrcDst, UINT32 len); typedef pstatus_t (*__sign_16s_t)(const INT16* pSrc, INT16* pSrcDst, UINT32 len); -typedef pstatus_t (*__yCbCrToRGB_16s8u_P3AC4R_t)(const INT16* const WINPR_RESTRICT pSrc[3], +typedef pstatus_t (*__yCbCrToRGB_16s8u_P3AC4R_t)(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi); -typedef pstatus_t (*__yCbCrToRGB_16s16s_P3P3_t)(const INT16* const WINPR_RESTRICT pSrc[3], - INT32 srcStep, INT16* WINPR_RESTRICT pDst[3], - INT32 dstStep, +typedef pstatus_t (*__yCbCrToRGB_16s16s_P3P3_t)(const INT16* WINPR_RESTRICT pSrc[3], INT32 srcStep, + INT16* WINPR_RESTRICT pDst[3], INT32 dstStep, const prim_size_t* WINPR_RESTRICT roi); -typedef pstatus_t (*__RGBToYCbCr_16s16s_P3P3_t)(const INT16* const WINPR_RESTRICT pSrc[3], - INT32 srcStep, INT16* WINPR_RESTRICT pDst[3], - INT32 dstStep, +typedef pstatus_t (*__RGBToYCbCr_16s16s_P3P3_t)(const INT16* WINPR_RESTRICT pSrc[3], INT32 srcStep, + INT16* WINPR_RESTRICT pDst[3], INT32 dstStep, const prim_size_t* WINPR_RESTRICT roi); -typedef pstatus_t (*__RGBToRGB_16s8u_P3AC4R_t)(const INT16* const WINPR_RESTRICT pSrc[3], - UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, - UINT32 dstStep, UINT32 DstFormat, +typedef pstatus_t (*__RGBToRGB_16s8u_P3AC4R_t)(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, + BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, + UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi); typedef pstatus_t (*__YCoCgToRGB_8u_AC4R_t)(const BYTE* WINPR_RESTRICT pSrc, INT32 srcStep, BYTE* WINPR_RESTRICT pDst, UINT32 DstFormat, @@ -141,11 +139,11 @@ typedef pstatus_t (*__YCoCgToRGB_8u_AC4R_t)(const BYTE* WINPR_RESTRICT pSrc, INT typedef pstatus_t (*__RGB565ToARGB_16u32u_C3C4_t)(const UINT16* WINPR_RESTRICT pSrc, INT32 srcStep, UINT32* WINPR_RESTRICT pDst, INT32 dstStep, UINT32 width, UINT32 height, UINT32 format); -typedef pstatus_t (*__YUV420ToRGB_8u_P3AC4R_t)(const BYTE* const WINPR_RESTRICT pSrc[3], +typedef pstatus_t (*__YUV420ToRGB_8u_P3AC4R_t)(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi); -typedef pstatus_t (*__YUV444ToRGB_8u_P3AC4R_t)(const BYTE* const WINPR_RESTRICT pSrc[3], +typedef pstatus_t (*__YUV444ToRGB_8u_P3AC4R_t)(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi); @@ -158,15 +156,15 @@ typedef pstatus_t (*__RGBToYUV444_8u_P3AC4R_t)(const BYTE* WINPR_RESTRICT pSrc, UINT32 dstStep[3], const prim_size_t* WINPR_RESTRICT roi); typedef pstatus_t (*__YUV420CombineToYUV444_t)(avc444_frame_type type, - const BYTE* const WINPR_RESTRICT pSrc[3], + const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], UINT32 nWidth, UINT32 nHeight, BYTE* WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi); typedef pstatus_t (*__YUV444SplitToYUV420_t)( - const BYTE* const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], - BYTE* WINPR_RESTRICT pMainDst[3], const UINT32 dstMainStep[3], BYTE* WINPR_RESTRICT pAuxDst[3], - const UINT32 srcAuxStep[3], const prim_size_t* WINPR_RESTRICT roi); + const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pMainDst[3], + const UINT32 dstMainStep[3], BYTE* WINPR_RESTRICT pAuxDst[3], const UINT32 srcAuxStep[3], + const prim_size_t* WINPR_RESTRICT roi); typedef pstatus_t (*__RGBToAVC444YUV_t)(const BYTE* WINPR_RESTRICT pSrc, UINT32 srcFormat, UINT32 srcStep, BYTE* WINPR_RESTRICT pMainDst[3], const UINT32 dstMainStep[3], diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index 6ea7b4103..35a2758c2 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -1050,8 +1050,8 @@ progressive_decompress_tile_first(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progressiv if (rc < 0) goto fail; - rc = prims->yCbCrToRGB_16s8u_P3AC4R((const INT16* const*)pSrcDst, 64 * 2, tile->data, - tile->stride, progressive->format, &roi_64x64); + rc = prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**)pSrcDst, 64 * 2, tile->data, tile->stride, + progressive->format, &roi_64x64); fail: BufferPool_Return(progressive->bufferPool, pBuffer); return rc; @@ -1494,7 +1494,7 @@ progressive_decompress_tile_upgrade(PROGRESSIVE_CONTEXT* WINPR_RESTRICT progress if (status < 0) goto fail; - status = prims->yCbCrToRGB_16s8u_P3AC4R((const INT16* const*)pSrcDst, 64 * 2, tile->data, + status = prims->yCbCrToRGB_16s8u_P3AC4R((const INT16**)pSrcDst, 64 * 2, tile->data, tile->stride, progressive->format, &roi_64x64); fail: BufferPool_Return(progressive->bufferPool, pBuffer); diff --git a/libfreerdp/core/gateway/rpc_fault.c b/libfreerdp/core/gateway/rpc_fault.c index 267ea8c07..e9ef0e570 100644 --- a/libfreerdp/core/gateway/rpc_fault.c +++ b/libfreerdp/core/gateway/rpc_fault.c @@ -358,7 +358,7 @@ const char* rpc_error_to_string(UINT32 code) for (size_t index = 0; index < ARRAYSIZE(RPC_FAULT_CODES); index++) { - const RPC_FAULT_CODE* const current = &RPC_FAULT_CODES[index]; + const RPC_FAULT_CODE* current = &RPC_FAULT_CODES[index]; if (current->code == code) { (void)sprintf_s(buffer, ARRAYSIZE(buffer), "%s", current->name); @@ -368,7 +368,7 @@ const char* rpc_error_to_string(UINT32 code) for (size_t index = 0; index < ARRAYSIZE(RPC_TSG_FAULT_CODES); index++) { - const RPC_FAULT_CODE* const current = &RPC_TSG_FAULT_CODES[index]; + const RPC_FAULT_CODE* current = &RPC_TSG_FAULT_CODES[index]; if (current->code == code) { (void)sprintf_s(buffer, ARRAYSIZE(buffer), "%s", current->name); @@ -378,7 +378,7 @@ const char* rpc_error_to_string(UINT32 code) for (size_t index = 0; index < ARRAYSIZE(RPC_TSG_FAULT_CODES); index++) { - const RPC_FAULT_CODE* const current = &RPC_TSG_FAULT_CODES[index]; + const RPC_FAULT_CODE* current = &RPC_TSG_FAULT_CODES[index]; if (current->code == HRESULT_CODE(code)) { (void)sprintf_s(buffer, ARRAYSIZE(buffer), "%s", current->name); @@ -395,21 +395,21 @@ const char* rpc_error_to_category(UINT32 code) { for (size_t index = 0; index < ARRAYSIZE(RPC_FAULT_CODES); index++) { - const RPC_FAULT_CODE* const current = &RPC_FAULT_CODES[index]; + const RPC_FAULT_CODE* current = &RPC_FAULT_CODES[index]; if (current->code == code) return current->category; } for (size_t index = 0; index < ARRAYSIZE(RPC_TSG_FAULT_CODES); index++) { - const RPC_FAULT_CODE* const current = &RPC_TSG_FAULT_CODES[index]; + const RPC_FAULT_CODE* current = &RPC_TSG_FAULT_CODES[index]; if (current->code == code) return current->category; } for (size_t index = 0; index < ARRAYSIZE(RPC_TSG_FAULT_CODES); index++) { - const RPC_FAULT_CODE* const current = &RPC_TSG_FAULT_CODES[index]; + const RPC_FAULT_CODE* current = &RPC_TSG_FAULT_CODES[index]; if (current->code == HRESULT_CODE(code)) return current->category; } diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c index 38c698d5f..9d20a6eca 100644 --- a/libfreerdp/core/info.c +++ b/libfreerdp/core/info.c @@ -41,9 +41,8 @@ #define logonInfoV2ReservedSize 558 #define logonInfoV2TotalSize (logonInfoV2Size + logonInfoV2ReservedSize) -static const char* const INFO_TYPE_LOGON_STRINGS[4] = { "Logon Info V1", "Logon Info V2", - "Logon Plain Notify", - "Logon Extended Info" }; +static const char* INFO_TYPE_LOGON_STRINGS[4] = { "Logon Info V1", "Logon Info V2", + "Logon Plain Notify", "Logon Extended Info" }; /* This define limits the length of the strings in the label field. */ #define MAX_LABEL_LENGTH 40 diff --git a/libfreerdp/core/license.c b/libfreerdp/core/license.c index 2d6cf49b4..6b2790430 100644 --- a/libfreerdp/core/license.c +++ b/libfreerdp/core/license.c @@ -348,23 +348,22 @@ static state_run_t license_server_recv(rdpLicense* license, wStream* s); #ifdef WITH_DEBUG_LICENSE -static const char* const error_codes[] = { "ERR_UNKNOWN", - "ERR_INVALID_SERVER_CERTIFICATE", - "ERR_NO_LICENSE", - "ERR_INVALID_MAC", - "ERR_INVALID_SCOPE", - "ERR_UNKNOWN", - "ERR_NO_LICENSE_SERVER", - "STATUS_VALID_CLIENT", - "ERR_INVALID_CLIENT", - "ERR_UNKNOWN", - "ERR_UNKNOWN", - "ERR_INVALID_PRODUCT_ID", - "ERR_INVALID_MESSAGE_LENGTH" }; +static const char* error_codes[] = { "ERR_UNKNOWN", + "ERR_INVALID_SERVER_CERTIFICATE", + "ERR_NO_LICENSE", + "ERR_INVALID_MAC", + "ERR_INVALID_SCOPE", + "ERR_UNKNOWN", + "ERR_NO_LICENSE_SERVER", + "STATUS_VALID_CLIENT", + "ERR_INVALID_CLIENT", + "ERR_UNKNOWN", + "ERR_UNKNOWN", + "ERR_INVALID_PRODUCT_ID", + "ERR_INVALID_MESSAGE_LENGTH" }; -static const char* const state_transitions[] = { "ST_UNKNOWN", "ST_TOTAL_ABORT", "ST_NO_TRANSITION", - "ST_RESET_PHASE_TO_START", - "ST_RESEND_LAST_MESSAGE" }; +static const char* state_transitions[] = { "ST_UNKNOWN", "ST_TOTAL_ABORT", "ST_NO_TRANSITION", + "ST_RESET_PHASE_TO_START", "ST_RESEND_LAST_MESSAGE" }; static void license_print_product_info(const LICENSE_PRODUCT_INFO* productInfo) { @@ -2851,8 +2850,8 @@ BOOL license_server_configure(rdpLicense* license) freerdp_settings_get_uint32(settings, FreeRDP_ServerLicenseProductVersion); const UINT32 issuerCount = freerdp_settings_get_uint32(settings, FreeRDP_ServerLicenseProductIssuersCount); - const char* const* issuers = (const char* const*)freerdp_settings_get_pointer( - settings, FreeRDP_ServerLicenseProductIssuers); + const char** issuers = + (const char**)freerdp_settings_get_pointer(settings, FreeRDP_ServerLicenseProductIssuers); WINPR_ASSERT(CompanyName); WINPR_ASSERT(ProductName); diff --git a/libfreerdp/locale/locale.c b/libfreerdp/locale/locale.c index 36addb57d..9d42b0c4c 100644 --- a/libfreerdp/locale/locale.c +++ b/libfreerdp/locale/locale.c @@ -789,7 +789,7 @@ static INT64 get_layout_from_locale(const SYSTEM_LOCALE* locale) { for (size_t i = 0; i < ARRAYSIZE(LOCALE_KEYBOARD_LAYOUTS_TABLE); i++) { - const LOCALE_KEYBOARD_LAYOUTS* const current = &LOCALE_KEYBOARD_LAYOUTS_TABLE[i]; + const LOCALE_KEYBOARD_LAYOUTS* current = &LOCALE_KEYBOARD_LAYOUTS_TABLE[i]; WINPR_ASSERT(current); if (current->locale == locale->code) @@ -826,7 +826,7 @@ const char* freerdp_get_system_locale_name_from_id(DWORD localeId) { for (size_t index = 0; index < ARRAYSIZE(LOCALE_NAME_TABLE); index++) { - const LOCALE_NAME* const current = &LOCALE_NAME_TABLE[index]; + const LOCALE_NAME* current = &LOCALE_NAME_TABLE[index]; if (localeId == current->localeId) return current->name; @@ -881,7 +881,7 @@ DWORD freerdp_get_keyboard_default_layout_for_locale(DWORD locale) { for (size_t x = 0; x < ARRAYSIZE(LOCALE_KEYBOARD_LAYOUTS_TABLE); x++) { - const LOCALE_KEYBOARD_LAYOUTS* const cur = &LOCALE_KEYBOARD_LAYOUTS_TABLE[x]; + const LOCALE_KEYBOARD_LAYOUTS* cur = &LOCALE_KEYBOARD_LAYOUTS_TABLE[x]; if (cur->locale == locale) return cur->keyboardLayouts[0]; } diff --git a/libfreerdp/primitives/neon/prim_YUV_neon.c b/libfreerdp/primitives/neon/prim_YUV_neon.c index e631d0a0a..c45148503 100644 --- a/libfreerdp/primitives/neon/prim_YUV_neon.c +++ b/libfreerdp/primitives/neon/prim_YUV_neon.c @@ -130,11 +130,10 @@ static INLINE BYTE* neon_YuvToRgbPixel(BYTE* pRGB, int16x8_t Y, int16x8_t D, int return pRGB; } -static INLINE pstatus_t neon_YUV420ToX(const BYTE* const 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) +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) { const UINT32 nWidth = roi->width; const UINT32 nHeight = roi->height; @@ -280,11 +279,10 @@ static pstatus_t neon_YUV420ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT const pSr } } -static INLINE pstatus_t neon_YUV444ToX(const BYTE* const 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) +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) { const UINT32 nWidth = roi->width; const UINT32 nHeight = roi->height; @@ -371,9 +369,9 @@ static pstatus_t neon_YUV444ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT const pSr } } -static pstatus_t neon_LumaToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw[3], - const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDstRaw[3], - const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) +static pstatus_t neon_LumaToYUV444(const BYTE* WINPR_RESTRICT pSrcRaw[3], const UINT32 srcStep[3], + BYTE* WINPR_RESTRICT pDstRaw[3], const UINT32 dstStep[3], + const RECTANGLE_16* WINPR_RESTRICT roi) { const UINT32 nWidth = roi->right - roi->left; const UINT32 nHeight = roi->bottom - roi->top; @@ -534,7 +532,7 @@ static pstatus_t neon_ChromaFilter(BYTE* WINPR_RESTRICT pDst[3], const UINT32 ds return PRIMITIVES_SUCCESS; } -static pstatus_t neon_ChromaV1ToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw[3], +static pstatus_t neon_ChromaV1ToYUV444(const BYTE* WINPR_RESTRICT pSrcRaw[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDstRaw[3], const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) @@ -625,10 +623,9 @@ static pstatus_t neon_ChromaV1ToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw[ return neon_ChromaFilter(pDst, dstStep, roi); } -static pstatus_t neon_ChromaV2ToYUV444(const BYTE* const WINPR_RESTRICT pSrc[3], - const UINT32 srcStep[3], UINT32 nTotalWidth, - UINT32 nTotalHeight, BYTE* WINPR_RESTRICT pDst[3], - const UINT32 dstStep[3], +static pstatus_t neon_ChromaV2ToYUV444(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], + UINT32 nTotalWidth, UINT32 nTotalHeight, + BYTE* WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) { const UINT32 nWidth = roi->right - roi->left; @@ -711,7 +708,7 @@ static pstatus_t neon_ChromaV2ToYUV444(const BYTE* const WINPR_RESTRICT pSrc[3], } static pstatus_t neon_YUV420CombineToYUV444(avc444_frame_type type, - const BYTE* const WINPR_RESTRICT pSrc[3], + const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], UINT32 nWidth, UINT32 nHeight, BYTE* WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) diff --git a/libfreerdp/primitives/neon/prim_colors_neon.c b/libfreerdp/primitives/neon/prim_colors_neon.c index cb76823ef..a3b7ed539 100644 --- a/libfreerdp/primitives/neon/prim_colors_neon.c +++ b/libfreerdp/primitives/neon/prim_colors_neon.c @@ -34,7 +34,7 @@ static primitives_t* generic = NULL; static pstatus_t -neon_yCbCrToRGB_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], INT32 srcStep, +neon_yCbCrToRGB_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], INT32 srcStep, INT16* WINPR_RESTRICT pDst[3], INT32 dstStep, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { @@ -117,9 +117,8 @@ neon_yCbCrToRGB_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], INT32 src return PRIMITIVES_SUCCESS; } -static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R_X(const INT16* const WINPR_RESTRICT pSrc[3], - UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, - UINT32 dstStep, +static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R_X(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, + BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, const prim_size_t* WINPR_RESTRICT roi, uint8_t rPos, uint8_t gPos, uint8_t bPos, uint8_t aPos) { @@ -233,9 +232,9 @@ static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R_X(const INT16* const WINPR_RESTRIC return PRIMITIVES_SUCCESS; } -static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R(const INT16* const WINPR_RESTRICT pSrc[3], - UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, - UINT32 dstStep, UINT32 DstFormat, +static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, + BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, + UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) { switch (DstFormat) @@ -261,13 +260,13 @@ static pstatus_t neon_yCbCrToRGB_16s8u_P3AC4R(const INT16* const WINPR_RESTRICT } } -static pstatus_t neon_RGBToRGB_16s8u_P3AC4R_X( - const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* WINPR_RESTRICT roi, /* region of interest */ - uint8_t rPos, uint8_t gPos, uint8_t bPos, uint8_t aPos) +static pstatus_t +neon_RGBToRGB_16s8u_P3AC4R_X(const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* WINPR_RESTRICT roi, /* region of interest */ + uint8_t rPos, uint8_t gPos, uint8_t bPos, uint8_t aPos) { UINT32 pad = roi->width % 8; @@ -313,7 +312,7 @@ static pstatus_t neon_RGBToRGB_16s8u_P3AC4R_X( } static pstatus_t -neon_RGBToRGB_16s8u_P3AC4R(const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ +neon_RGBToRGB_16s8u_P3AC4R(const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ UINT32 srcStep, /* bytes between rows in source data */ BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ UINT32 dstStep, /* bytes between rows in dest data */ diff --git a/libfreerdp/primitives/opencl/prim_YUV_opencl.c b/libfreerdp/primitives/opencl/prim_YUV_opencl.c index f6a4585ea..e7c9e4efd 100644 --- a/libfreerdp/primitives/opencl/prim_YUV_opencl.c +++ b/libfreerdp/primitives/opencl/prim_YUV_opencl.c @@ -106,8 +106,8 @@ fail: return NULL; } -static BOOL cl_kernel_set_sources(primitives_cl_kernel* ctx, - const BYTE* const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3]) +static BOOL cl_kernel_set_sources(primitives_cl_kernel* ctx, const BYTE* WINPR_RESTRICT pSrc[3], + const UINT32 srcStep[3]) { const char* sourceNames[] = { "Y", "U", "V" }; @@ -207,7 +207,7 @@ static BOOL cl_kernel_process(primitives_cl_kernel* ctx, BYTE* pDst) return TRUE; } -static pstatus_t opencl_YUVToRGB(const char* kernelName, const BYTE* const WINPR_RESTRICT pSrc[3], +static pstatus_t opencl_YUVToRGB(const char* kernelName, const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, const prim_size_t* WINPR_RESTRICT roi) { @@ -277,7 +277,7 @@ static BOOL primitives_init_opencl_context(primitives_opencl_context* WINPR_REST if (ret != CL_SUCCESS || nplatforms < 1) return FALSE; - cl_platform_id* platform_ids = calloc(nplatforms, sizeof(*platform_ids)); + cl_platform_id* platform_ids = calloc(nplatforms, sizeof(cl_platform_id)); if (!platform_ids) return FALSE; @@ -395,7 +395,7 @@ fail: return FALSE; } -static pstatus_t opencl_YUV420ToRGB_8u_P3AC4R(const BYTE* const WINPR_RESTRICT pSrc[3], +static pstatus_t opencl_YUV420ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) @@ -440,7 +440,7 @@ static pstatus_t opencl_YUV420ToRGB_8u_P3AC4R(const BYTE* const WINPR_RESTRICT p return opencl_YUVToRGB(kernel_name, pSrc, srcStep, pDst, dstStep, roi); } -static pstatus_t opencl_YUV444ToRGB_8u_P3AC4R(const BYTE* const WINPR_RESTRICT pSrc[3], +static pstatus_t opencl_YUV444ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) diff --git a/libfreerdp/primitives/prim_YUV.c b/libfreerdp/primitives/prim_YUV.c index 0ab03d16e..abcfed78e 100644 --- a/libfreerdp/primitives/prim_YUV.c +++ b/libfreerdp/primitives/prim_YUV.c @@ -31,7 +31,7 @@ #include "prim_internal.h" #include "prim_YUV.h" -static pstatus_t general_LumaToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw[3], +static pstatus_t general_LumaToYUV444(const BYTE* WINPR_RESTRICT pSrcRaw[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDstRaw[3], const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) @@ -139,7 +139,7 @@ static pstatus_t general_ChromaFilter(BYTE* WINPR_RESTRICT pDst[3], const UINT32 return PRIMITIVES_SUCCESS; } -static pstatus_t general_ChromaV1ToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw[3], +static pstatus_t general_ChromaV1ToYUV444(const BYTE* WINPR_RESTRICT pSrcRaw[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDstRaw[3], const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) @@ -214,7 +214,7 @@ static pstatus_t general_ChromaV1ToYUV444(const BYTE* const WINPR_RESTRICT pSrcR return general_ChromaFilter(pDst, dstStep, roi); } -static pstatus_t general_ChromaV2ToYUV444(const BYTE* const WINPR_RESTRICT pSrc[3], +static pstatus_t general_ChromaV2ToYUV444(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], UINT32 nTotalWidth, UINT32 nTotalHeight, BYTE* WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], @@ -266,7 +266,7 @@ static pstatus_t general_ChromaV2ToYUV444(const BYTE* const WINPR_RESTRICT pSrc[ } static pstatus_t general_YUV420CombineToYUV444(avc444_frame_type type, - const BYTE* const WINPR_RESTRICT pSrc[3], + const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], UINT32 nWidth, UINT32 nHeight, BYTE* WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], @@ -298,7 +298,7 @@ static pstatus_t general_YUV420CombineToYUV444(avc444_frame_type type, } static pstatus_t -general_YUV444SplitToYUV420(const BYTE* const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], +general_YUV444SplitToYUV420(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pMainDst[3], const UINT32 dstMainStep[3], BYTE* WINPR_RESTRICT pAuxDst[3], const UINT32 dstAuxStep[3], const prim_size_t* WINPR_RESTRICT roi) @@ -386,7 +386,7 @@ general_YUV444SplitToYUV420(const BYTE* const WINPR_RESTRICT pSrc[3], const UINT return PRIMITIVES_SUCCESS; } -static pstatus_t general_YUV444ToRGB_8u_P3AC4R_general(const BYTE* const WINPR_RESTRICT pSrc[3], +static pstatus_t general_YUV444ToRGB_8u_P3AC4R_general(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, @@ -424,7 +424,7 @@ static pstatus_t general_YUV444ToRGB_8u_P3AC4R_general(const BYTE* const WINPR_R return PRIMITIVES_SUCCESS; } -static pstatus_t general_YUV444ToRGB_8u_P3AC4R_BGRX(const BYTE* const WINPR_RESTRICT pSrc[3], +static pstatus_t general_YUV444ToRGB_8u_P3AC4R_BGRX(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, @@ -461,7 +461,7 @@ static pstatus_t general_YUV444ToRGB_8u_P3AC4R_BGRX(const BYTE* const WINPR_REST return PRIMITIVES_SUCCESS; } -static pstatus_t general_YUV444ToRGB_8u_P3AC4R(const BYTE* const WINPR_RESTRICT pSrc[3], +static pstatus_t general_YUV444ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) @@ -482,7 +482,7 @@ static pstatus_t general_YUV444ToRGB_8u_P3AC4R(const BYTE* const WINPR_RESTRICT * | G | = ( | 256 -48 -120 | | U - 128 | ) >> 8 * | B | ( | 256 475 0 | | V - 128 | ) */ -static pstatus_t general_YUV420ToRGB_8u_P3AC4R(const BYTE* const WINPR_RESTRICT pSrc[3], +static pstatus_t general_YUV420ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) diff --git a/libfreerdp/primitives/prim_colors.c b/libfreerdp/primitives/prim_colors.c index d995c75b5..f488d965b 100644 --- a/libfreerdp/primitives/prim_colors.c +++ b/libfreerdp/primitives/prim_colors.c @@ -30,7 +30,7 @@ #define MINMAX(_v_, _l_, _h_) ((_v_) < (_l_) ? (_l_) : ((_v_) > (_h_) ? (_h_) : (_v_))) #endif /* !MINMAX */ /* ------------------------------------------------------------------------- */ -static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* const WINPR_RESTRICT pSrc[3], +static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) @@ -73,7 +73,7 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* const WINPR_R return PRIMITIVES_SUCCESS; } -static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general(const INT16* const WINPR_RESTRICT pSrc[3], +static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) @@ -114,7 +114,7 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general(const INT16* const WINP return PRIMITIVES_SUCCESS; } -static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R(const INT16* const WINPR_RESTRICT pSrc[3], +static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) @@ -135,7 +135,7 @@ static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R(const INT16* const WINPR_RESTRI /* ------------------------------------------------------------------------- */ static pstatus_t -general_yCbCrToRGB_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], INT32 srcStep, +general_yCbCrToRGB_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], INT32 srcStep, INT16* WINPR_RESTRICT pDst[3], INT32 dstStep, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { @@ -214,7 +214,7 @@ general_yCbCrToRGB_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], INT32 /* ------------------------------------------------------------------------- */ static pstatus_t -general_RGBToYCbCr_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], INT32 srcStep, +general_RGBToYCbCr_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], INT32 srcStep, INT16* WINPR_RESTRICT pDst[3], INT32 dstStep, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { @@ -429,10 +429,10 @@ static INLINE fkt_writeScanline getScanlineWriteFunction(DWORD format) /* ------------------------------------------------------------------------- */ static pstatus_t general_RGBToRGB_16s8u_P3AC4R_general( - const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ + const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { const INT16* r = pSrc[0]; @@ -455,10 +455,10 @@ static pstatus_t general_RGBToRGB_16s8u_P3AC4R_general( } static pstatus_t general_RGBToRGB_16s8u_P3AC4R_BGRX( - const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ + const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { const INT16* r = pSrc[0]; @@ -479,12 +479,13 @@ static pstatus_t general_RGBToRGB_16s8u_P3AC4R_BGRX( return PRIMITIVES_SUCCESS; } -static pstatus_t general_RGBToRGB_16s8u_P3AC4R( - const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ +static pstatus_t +general_RGBToRGB_16s8u_P3AC4R(const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + UINT32 DstFormat, + const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { switch (DstFormat) { diff --git a/libfreerdp/primitives/sse/prim_YUV_ssse3.c b/libfreerdp/primitives/sse/prim_YUV_ssse3.c index d0bc27cfa..0638ef9f5 100644 --- a/libfreerdp/primitives/sse/prim_YUV_ssse3.c +++ b/libfreerdp/primitives/sse/prim_YUV_ssse3.c @@ -150,7 +150,7 @@ static __m128i* ssse3_YUV444Pixel(__m128i* WINPR_RESTRICT dst, __m128i Yraw, __m return dst; } -static pstatus_t ssse3_YUV420ToRGB_BGRX(const BYTE* const WINPR_RESTRICT pSrc[], +static pstatus_t ssse3_YUV420ToRGB_BGRX(const BYTE* WINPR_RESTRICT pSrc[], const UINT32* WINPR_RESTRICT srcStep, BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, const prim_size_t* WINPR_RESTRICT roi) @@ -204,9 +204,8 @@ static pstatus_t ssse3_YUV420ToRGB_BGRX(const BYTE* const WINPR_RESTRICT pSrc[], return PRIMITIVES_SUCCESS; } -static pstatus_t ssse3_YUV420ToRGB(const BYTE* const WINPR_RESTRICT pSrc[3], - const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDst, - UINT32 dstStep, UINT32 DstFormat, +static pstatus_t ssse3_YUV420ToRGB(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], + BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) { switch (DstFormat) @@ -220,7 +219,7 @@ static pstatus_t ssse3_YUV420ToRGB(const BYTE* const WINPR_RESTRICT pSrc[3], } } -static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R_BGRX(const BYTE* const WINPR_RESTRICT pSrc[], +static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R_BGRX(const BYTE* WINPR_RESTRICT pSrc[], const UINT32 srcStep[], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, const prim_size_t* WINPR_RESTRICT roi) @@ -265,7 +264,7 @@ static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R_BGRX(const BYTE* const WINPR_RESTRI return PRIMITIVES_SUCCESS; } -static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R(const BYTE* const WINPR_RESTRICT pSrc[], +static pstatus_t ssse3_YUV444ToRGB_8u_P3AC4R(const BYTE* WINPR_RESTRICT pSrc[], const UINT32 srcStep[], BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) @@ -1087,9 +1086,9 @@ static pstatus_t ssse3_RGBToAVC444YUVv2(const BYTE* WINPR_RESTRICT pSrc, UINT32 } } -static pstatus_t ssse3_LumaToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw[], - const UINT32 srcStep[], BYTE* WINPR_RESTRICT pDstRaw[], - const UINT32 dstStep[], const RECTANGLE_16* WINPR_RESTRICT roi) +static pstatus_t ssse3_LumaToYUV444(const BYTE* WINPR_RESTRICT pSrcRaw[], const UINT32 srcStep[], + BYTE* WINPR_RESTRICT pDstRaw[], const UINT32 dstStep[], + const RECTANGLE_16* WINPR_RESTRICT roi) { const UINT32 nWidth = roi->right - roi->left; const UINT32 nHeight = roi->bottom - roi->top; @@ -1250,7 +1249,7 @@ static pstatus_t ssse3_ChromaFilter(BYTE* WINPR_RESTRICT pDst[], const UINT32 ds return PRIMITIVES_SUCCESS; } -static pstatus_t ssse3_ChromaV1ToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw[3], +static pstatus_t ssse3_ChromaV1ToYUV444(const BYTE* WINPR_RESTRICT pSrcRaw[3], const UINT32 srcStep[3], BYTE* WINPR_RESTRICT pDstRaw[3], const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) @@ -1348,10 +1347,9 @@ static pstatus_t ssse3_ChromaV1ToYUV444(const BYTE* const WINPR_RESTRICT pSrcRaw return ssse3_ChromaFilter(pDst, dstStep, roi); } -static pstatus_t ssse3_ChromaV2ToYUV444(const BYTE* const WINPR_RESTRICT pSrc[3], - const UINT32 srcStep[3], UINT32 nTotalWidth, - UINT32 nTotalHeight, BYTE* WINPR_RESTRICT pDst[3], - const UINT32 dstStep[3], +static pstatus_t ssse3_ChromaV2ToYUV444(const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], + UINT32 nTotalWidth, UINT32 nTotalHeight, + BYTE* WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) { const UINT32 nWidth = roi->right - roi->left; @@ -1465,7 +1463,7 @@ static pstatus_t ssse3_ChromaV2ToYUV444(const BYTE* const WINPR_RESTRICT pSrc[3] } static pstatus_t ssse3_YUV420CombineToYUV444(avc444_frame_type type, - const BYTE* const WINPR_RESTRICT pSrc[3], + const BYTE* WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], UINT32 nWidth, UINT32 nHeight, BYTE* WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const RECTANGLE_16* WINPR_RESTRICT roi) diff --git a/libfreerdp/primitives/sse/prim_colors_sse2.c b/libfreerdp/primitives/sse/prim_colors_sse2.c index f76d2f413..4c495e6f1 100644 --- a/libfreerdp/primitives/sse/prim_colors_sse2.c +++ b/libfreerdp/primitives/sse/prim_colors_sse2.c @@ -63,7 +63,7 @@ static inline void GNU_INLINE _mm_prefetch_buffer(char* WINPR_RESTRICT buffer, i /*---------------------------------------------------------------------------*/ static pstatus_t -sse2_yCbCrToRGB_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], int srcStep, +sse2_yCbCrToRGB_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], int srcStep, INT16* WINPR_RESTRICT pDst[3], int dstStep, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { @@ -203,7 +203,7 @@ sse2_yCbCrToRGB_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], int srcSt /*---------------------------------------------------------------------------*/ static pstatus_t -sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* const WINPR_RESTRICT pSrc[3], UINT32 srcStep, +sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { @@ -401,7 +401,7 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* const WINPR_RESTRICT pSrc[3], UIN /*---------------------------------------------------------------------------*/ static pstatus_t -sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* const WINPR_RESTRICT pSrc[3], UINT32 srcStep, +sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { @@ -598,7 +598,7 @@ sse2_yCbCrToRGB_16s8u_P3AC4R_RGBX(const INT16* const WINPR_RESTRICT pSrc[3], UIN } static pstatus_t -sse2_yCbCrToRGB_16s8u_P3AC4R(const INT16* const WINPR_RESTRICT pSrc[3], UINT32 srcStep, +sse2_yCbCrToRGB_16s8u_P3AC4R(const INT16* WINPR_RESTRICT pSrc[3], UINT32 srcStep, BYTE* WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { @@ -628,7 +628,7 @@ sse2_yCbCrToRGB_16s8u_P3AC4R(const INT16* const WINPR_RESTRICT pSrc[3], UINT32 s * numbers. See the general code above. */ static pstatus_t -sse2_RGBToYCbCr_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], int srcStep, +sse2_RGBToYCbCr_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], int srcStep, INT16* WINPR_RESTRICT pDst[3], int dstStep, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { @@ -765,11 +765,11 @@ sse2_RGBToYCbCr_16s16s_P3P3(const INT16* const WINPR_RESTRICT pSrc[3], int srcSt /*---------------------------------------------------------------------------*/ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( - const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ + const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { const UINT16* pr = (const UINT16*)(pSrc[0]); const UINT16* pg = (const UINT16*)(pSrc[1]); @@ -876,11 +876,11 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_BGRX( } static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( - const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ + const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { const UINT16* pr = (const UINT16*)(pSrc[0]); const UINT16* pg = (const UINT16*)(pSrc[1]); @@ -987,11 +987,11 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_RGBX( } static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( - const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ + const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { const UINT16* pr = (const UINT16*)(pSrc[0]); const UINT16* pg = (const UINT16*)(pSrc[1]); @@ -1098,11 +1098,11 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XBGR( } static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( - const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ - UINT32 srcStep, /* bytes between rows in source data */ - BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ - UINT32 dstStep, /* bytes between rows in dest data */ - const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ + const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ + UINT32 srcStep, /* bytes between rows in source data */ + BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ + UINT32 dstStep, /* bytes between rows in dest data */ + const prim_size_t* WINPR_RESTRICT roi) /* region of interest */ { const UINT16* pr = (const UINT16*)(pSrc[0]); const UINT16* pg = (const UINT16*)(pSrc[1]); @@ -1209,7 +1209,7 @@ static pstatus_t sse2_RGBToRGB_16s8u_P3AC4R_XRGB( } static pstatus_t -sse2_RGBToRGB_16s8u_P3AC4R(const INT16* const WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ +sse2_RGBToRGB_16s8u_P3AC4R(const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */ UINT32 srcStep, /* bytes between rows in source data */ BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */ UINT32 dstStep, /* bytes between rows in dest data */ diff --git a/winpr/include/winpr/json.h b/winpr/include/winpr/json.h index 128317be7..600b52a96 100644 --- a/winpr/include/winpr/json.h +++ b/winpr/include/winpr/json.h @@ -34,56 +34,54 @@ extern "C" WINPR_API int WINPR_JSON_version(char* buffer, size_t len); - WINPR_API WINPR_JSON* WINPR_JSON_Parse(const char* const value); - WINPR_API WINPR_JSON* WINPR_JSON_ParseWithLength(const char* const value, size_t buffer_length); + WINPR_API WINPR_JSON* WINPR_JSON_Parse(const char* value); + WINPR_API WINPR_JSON* WINPR_JSON_ParseWithLength(const char* value, size_t buffer_length); WINPR_API void WINPR_JSON_Delete(WINPR_JSON* item); - WINPR_API size_t WINPR_JSON_GetArraySize(const WINPR_JSON* const array); - WINPR_API WINPR_JSON* WINPR_JSON_GetArrayItem(const WINPR_JSON* const array, size_t index); + WINPR_API size_t WINPR_JSON_GetArraySize(const WINPR_JSON* array); + WINPR_API WINPR_JSON* WINPR_JSON_GetArrayItem(const WINPR_JSON* array, size_t index); - WINPR_API WINPR_JSON* WINPR_JSON_GetObjectItem(const WINPR_JSON* const object, - const char* const string); - WINPR_API WINPR_JSON* WINPR_JSON_GetObjectItemCaseSensitive(const WINPR_JSON* const object, - const char* const string); - WINPR_API BOOL WINPR_JSON_HasObjectItem(const WINPR_JSON* const object, - const char* const string); + WINPR_API WINPR_JSON* WINPR_JSON_GetObjectItem(const WINPR_JSON* object, const char* string); + WINPR_API WINPR_JSON* WINPR_JSON_GetObjectItemCaseSensitive(const WINPR_JSON* object, + const char* string); + WINPR_API BOOL WINPR_JSON_HasObjectItem(const WINPR_JSON* object, const char* string); WINPR_API const char* WINPR_JSON_GetErrorPtr(void); WINPR_API const char* WINPR_JSON_GetStringValue(WINPR_JSON* item); - WINPR_API double WINPR_JSON_GetNumberValue(const WINPR_JSON* const item); + WINPR_API double WINPR_JSON_GetNumberValue(const WINPR_JSON* item); - WINPR_API BOOL WINPR_JSON_IsInvalid(const WINPR_JSON* const item); - WINPR_API BOOL WINPR_JSON_IsFalse(const WINPR_JSON* const item); - WINPR_API BOOL WINPR_JSON_IsTrue(const WINPR_JSON* const item); - WINPR_API BOOL WINPR_JSON_IsBool(const WINPR_JSON* const item); - WINPR_API BOOL WINPR_JSON_IsNull(const WINPR_JSON* const item); - WINPR_API BOOL WINPR_JSON_IsNumber(const WINPR_JSON* const item); - WINPR_API BOOL WINPR_JSON_IsString(const WINPR_JSON* const item); - WINPR_API BOOL WINPR_JSON_IsArray(const WINPR_JSON* const item); - WINPR_API BOOL WINPR_JSON_IsObject(const WINPR_JSON* const item); + WINPR_API BOOL WINPR_JSON_IsInvalid(const WINPR_JSON* item); + WINPR_API BOOL WINPR_JSON_IsFalse(const WINPR_JSON* item); + WINPR_API BOOL WINPR_JSON_IsTrue(const WINPR_JSON* item); + WINPR_API BOOL WINPR_JSON_IsBool(const WINPR_JSON* item); + WINPR_API BOOL WINPR_JSON_IsNull(const WINPR_JSON* item); + WINPR_API BOOL WINPR_JSON_IsNumber(const WINPR_JSON* item); + WINPR_API BOOL WINPR_JSON_IsString(const WINPR_JSON* item); + WINPR_API BOOL WINPR_JSON_IsArray(const WINPR_JSON* item); + WINPR_API BOOL WINPR_JSON_IsObject(const WINPR_JSON* item); WINPR_API WINPR_JSON* WINPR_JSON_CreateNull(void); WINPR_API WINPR_JSON* WINPR_JSON_CreateTrue(void); WINPR_API WINPR_JSON* WINPR_JSON_CreateFalse(void); WINPR_API WINPR_JSON* WINPR_JSON_CreateBool(BOOL boolean); WINPR_API WINPR_JSON* WINPR_JSON_CreateNumber(double num); - WINPR_API WINPR_JSON* WINPR_JSON_CreateString(const char* const string); + WINPR_API WINPR_JSON* WINPR_JSON_CreateString(const char* string); WINPR_API WINPR_JSON* WINPR_JSON_CreateArray(void); WINPR_API WINPR_JSON* WINPR_JSON_CreateObject(void); - WINPR_API WINPR_JSON* WINPR_JSON_AddNullToObject(WINPR_JSON* object, const char* const name); - WINPR_API WINPR_JSON* WINPR_JSON_AddTrueToObject(WINPR_JSON* object, const char* const name); - WINPR_API WINPR_JSON* WINPR_JSON_AddFalseToObject(WINPR_JSON* object, const char* const name); - WINPR_API WINPR_JSON* WINPR_JSON_AddBoolToObject(WINPR_JSON* object, const char* const name, + WINPR_API WINPR_JSON* WINPR_JSON_AddNullToObject(WINPR_JSON* object, const char* name); + WINPR_API WINPR_JSON* WINPR_JSON_AddTrueToObject(WINPR_JSON* object, const char* name); + WINPR_API WINPR_JSON* WINPR_JSON_AddFalseToObject(WINPR_JSON* object, const char* name); + WINPR_API WINPR_JSON* WINPR_JSON_AddBoolToObject(WINPR_JSON* object, const char* name, BOOL boolean); - WINPR_API WINPR_JSON* WINPR_JSON_AddNumberToObject(WINPR_JSON* object, const char* const name, + WINPR_API WINPR_JSON* WINPR_JSON_AddNumberToObject(WINPR_JSON* object, const char* name, double number); - WINPR_API WINPR_JSON* WINPR_JSON_AddStringToObject(WINPR_JSON* object, const char* const name, - const char* const string); - WINPR_API WINPR_JSON* WINPR_JSON_AddObjectToObject(WINPR_JSON* object, const char* const name); - WINPR_API WINPR_JSON* WINPR_JSON_AddArrayToObject(WINPR_JSON* object, const char* const name); + WINPR_API WINPR_JSON* WINPR_JSON_AddStringToObject(WINPR_JSON* object, const char* name, + const char* string); + WINPR_API WINPR_JSON* WINPR_JSON_AddObjectToObject(WINPR_JSON* object, const char* name); + WINPR_API WINPR_JSON* WINPR_JSON_AddArrayToObject(WINPR_JSON* object, const char* name); WINPR_API BOOL WINPR_JSON_AddItemToArray(WINPR_JSON* array, WINPR_JSON* item); diff --git a/winpr/include/winpr/strlst.h b/winpr/include/winpr/strlst.h index 346946da1..4e49d8b72 100644 --- a/winpr/include/winpr/strlst.h +++ b/winpr/include/winpr/strlst.h @@ -30,9 +30,9 @@ extern "C" #endif WINPR_API void string_list_free(char** string_list); - WINPR_API int string_list_length(const char* const* string_list); - WINPR_API char** string_list_copy(const char* const* string_list); - WINPR_API void string_list_print(FILE* out, const char* const* string_list); + WINPR_API int string_list_length(const char** string_list); + WINPR_API char** string_list_copy(const char** string_list); + WINPR_API void string_list_print(FILE* out, const char** string_list); #ifdef __cplusplus } diff --git a/winpr/libwinpr/comm/comm_ioctl.c b/winpr/libwinpr/comm/comm_ioctl.c index ff408a309..7932ce4b1 100644 --- a/winpr/libwinpr/comm/comm_ioctl.c +++ b/winpr/libwinpr/comm/comm_ioctl.c @@ -106,7 +106,7 @@ const char* _comm_serial_ioctl_name(ULONG number) { for (size_t x = 0; x < ARRAYSIZE(S_SERIAL_IOCTL_NAMES); x++) { - const _SERIAL_IOCTL_NAME* const cur = &S_SERIAL_IOCTL_NAMES[x]; + const _SERIAL_IOCTL_NAME* cur = &S_SERIAL_IOCTL_NAMES[x]; if (cur->number == number) return cur->name; } diff --git a/winpr/libwinpr/sspi/sspi_winpr.c b/winpr/libwinpr/sspi/sspi_winpr.c index 3b291e4a8..3c82b0dab 100644 --- a/winpr/libwinpr/sspi/sspi_winpr.c +++ b/winpr/libwinpr/sspi/sspi_winpr.c @@ -953,7 +953,7 @@ static BOOL WINPR_init(void) for (size_t x = 0; x < ARRAYSIZE(SecurityFunctionTableA_NAME_LIST); x++) { - const SecurityFunctionTableA_NAME* const cur = &SecurityFunctionTableA_NAME_LIST[x]; + const SecurityFunctionTableA_NAME* cur = &SecurityFunctionTableA_NAME_LIST[x]; InitializeConstWCharFromUtf8(cur->Name, BUFFER_NAME_LIST_W[x], ARRAYSIZE(BUFFER_NAME_LIST_W[x])); } diff --git a/winpr/libwinpr/utils/json/json.c b/winpr/libwinpr/utils/json/json.c index c8cf36c70..81eec9718 100644 --- a/winpr/libwinpr/utils/json/json.c +++ b/winpr/libwinpr/utils/json/json.c @@ -52,7 +52,7 @@ static struct json_object* json_object_new_null(void) #endif #if defined(USE_CJSON_COMPAT) -static double cJSON_GetNumberValue(const cJSON* const prop) +static double cJSON_GetNumberValue(const cJSON* prop) { #ifndef NAN #ifdef _WIN32 @@ -110,7 +110,7 @@ int WINPR_JSON_version(char* buffer, size_t len) #endif } -WINPR_JSON* WINPR_JSON_Parse(const char* const value) +WINPR_JSON* WINPR_JSON_Parse(const char* value) { #if defined(WITH_JSONC) return json_tokener_parse(value); @@ -122,7 +122,7 @@ WINPR_JSON* WINPR_JSON_Parse(const char* const value) #endif } -WINPR_JSON* WINPR_JSON_ParseWithLength(const char* const value, size_t buffer_length) +WINPR_JSON* WINPR_JSON_ParseWithLength(const char* value, size_t buffer_length) { #if defined(WITH_JSONC) WINPR_ASSERT(buffer_length <= INT_MAX); @@ -152,7 +152,7 @@ void WINPR_JSON_Delete(WINPR_JSON* item) #endif } -WINPR_JSON* WINPR_JSON_GetArrayItem(const WINPR_JSON* const array, size_t index) +WINPR_JSON* WINPR_JSON_GetArrayItem(const WINPR_JSON* array, size_t index) { #if defined(WITH_JSONC) return json_object_array_get_idx((const json_object*)array, index); @@ -166,7 +166,7 @@ WINPR_JSON* WINPR_JSON_GetArrayItem(const WINPR_JSON* const array, size_t index) #endif } -size_t WINPR_JSON_GetArraySize(const WINPR_JSON* const array) +size_t WINPR_JSON_GetArraySize(const WINPR_JSON* array) { #if defined(WITH_JSONC) return json_object_array_length((const json_object*)array); @@ -181,7 +181,7 @@ size_t WINPR_JSON_GetArraySize(const WINPR_JSON* const array) #endif } -WINPR_JSON* WINPR_JSON_GetObjectItem(const WINPR_JSON* const object, const char* const string) +WINPR_JSON* WINPR_JSON_GetObjectItem(const WINPR_JSON* object, const char* string) { #if defined(WITH_JSONC) return json_object_object_get((const json_object*)object, string); @@ -194,8 +194,7 @@ WINPR_JSON* WINPR_JSON_GetObjectItem(const WINPR_JSON* const object, const char* #endif } -WINPR_JSON* WINPR_JSON_GetObjectItemCaseSensitive(const WINPR_JSON* const object, - const char* const string) +WINPR_JSON* WINPR_JSON_GetObjectItemCaseSensitive(const WINPR_JSON* object, const char* string) { #if defined(WITH_JSONC) return json_object_object_get((const json_object*)object, string); @@ -208,7 +207,7 @@ WINPR_JSON* WINPR_JSON_GetObjectItemCaseSensitive(const WINPR_JSON* const object #endif } -BOOL WINPR_JSON_HasObjectItem(const WINPR_JSON* const object, const char* const string) +BOOL WINPR_JSON_HasObjectItem(const WINPR_JSON* object, const char* string) { #if defined(WITH_JSONC) return json_object_object_get_ex((const json_object*)object, string, NULL); @@ -244,7 +243,7 @@ const char* WINPR_JSON_GetStringValue(WINPR_JSON* item) #endif } -double WINPR_JSON_GetNumberValue(const WINPR_JSON* const item) +double WINPR_JSON_GetNumberValue(const WINPR_JSON* item) { #if defined(WITH_JSONC) return json_object_get_double((const json_object*)item); @@ -256,7 +255,7 @@ double WINPR_JSON_GetNumberValue(const WINPR_JSON* const item) #endif } -BOOL WINPR_JSON_IsInvalid(const WINPR_JSON* const item) +BOOL WINPR_JSON_IsInvalid(const WINPR_JSON* item) { #if defined(WITH_JSONC) if (WINPR_JSON_IsArray(item)) @@ -280,7 +279,7 @@ BOOL WINPR_JSON_IsInvalid(const WINPR_JSON* const item) #endif } -BOOL WINPR_JSON_IsFalse(const WINPR_JSON* const item) +BOOL WINPR_JSON_IsFalse(const WINPR_JSON* item) { #if defined(WITH_JSONC) if (!json_object_is_type((const json_object*)item, json_type_boolean)) @@ -295,7 +294,7 @@ BOOL WINPR_JSON_IsFalse(const WINPR_JSON* const item) #endif } -BOOL WINPR_JSON_IsTrue(const WINPR_JSON* const item) +BOOL WINPR_JSON_IsTrue(const WINPR_JSON* item) { #if defined(WITH_JSONC) if (!json_object_is_type((const json_object*)item, json_type_boolean)) @@ -310,7 +309,7 @@ BOOL WINPR_JSON_IsTrue(const WINPR_JSON* const item) #endif } -BOOL WINPR_JSON_IsBool(const WINPR_JSON* const item) +BOOL WINPR_JSON_IsBool(const WINPR_JSON* item) { #if defined(WITH_JSONC) return json_object_is_type((const json_object*)item, json_type_boolean); @@ -322,7 +321,7 @@ BOOL WINPR_JSON_IsBool(const WINPR_JSON* const item) #endif } -BOOL WINPR_JSON_IsNull(const WINPR_JSON* const item) +BOOL WINPR_JSON_IsNull(const WINPR_JSON* item) { #if defined(WITH_JSONC) return json_object_is_type((const json_object*)item, json_type_null); @@ -334,7 +333,7 @@ BOOL WINPR_JSON_IsNull(const WINPR_JSON* const item) #endif } -BOOL WINPR_JSON_IsNumber(const WINPR_JSON* const item) +BOOL WINPR_JSON_IsNumber(const WINPR_JSON* item) { #if defined(WITH_JSONC) return json_object_is_type((const json_object*)item, json_type_int) || @@ -347,7 +346,7 @@ BOOL WINPR_JSON_IsNumber(const WINPR_JSON* const item) #endif } -BOOL WINPR_JSON_IsString(const WINPR_JSON* const item) +BOOL WINPR_JSON_IsString(const WINPR_JSON* item) { #if defined(WITH_JSONC) return json_object_is_type((const json_object*)item, json_type_string); @@ -359,7 +358,7 @@ BOOL WINPR_JSON_IsString(const WINPR_JSON* const item) #endif } -BOOL WINPR_JSON_IsArray(const WINPR_JSON* const item) +BOOL WINPR_JSON_IsArray(const WINPR_JSON* item) { #if defined(WITH_JSONC) return json_object_is_type((const json_object*)item, json_type_array); @@ -371,7 +370,7 @@ BOOL WINPR_JSON_IsArray(const WINPR_JSON* const item) #endif } -BOOL WINPR_JSON_IsObject(const WINPR_JSON* const item) +BOOL WINPR_JSON_IsObject(const WINPR_JSON* item) { #if defined(WITH_JSONC) return json_object_is_type((const json_object*)item, json_type_object); @@ -440,7 +439,7 @@ WINPR_JSON* WINPR_JSON_CreateNumber(double num) #endif } -WINPR_JSON* WINPR_JSON_CreateString(const char* const string) +WINPR_JSON* WINPR_JSON_CreateString(const char* string) { #if defined(WITH_JSONC) return json_object_new_string(string); @@ -474,7 +473,7 @@ WINPR_JSON* WINPR_JSON_CreateObject(void) #endif } -WINPR_JSON* WINPR_JSON_AddNullToObject(WINPR_JSON* const object, const char* const name) +WINPR_JSON* WINPR_JSON_AddNullToObject(WINPR_JSON* object, const char* name) { #if defined(WITH_JSONC) struct json_object* obj = json_object_new_null(); @@ -493,7 +492,7 @@ WINPR_JSON* WINPR_JSON_AddNullToObject(WINPR_JSON* const object, const char* con #endif } -WINPR_JSON* WINPR_JSON_AddTrueToObject(WINPR_JSON* const object, const char* const name) +WINPR_JSON* WINPR_JSON_AddTrueToObject(WINPR_JSON* object, const char* name) { #if defined(WITH_JSONC) struct json_object* obj = json_object_new_boolean(TRUE); @@ -512,7 +511,7 @@ WINPR_JSON* WINPR_JSON_AddTrueToObject(WINPR_JSON* const object, const char* con #endif } -WINPR_JSON* WINPR_JSON_AddFalseToObject(WINPR_JSON* const object, const char* const name) +WINPR_JSON* WINPR_JSON_AddFalseToObject(WINPR_JSON* object, const char* name) { #if defined(WITH_JSONC) struct json_object* obj = json_object_new_boolean(FALSE); @@ -531,8 +530,7 @@ WINPR_JSON* WINPR_JSON_AddFalseToObject(WINPR_JSON* const object, const char* co #endif } -WINPR_JSON* WINPR_JSON_AddBoolToObject(WINPR_JSON* const object, const char* const name, - BOOL boolean) +WINPR_JSON* WINPR_JSON_AddBoolToObject(WINPR_JSON* object, const char* name, BOOL boolean) { #if defined(WITH_JSONC) struct json_object* obj = json_object_new_boolean(boolean); @@ -552,8 +550,7 @@ WINPR_JSON* WINPR_JSON_AddBoolToObject(WINPR_JSON* const object, const char* con #endif } -WINPR_JSON* WINPR_JSON_AddNumberToObject(WINPR_JSON* const object, const char* const name, - double number) +WINPR_JSON* WINPR_JSON_AddNumberToObject(WINPR_JSON* object, const char* name, double number) { #if defined(WITH_JSONC) struct json_object* obj = json_object_new_double(number); @@ -573,8 +570,7 @@ WINPR_JSON* WINPR_JSON_AddNumberToObject(WINPR_JSON* const object, const char* c #endif } -WINPR_JSON* WINPR_JSON_AddStringToObject(WINPR_JSON* const object, const char* const name, - const char* const string) +WINPR_JSON* WINPR_JSON_AddStringToObject(WINPR_JSON* object, const char* name, const char* string) { #if defined(WITH_JSONC) struct json_object* obj = json_object_new_string(string); @@ -594,7 +590,7 @@ WINPR_JSON* WINPR_JSON_AddStringToObject(WINPR_JSON* const object, const char* c #endif } -WINPR_JSON* WINPR_JSON_AddObjectToObject(WINPR_JSON* const object, const char* const name) +WINPR_JSON* WINPR_JSON_AddObjectToObject(WINPR_JSON* object, const char* name) { #if defined(WITH_JSONC) struct json_object* obj = json_object_new_object(); @@ -629,7 +625,7 @@ BOOL WINPR_JSON_AddItemToArray(WINPR_JSON* array, WINPR_JSON* item) #endif } -WINPR_JSON* WINPR_JSON_AddArrayToObject(WINPR_JSON* const object, const char* const name) +WINPR_JSON* WINPR_JSON_AddArrayToObject(WINPR_JSON* object, const char* name) { #if defined(WITH_JSONC) struct json_object* obj = json_object_new_array(); diff --git a/winpr/libwinpr/utils/strlst.c b/winpr/libwinpr/utils/strlst.c index 48112443c..c1303b4cf 100644 --- a/winpr/libwinpr/utils/strlst.c +++ b/winpr/libwinpr/utils/strlst.c @@ -35,7 +35,7 @@ void string_list_free(char** string_list) free(string_list); } -int string_list_length(const char* const* string_list) +int string_list_length(const char** string_list) { int i = 0; for (; string_list[i]; i++) @@ -44,7 +44,7 @@ int string_list_length(const char* const* string_list) return i; } -char** string_list_copy(const char* const* string_list) +char** string_list_copy(const char** string_list) { int length = string_list_length(string_list); char** copy = calloc(length + 1, sizeof(char*)); @@ -63,7 +63,7 @@ char** string_list_copy(const char* const* string_list) return copy; } -void string_list_print(FILE* out, const char* const* string_list) +void string_list_print(FILE* out, const char** string_list) { for (int j = 0; string_list[j]; j++) {