[winpr] add WINPR_C_ARRAY_INIT

since C23 allows c++ style initializing replace direct use with this
macro
This commit is contained in:
Armin Novak
2026-02-24 20:18:25 +01:00
parent a5609b929e
commit 48267edf2f
434 changed files with 2204 additions and 2195 deletions

View File

@@ -50,13 +50,13 @@ static void primitives_YUV_benchmark_free(primitives_YUV_benchmark* bench)
free(bench->channels[i]);
}
const primitives_YUV_benchmark empty = { 0 };
const primitives_YUV_benchmark empty = WINPR_C_ARRAY_INIT;
*bench = empty;
}
static primitives_YUV_benchmark primitives_YUV_benchmark_init(void)
{
primitives_YUV_benchmark ret = { 0 };
primitives_YUV_benchmark ret = WINPR_C_ARRAY_INIT;
ret.roi.width = 3840 * 4;
ret.roi.height = 2160 * 4;
ret.outputStride = ret.roi.width * 4;
@@ -98,7 +98,7 @@ static const char* print_time(UINT64 t, char* buffer, size_t size)
static BOOL primitives_YUV420_benchmark_run(primitives_YUV_benchmark* bench, primitives_t* prims)
{
const BYTE* channels[3] = { 0 };
const BYTE* channels[3] = WINPR_C_ARRAY_INIT;
for (size_t i = 0; i < 3; i++)
channels[i] = bench->channels[i];
@@ -116,7 +116,7 @@ static BOOL primitives_YUV420_benchmark_run(primitives_YUV_benchmark* bench, pri
return FALSE;
}
const UINT64 diff = end - start;
char buffer[32] = { 0 };
char buffer[32] = WINPR_C_ARRAY_INIT;
printf("[%" PRIuz "] YUV420ToRGB_8u_P3AC4R %" PRIu32 "x%" PRIu32 " took %sns\n", x,
bench->roi.width, bench->roi.height, print_time(diff, buffer, sizeof(buffer)));
}
@@ -126,7 +126,7 @@ static BOOL primitives_YUV420_benchmark_run(primitives_YUV_benchmark* bench, pri
static BOOL primitives_YUV444_benchmark_run(primitives_YUV_benchmark* bench, primitives_t* prims)
{
const BYTE* channels[3] = { 0 };
const BYTE* channels[3] = WINPR_C_ARRAY_INIT;
for (size_t i = 0; i < 3; i++)
channels[i] = bench->channels[i];
@@ -144,7 +144,7 @@ static BOOL primitives_YUV444_benchmark_run(primitives_YUV_benchmark* bench, pri
return FALSE;
}
const UINT64 diff = end - start;
char buffer[32] = { 0 };
char buffer[32] = WINPR_C_ARRAY_INIT;
printf("[%" PRIuz "] YUV444ToRGB_8u_P3AC4R %" PRIu32 "x%" PRIu32 " took %sns\n", x,
bench->roi.width, bench->roi.height, print_time(diff, buffer, sizeof(buffer)));
}
@@ -167,7 +167,7 @@ static BOOL primitives_RGB2420_benchmark_run(primitives_YUV_benchmark* bench, pr
return FALSE;
}
const UINT64 diff = end - start;
char buffer[32] = { 0 };
char buffer[32] = WINPR_C_ARRAY_INIT;
printf("[%" PRIuz "] RGBToYUV420_8u_P3AC4R %" PRIu32 "x%" PRIu32 " took %sns\n", x,
bench->roi.width, bench->roi.height, print_time(diff, buffer, sizeof(buffer)));
}
@@ -190,7 +190,7 @@ static BOOL primitives_RGB2444_benchmark_run(primitives_YUV_benchmark* bench, pr
return FALSE;
}
const UINT64 diff = end - start;
char buffer[32] = { 0 };
char buffer[32] = WINPR_C_ARRAY_INIT;
printf("[%" PRIuz "] RGBToYUV444_8u_P3AC4R %" PRIu32 "x%" PRIu32 " took %sns\n", x,
bench->roi.width, bench->roi.height, print_time(diff, buffer, sizeof(buffer)));
}

View File

