Fixed various compiler warnings

This commit is contained in:
akallabeth
2022-12-09 14:05:00 +01:00
committed by Bernhard Miklautz
parent 7ab917dca8
commit d4808dd3e1
8 changed files with 46 additions and 49 deletions

View File

@@ -256,13 +256,13 @@ static BOOL rail_paint_fn(const void* pvkey, void* value, void* pvarg)
WINPR_ASSERT(pvkey);
WINPR_ASSERT(arg);
const UINT64 key = *(UINT64*)pvkey;
const UINT64 key = *(const UINT64*)pvkey;
return xf_rail_paint_surface(arg->xfc, key, arg->rect);
}
BOOL xf_rail_paint(xfContext* xfc, const RECTANGLE_16* rect)
{
const rail_paint_fn_arg_t arg = { .xfc = xfc, .rect = rect };
rail_paint_fn_arg_t arg = { .xfc = xfc, .rect = rect };
WINPR_ASSERT(xfc);
WINPR_ASSERT(rect);

View File

@@ -458,16 +458,16 @@ int xf_tsmf_init(xfContext* xfc, TsmfClientContext* tsmf)
{
#ifdef WITH_XV
return xf_tsmf_xv_init(xfc, tsmf);
#endif
#else
return 1;
#endif
}
int xf_tsmf_uninit(xfContext* xfc, TsmfClientContext* tsmf)
{
#ifdef WITH_XV
return xf_tsmf_xv_uninit(xfc, tsmf);
#endif
#else
return 1;
#endif
}

View File

@@ -284,28 +284,30 @@ set(PRIMITIVES_SRCS
primitives/primitives.c
primitives/prim_internal.h)
set(PRIMITIVES_SSE2_SRCS
primitives/prim_colors_opt.c
primitives/prim_set_opt.c)
if (WITH_SSE2 OR WITH_NEON)
set(PRIMITIVES_SSE2_SRCS
primitives/prim_colors_opt.c
primitives/prim_set_opt.c)
set(PRIMITIVES_SSE3_SRCS
primitives/prim_add_opt.c
primitives/prim_alphaComp_opt.c
primitives/prim_andor_opt.c
primitives/prim_shift_opt.c)
set(PRIMITIVES_SSE3_SRCS
primitives/prim_add_opt.c
primitives/prim_alphaComp_opt.c
primitives/prim_andor_opt.c
primitives/prim_shift_opt.c)
set(PRIMITIVES_SSSE3_SRCS
primitives/prim_sign_opt.c
primitives/prim_YCoCg_opt.c)
set(PRIMITIVES_SSSE3_SRCS
primitives/prim_sign_opt.c
primitives/prim_YCoCg_opt.c)
if (WITH_SSE2)
set(PRIMITIVES_SSSE3_SRCS ${PRIMITIVES_SSSE3_SRCS}
primitives/prim_YUV_ssse3.c)
endif()
if (WITH_SSE2)
set(PRIMITIVES_SSSE3_SRCS ${PRIMITIVES_SSSE3_SRCS}
primitives/prim_YUV_ssse3.c)
endif()
if (WITH_NEON)
set(PRIMITIVES_SSSE3_SRCS ${PRIMITIVES_SSSE3_SRCS}
primitives/prim_YUV_neon.c)
if (WITH_NEON)
set(PRIMITIVES_SSSE3_SRCS ${PRIMITIVES_SSSE3_SRCS}
primitives/prim_YUV_neon.c)
endif()
endif()
if (WITH_OPENCL)

View File

@@ -312,7 +312,7 @@ static BOOL gdi_Glyph_Draw(rdpContext* context, const rdpGlyph* glyph, INT32 x,
gdi = context->gdi;
gdi_glyph = (const gdiGlyph*)glyph;
if (!fOpRedundant && 0)
if (!fOpRedundant)
{
GDI_RECT rect = { 0 };

View File

@@ -356,7 +356,7 @@ int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32
#else
region16_init(&buffer->damage);
#endif
buffer->data = data + (allocSize * i);
buffer->data = &data[allocSize * i];
buffer->size = allocSize;
buffer->wayland_buffer =
wl_shm_pool_create_buffer(pool, allocSize * i, width, height, w->stride, format);

View File

@@ -51,7 +51,7 @@ static BOOL check_short_buffer(const char* prefix, int rc, size_t buffersize,
if (buffersize > len)
{
fprintf(stderr,
"%s length does not match buffersize: %" PRIdz " != %" PRIuz
"%s length does not match buffersize: %" PRIdz " != %" PRId32
",but is large enough to hold result\n",
prefix, rc, buffersize);
return FALSE;
@@ -61,7 +61,7 @@ static BOOL check_short_buffer(const char* prefix, int rc, size_t buffersize,
{
fprintf(stderr,
"%s length does not match buffersize: %" PRIdz " != %" PRIuz
"%s length does not match buffersize: %" PRIdz " != %" PRId32
", unexpected GetLastError() 0x08%" PRIx32 "\n",
prefix, rc, buffersize, err);
return FALSE;

View File

@@ -623,7 +623,7 @@ static SECURITY_STATUS parseKeyName(LPCWSTR pszKeyName, CK_SLOT_ID* slotId, CK_B
if (!pos)
return NTE_BAD_KEY;
if (pos - &asciiKeyName[1] > sizeof(CK_SLOT_ID) * 2ull)
if ((size_t)(pos - &asciiKeyName[1]) > sizeof(CK_SLOT_ID) * 2ull)
return NTE_BAD_KEY;
*slotId = (CK_SLOT_ID)0;

View File

@@ -796,31 +796,26 @@ HRESULT PathCchConvertStyleA(PSTR pszPath, size_t cchPath, unsigned long dwFlags
}
else if (dwFlags == PATH_STYLE_NATIVE)
{
if (PATH_SEPARATOR_CHR == PATH_BACKSLASH_CHR)
{
/* Unix-style to Windows-style */
#if (PATH_SEPARATOR_CHR == PATH_BACKSLASH_CHR)
/* Unix-style to Windows-style */
for (index = 0; index < cchPath; index++)
{
if (pszPath[index] == PATH_SLASH_CHR)
pszPath[index] = PATH_BACKSLASH_CHR;
}
}
else if (PATH_SEPARATOR_CHR == PATH_SLASH_CHR)
for (index = 0; index < cchPath; index++)
{
/* Windows-style to Unix-style */
if (pszPath[index] == PATH_SLASH_CHR)
pszPath[index] = PATH_BACKSLASH_CHR;
}
#elif (PATH_SEPARATOR_CHR == PATH_SLASH_CHR)
/* Windows-style to Unix-style */
for (index = 0; index < cchPath; index++)
{
if (pszPath[index] == PATH_BACKSLASH_CHR)
pszPath[index] = PATH_SLASH_CHR;
}
}
else
for (index = 0; index < cchPath; index++)
{
/* Unexpected error */
return E_FAIL;
if (pszPath[index] == PATH_BACKSLASH_CHR)
pszPath[index] = PATH_SLASH_CHR;
}
#else
/* Unexpected error */
return E_FAIL;
#endif
}
else
{