@@ -184,7 +184,7 @@ static BOOL cl_kernel_process(primitives_cl_kernel* ctx, BYTE* pDst)
WINPR_ASSERT(ctx);
WINPR_ASSERT(pDst);
size_t indexes[2] = { 0 };
size_t indexes[2] = WINPR_C_ARRAY_INIT;
indexes[0] = ctx->roi.width;
indexes[1] = ctx->roi.height;
@@ -234,7 +234,7 @@ fail:
return res;
}
static primitives_opencl_context openclContext = { 0 };
static primitives_opencl_context openclContext = WINPR_C_ARRAY_INIT;
static primitives_opencl_context* primitives_get_opencl_context(void)
{
@@ -289,8 +289,8 @@ static BOOL primitives_init_opencl_context(primitives_opencl_context* WINPR_REST
{
cl_device_id device_id = NULL;
cl_context context = NULL;
char platformName[1000] = { 0 };
char deviceName[1000] = { 0 };
char platformName[1000] = WINPR_C_ARRAY_INIT;
char deviceName[1000] = WINPR_C_ARRAY_INIT;
ret = clGetPlatformInfo(platform_ids[i], CL_PLATFORM_NAME, sizeof(platformName),
platformName, NULL);

View File

@@ -46,23 +46,23 @@ primitive_hints primitives_get_hints(void)
}
/* Singleton pointer used throughout the program when requested. */
static primitives_t pPrimitivesGeneric = { 0 };
static primitives_t pPrimitivesGeneric = WINPR_C_ARRAY_INIT;
static INIT_ONCE generic_primitives_InitOnce = INIT_ONCE_STATIC_INIT;
#if defined(HAVE_CPU_OPTIMIZED_PRIMITIVES)
static primitives_t pPrimitivesCpu = { 0 };
static primitives_t pPrimitivesCpu = WINPR_C_ARRAY_INIT;
static INIT_ONCE cpu_primitives_InitOnce = INIT_ONCE_STATIC_INIT;
#endif
#if defined(WITH_OPENCL)
static primitives_t pPrimitivesGpu = { 0 };
static primitives_t pPrimitivesGpu = WINPR_C_ARRAY_INIT;
static INIT_ONCE gpu_primitives_InitOnce = INIT_ONCE_STATIC_INIT;
#endif
static INIT_ONCE auto_primitives_InitOnce = INIT_ONCE_STATIC_INIT;
static primitives_t pPrimitives = { 0 };
static primitives_t pPrimitives = WINPR_C_ARRAY_INIT;
/* ------------------------------------------------------------------------- */
static BOOL primitives_init_generic(primitives_t* prims)
@@ -170,7 +170,7 @@ static BOOL primitives_YUV_benchmark_run(primitives_YUV_benchmark* bench, primit
UINT64 runTime, UINT32* computations)
{
ULONGLONG dueDate = 0;
const BYTE* channels[3] = { 0 };
const BYTE* channels[3] = WINPR_C_ARRAY_INIT;
pstatus_t status = 0;
*computations = 0;
@@ -241,7 +241,7 @@ static BOOL primitives_autodetect_best(primitives_t* prims)
#else
{
UINT64 benchDuration = 150; /* 150 ms */
primitives_YUV_benchmark bench = { 0 };
primitives_YUV_benchmark bench = WINPR_C_ARRAY_INIT;
primitives_YUV_benchmark* yuvBench = primitives_YUV_benchmark_init(&bench);
if (!yuvBench)
return FALSE;

View File

@@ -711,8 +711,8 @@ static inline void sse41_RGBToYUV420_BGRX_UV(const BYTE* WINPR_RESTRICT src1,
for (; x < width - width % 2; x += 2)
{
BYTE u[4] = { 0 };
BYTE v[4] = { 0 };
BYTE u[4] = WINPR_C_ARRAY_INIT;
BYTE v[4] = WINPR_C_ARRAY_INIT;
sse41_BGRX_TO_YUV(&src1[4ULL * x], NULL, &u[0], &v[0]);
sse41_BGRX_TO_YUV(&src1[4ULL * (1ULL + x)], NULL, &u[1], &v[1]);
sse41_BGRX_TO_YUV(&src2[4ULL * x], NULL, &u[2], &v[2]);
@@ -841,7 +841,7 @@ static inline void sse41_RGBToAVC444YUV_BGRX_DOUBLE_ROW(
* We need to split these according to
* 3.3.8.3.2 YUV420p Stream Combination for YUV444 mode */
__m128i ue;
__m128i uo = { 0 };
__m128i uo = WINPR_C_ARRAY_INIT;
{
const __m128i ue1 =
_mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, u_factors),
@@ -919,7 +919,7 @@ static inline void sse41_RGBToAVC444YUV_BGRX_DOUBLE_ROW(
* We need to split these according to
* 3.3.8.3.2 YUV420p Stream Combination for YUV444 mode */
__m128i ve;
__m128i vo = { 0 };
__m128i vo = WINPR_C_ARRAY_INIT;
{
const __m128i ve1 =
_mm_srai_epi16(_mm_hadd_epi16(_mm_maddubs_epi16(xe1, v_factors),

View File

@@ -23,10 +23,10 @@ static BOOL test_add16s_func(void)
{
pstatus_t status = 0;
INT16 ALIGN(src1[FUNC_TEST_SIZE + 3]) = { 0 };
INT16 ALIGN(src2[FUNC_TEST_SIZE + 3]) = { 0 };
INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]) = { 0 };
INT16 ALIGN(d2[FUNC_TEST_SIZE + 3]) = { 0 };
INT16 ALIGN(src1[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(src2[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(d2[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
winpr_RAND(src1, sizeof(src1));
winpr_RAND(src2, sizeof(src2));

View File

@@ -117,9 +117,9 @@ static BOOL check(const BYTE* pSrc1, UINT32 src1Step, const BYTE* pSrc2, UINT32
static BOOL test_alphaComp_func(void)
{
pstatus_t status = 0;
BYTE ALIGN(src1[SRC1_WIDTH * SRC1_HEIGHT * 4]) = { 0 };
BYTE ALIGN(src2[SRC2_WIDTH * SRC2_HEIGHT * 4]) = { 0 };
BYTE ALIGN(dst1[DST_WIDTH * DST_HEIGHT * 4]) = { 0 };
BYTE ALIGN(src1[SRC1_WIDTH * SRC1_HEIGHT * 4]) = WINPR_C_ARRAY_INIT;
BYTE ALIGN(src2[SRC2_WIDTH * SRC2_HEIGHT * 4]) = WINPR_C_ARRAY_INIT;
BYTE ALIGN(dst1[DST_WIDTH * DST_HEIGHT * 4]) = WINPR_C_ARRAY_INIT;
UINT32* ptr = NULL;
winpr_RAND(src1, sizeof(src1));
/* Special-case the first two values */
@@ -158,9 +158,9 @@ static BOOL test_alphaComp_func(void)
static int test_alphaComp_speed(void)
{
BYTE ALIGN(src1[SRC1_WIDTH * SRC1_HEIGHT]) = { 0 };
BYTE ALIGN(src2[SRC2_WIDTH * SRC2_HEIGHT]) = { 0 };
BYTE ALIGN(dst1[DST_WIDTH * DST_HEIGHT]) = { 0 };
BYTE ALIGN(src1[SRC1_WIDTH * SRC1_HEIGHT]) = WINPR_C_ARRAY_INIT;
BYTE ALIGN(src2[SRC2_WIDTH * SRC2_HEIGHT]) = WINPR_C_ARRAY_INIT;
BYTE ALIGN(dst1[DST_WIDTH * DST_HEIGHT]) = WINPR_C_ARRAY_INIT;
UINT32* ptr = NULL;
winpr_RAND(src1, sizeof(src1));

View File

@@ -48,8 +48,8 @@ static BOOL test_and_32u_impl(const char* name, fn_andC_32u_t fkt, const UINT32*
static BOOL test_and_32u_func(void)
{
UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]) = { 0 };
UINT32 ALIGN(dst[FUNC_TEST_SIZE + 3]) = { 0 };
UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
UINT32 ALIGN(dst[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
winpr_RAND(src, sizeof(src));
@@ -72,8 +72,8 @@ static BOOL test_and_32u_func(void)
/* ------------------------------------------------------------------------- */
static BOOL test_and_32u_speed(void)
{
UINT32 ALIGN(src[MAX_TEST_SIZE + 3]) = { 0 };
UINT32 ALIGN(dst[MAX_TEST_SIZE + 3]) = { 0 };
UINT32 ALIGN(src[MAX_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
UINT32 ALIGN(dst[MAX_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
winpr_RAND(src, sizeof(src));
@@ -107,8 +107,8 @@ static BOOL check(const UINT32* src, const UINT32* dst, UINT32 size, UINT32 valu
static BOOL test_or_32u_func(void)
{
pstatus_t status = 0;
UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]) = { 0 };
UINT32 ALIGN(dst[FUNC_TEST_SIZE + 3]) = { 0 };
UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
UINT32 ALIGN(dst[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
winpr_RAND(src, sizeof(src));
@@ -132,8 +132,8 @@ static BOOL test_or_32u_func(void)
/* ------------------------------------------------------------------------- */
static BOOL test_or_32u_speed(void)
{
UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]) = { 0 };
UINT32 ALIGN(dst[FUNC_TEST_SIZE + 3]) = { 0 };
UINT32 ALIGN(src[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
UINT32 ALIGN(dst[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
winpr_RAND(src, sizeof(src));

View File

@@ -149,15 +149,15 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_speed(void)
static BOOL test_yCbCrToRGB_16s16s_P3P3_func(void)
{
pstatus_t status = 0;
INT16 ALIGN(y[4096]) = { 0 };
INT16 ALIGN(cb[4096]) = { 0 };
INT16 ALIGN(cr[4096]) = { 0 };
INT16 ALIGN(r1[4096]) = { 0 };
INT16 ALIGN(g1[4096]) = { 0 };
INT16 ALIGN(b1[4096]) = { 0 };
INT16 ALIGN(r2[4096]) = { 0 };
INT16 ALIGN(g2[4096]) = { 0 };
INT16 ALIGN(b2[4096]) = { 0 };
INT16 ALIGN(y[4096]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(cb[4096]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(cr[4096]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(r1[4096]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(g1[4096]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(b1[4096]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(r2[4096]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(g2[4096]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(b2[4096]) = WINPR_C_ARRAY_INIT;
const INT16* in[3];
INT16* out1[3];
INT16* out2[3];

View File

@@ -26,7 +26,7 @@
static BOOL test_copy8u_func(void)
{
primitives_t* prims = primitives_get();
BYTE ALIGN(data[COPY_TESTSIZE + 15]) = { 0 };
BYTE ALIGN(data[COPY_TESTSIZE + 15]) = WINPR_C_ARRAY_INIT;
winpr_RAND(data, sizeof(data));
for (int soff = 0; soff < 16; ++soff)
@@ -35,7 +35,7 @@ static BOOL test_copy8u_func(void)
{
for (int length = 1; length <= COPY_TESTSIZE - doff; ++length)
{
BYTE ALIGN(dest[COPY_TESTSIZE + 15]) = { 0 };
BYTE ALIGN(dest[COPY_TESTSIZE + 15]) = WINPR_C_ARRAY_INIT;
if (prims->copy_8u(data + soff, dest + doff, length) != PRIMITIVES_SUCCESS)
return FALSE;

View File

@@ -117,7 +117,7 @@ static BOOL test_set32s_func(void)
for (UINT32 off = 0; off < 16; ++off)
{
INT32 dest[1024] = { 0 };
INT32 dest[1024] = WINPR_C_ARRAY_INIT;
for (UINT32 len = 1; len < 48 - off; ++len)
{
@@ -133,7 +133,7 @@ static BOOL test_set32s_func(void)
for (UINT32 off = 0; off < 16; ++off)
{
INT32 dest[1024] = { 0 };
INT32 dest[1024] = WINPR_C_ARRAY_INIT;
for (UINT32 len = 1; len < 48 - off; ++len)
{
@@ -174,7 +174,7 @@ static BOOL test_set32u_func(void)
for (UINT32 off = 0; off < 16; ++off)
{
UINT32 dest[1024] = { 0 };
UINT32 dest[1024] = WINPR_C_ARRAY_INIT;
for (UINT32 len = 1; len < 48 - off; ++len)
{
@@ -190,7 +190,7 @@ static BOOL test_set32u_func(void)
for (UINT32 off = 0; off < 16; ++off)
{
UINT32 dest[1024] = { 0 };
UINT32 dest[1024] = WINPR_C_ARRAY_INIT;
for (UINT32 len = 1; len < 48 - off; ++len)
{

View File

@@ -204,8 +204,8 @@ static BOOL test_rShift_16u_func(void)
static BOOL test_ShiftWrapper_16s_func(void)
{
pstatus_t status = 0;
INT16 ALIGN(src[FUNC_TEST_SIZE + 3]) = { 0 };
INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]) = { 0 };
INT16 ALIGN(src[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
UINT32 tmp = 0;
winpr_RAND(&tmp, sizeof(tmp));
winpr_RAND(src, sizeof(src));
@@ -270,8 +270,8 @@ static BOOL test_ShiftWrapper_16s_func(void)
static BOOL test_ShiftWrapper_16u_func(void)
{
pstatus_t status = 0;
UINT16 ALIGN(src[FUNC_TEST_SIZE + 3]) = { 0 };
UINT16 ALIGN(d1[FUNC_TEST_SIZE + 3]) = { 0 };
UINT16 ALIGN(src[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
UINT16 ALIGN(d1[FUNC_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
UINT32 tmp = 0;
winpr_RAND(&tmp, sizeof(tmp));
winpr_RAND(src, sizeof(src));

View File

@@ -23,9 +23,9 @@
static BOOL test_sign16s_func(void)
{
pstatus_t status = 0;
INT16 ALIGN(src[TEST_BUFFER_SIZE + 16]) = { 0 };
INT16 ALIGN(d1[TEST_BUFFER_SIZE + 16]) = { 0 };
INT16 ALIGN(d2[TEST_BUFFER_SIZE + 16]) = { 0 };
INT16 ALIGN(src[TEST_BUFFER_SIZE + 16]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(d1[TEST_BUFFER_SIZE + 16]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(d2[TEST_BUFFER_SIZE + 16]) = WINPR_C_ARRAY_INIT;
winpr_RAND(src, sizeof(src));
status = generic->sign_16s(src + 1, d1 + 1, TEST_BUFFER_SIZE);
@@ -58,8 +58,8 @@ static BOOL test_sign16s_func(void)
static int test_sign16s_speed(void)
{
INT16 ALIGN(src[MAX_TEST_SIZE + 3]) = { 0 };
INT16 ALIGN(dst[MAX_TEST_SIZE + 3]) = { 0 };
INT16 ALIGN(src[MAX_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
INT16 ALIGN(dst[MAX_TEST_SIZE + 3]) = WINPR_C_ARRAY_INIT;
winpr_RAND(src, sizeof(src));
if (!speed_test("sign16s", "aligned", g_Iterations, (speed_test_fkt)generic->sign_16s,

View File

@@ -1515,7 +1515,7 @@ static int test_bmp_cmp_count(const BYTE* mem1, const BYTE* mem2, size_t size, i
static int test_bmp_cmp_dump(const BYTE* actual, const BYTE* expected, size_t size, int channel,
int margin)
{
int error[3] = { 0 };
int error[3] = WINPR_C_ARRAY_INIT;
int count = 0;
size /= 4;
actual += channel;

View File

@@ -226,16 +226,16 @@ static BOOL TestPrimitiveYUVCombine(primitives_t* prims, prim_size_t roi)
size_t awidth = 0;
size_t aheight = 0;
BOOL rc = FALSE;
BYTE* luma[3] = { 0 };
BYTE* chroma[3] = { 0 };
BYTE* yuv[3] = { 0 };
BYTE* pmain[3] = { 0 };
BYTE* paux[3] = { 0 };
UINT32 lumaStride[3] = { 0 };
UINT32 chromaStride[3] = { 0 };
UINT32 yuvStride[3] = { 0 };
BYTE* luma[3] = WINPR_C_ARRAY_INIT;
BYTE* chroma[3] = WINPR_C_ARRAY_INIT;
BYTE* yuv[3] = WINPR_C_ARRAY_INIT;
BYTE* pmain[3] = WINPR_C_ARRAY_INIT;
BYTE* paux[3] = WINPR_C_ARRAY_INIT;
UINT32 lumaStride[3] = WINPR_C_ARRAY_INIT;
UINT32 chromaStride[3] = WINPR_C_ARRAY_INIT;
UINT32 yuvStride[3] = WINPR_C_ARRAY_INIT;
const size_t padding = 10000;
RECTANGLE_16 rect = { 0 };
RECTANGLE_16 rect = WINPR_C_ARRAY_INIT;
PROFILER_DEFINE(yuvCombine)
PROFILER_DEFINE(yuvSplit)
@@ -438,8 +438,8 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444)
BOOL res = FALSE;
UINT32 awidth = 0;
UINT32 aheight = 0;
BYTE* yuv[3] = { 0 };
UINT32 yuv_step[3] = { 0 };
BYTE* yuv[3] = WINPR_C_ARRAY_INIT;
UINT32 yuv_step[3] = WINPR_C_ARRAY_INIT;
BYTE* rgb = NULL;
BYTE* rgb_dst = NULL;
size_t size = 0;
@@ -741,10 +741,10 @@ static BOOL TestPrimitiveRgbToLumaChroma(primitives_t* prims, prim_size_t roi, U
BOOL res = FALSE;
UINT32 awidth = 0;
UINT32 aheight = 0;
BYTE* luma[3] = { 0 };
BYTE* chroma[3] = { 0 };
BYTE* lumaGeneric[3] = { 0 };
BYTE* chromaGeneric[3] = { 0 };
BYTE* luma[3] = WINPR_C_ARRAY_INIT;
BYTE* chroma[3] = WINPR_C_ARRAY_INIT;
BYTE* lumaGeneric[3] = WINPR_C_ARRAY_INIT;
BYTE* chromaGeneric[3] = WINPR_C_ARRAY_INIT;
UINT32 yuv_step[3];
BYTE* rgb = NULL;
size_t size = 0;
@@ -1023,7 +1023,7 @@ static BOOL compare_yuv444_to_rgb(prim_size_t roi, DWORD type)
{
BOOL rc = FALSE;
const UINT32 format = PIXEL_FORMAT_BGRA32;
BYTE* yuv[3] = { 0 };
BYTE* yuv[3] = WINPR_C_ARRAY_INIT;
const UINT32 yuvStep[3] = { roi.width, roi.width, roi.width };
const size_t stride = 4ULL * roi.width;
@@ -1131,8 +1131,8 @@ static BOOL compare_rgb_to_yuv444(prim_size_t roi, DWORD type)
const UINT32 format = PIXEL_FORMAT_BGRA32;
const size_t stride = 4ULL * roi.width;
const UINT32 yuvStep[] = { roi.width, roi.width, roi.width };
BYTE* yuv1[3] = { 0 };
BYTE* yuv2[3] = { 0 };
BYTE* yuv1[3] = WINPR_C_ARRAY_INIT;
BYTE* yuv2[3] = WINPR_C_ARRAY_INIT;
primitives_t* prims = primitives_get_by_type(type);
if (!prims)
@@ -1196,7 +1196,7 @@ static BOOL compare_yuv420_to_rgb(prim_size_t roi, DWORD type)
{
BOOL rc = FALSE;
const UINT32 format = PIXEL_FORMAT_BGRA32;
BYTE* yuv[3] = { 0 };
BYTE* yuv[3] = WINPR_C_ARRAY_INIT;
const UINT32 yuvStep[3] = { roi.width, roi.width / 2, roi.width / 2 };
const size_t stride = 4ULL * roi.width;
@@ -1328,8 +1328,8 @@ static BOOL compare_rgb_to_yuv420(prim_size_t roi, DWORD type)
const UINT32 format = PIXEL_FORMAT_BGRA32;
const size_t stride = 4ULL * roi.width;
const UINT32 yuvStep[] = { roi.width, roi.width / 2, roi.width / 2 };
BYTE* yuv1[3] = { 0 };
BYTE* yuv2[3] = { 0 };
BYTE* yuv1[3] = WINPR_C_ARRAY_INIT;
BYTE* yuv2[3] = WINPR_C_ARRAY_INIT;
primitives_t* prims = primitives_get_by_type(type);
if (!prims)
@@ -1410,7 +1410,7 @@ int TestPrimitivesYUV(int argc, char* argv[])
int rc = -1;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
prim_size_t roi = { 0 };
prim_size_t roi = WINPR_C_ARRAY_INIT;
if (argc > 1)
{

View File

@@ -77,8 +77,8 @@ extern void measure_floatprint(float t, char* output, size_t len);
{ \
int _count = (_count_); \
int _loop; \
char str1[32] = { 0 }; \
char str2[32] = { 0 }; \
char str1[32] = WINPR_C_ARRAY_INIT; \
char str2[32] = WINPR_C_ARRAY_INIT; \
char* _prefix = _strdup(_prefix_); \
const UINT64 start = winpr_GetTickCount64NS(); \
PROFILER_START(_prefix); \