[core] fix warnings and invalid return type

This commit is contained in:
akallabeth 2025-02-13 09:37:47 +01:00
parent f53cd51517
commit 323c6da940
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
7 changed files with 16 additions and 12 deletions

View File

@ -411,7 +411,8 @@ static int openh264_compress(H264_CONTEXT* WINPR_RESTRICT h264,
{
for (int j = 0; j < info.sLayerInfo[i].iNalCount; j++)
{
*pDstSize += info.sLayerInfo[i].pNalLengthInByte[j];
const int val = info.sLayerInfo[i].pNalLengthInByte[j];
*pDstSize += WINPR_ASSERTING_INT_CAST(uint32_t, val);
}
}

View File

@ -1176,7 +1176,7 @@ static void free_cmd(RDPGFX_SURFACE_COMMAND* cmd)
free(cmd->data);
}
static WINPR_NORETURN(void usage(const char* name))
WINPR_NORETURN(static void usage(const char* name))
{
FILE* fp = stdout;
(void)fprintf(fp, "%s <directory> <width> <height>\n", name);

View File

@ -393,7 +393,7 @@ static char* aad_final_digest(rdpAad* aad, WINPR_DIGEST_CTX* ctx)
if (dsf <= 0)
{
WLog_Print(aad->log, WLOG_ERROR, "winpr_DigestSign_Final failed with %d", dsf);
return FALSE;
return NULL;
}
char* buffer = calloc(siglen + 1, sizeof(char));

View File

@ -543,7 +543,7 @@ BIO* createChildSessionBio(void)
if (!bufferedBio)
{
BIO_free_all(lowLevelBio);
return FALSE;
return NULL;
}
bufferedBio = BIO_push(bufferedBio, lowLevelBio);

View File

@ -829,7 +829,7 @@ static SecurityFunctionTable* auth_resolve_sspi_table(const rdpSettings* setting
{
WLog_ERR(TAG, "Failed to load SSPI module: %s", module_name);
free(sspi_module);
return FALSE;
return NULL;
}
WLog_INFO(TAG, "Using SSPI Module: %s", module_name);
@ -840,7 +840,7 @@ static SecurityFunctionTable* auth_resolve_sspi_table(const rdpSettings* setting
{
WLog_ERR(TAG, "Failed to load SSPI module: %s, no function %s", module_name, proc_name);
free(sspi_module);
return FALSE;
return NULL;
}
free(sspi_module);
return InitSecurityInterface_ptr();

View File

@ -52,8 +52,9 @@
#define TAG FREERDP_TAG("core.listener")
static BOOL freerdp_listener_open_from_vsock(freerdp_listener* instance, const char* bind_address,
UINT16 port)
static BOOL freerdp_listener_open_from_vsock(WINPR_ATTR_UNUSED freerdp_listener* instance,
WINPR_ATTR_UNUSED const char* bind_address,
WINPR_ATTR_UNUSED UINT16 port)
{
#if defined(HAVE_AF_VSOCK_H)
rdpListener* listener = (rdpListener*)instance->listener;

View File

@ -145,13 +145,15 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_speed(void)
cnv.pv = ptrs;
if (!speed_test("RGBToRGB_16s8u_P3AC4R", "aligned", g_Iterations,
generic->RGBToRGB_16s8u_P3AC4R, optimized->RGBToRGB_16s8u_P3AC4R, cnv.cpv,
64 * 2, (BYTE*)dst, 64 * 4, &roi64x64))
(speed_test_fkt)generic->RGBToRGB_16s8u_P3AC4R,
(speed_test_fkt)optimized->RGBToRGB_16s8u_P3AC4R, cnv.cpv, 64 * 2, (BYTE*)dst,
64 * 4, &roi64x64))
return FALSE;
if (!speed_test("RGBToRGB_16s8u_P3AC4R", "unaligned", g_Iterations,
generic->RGBToRGB_16s8u_P3AC4R, optimized->RGBToRGB_16s8u_P3AC4R, cnv.cpv,
64 * 2, ((BYTE*)dst) + 1, 64 * 4, &roi64x64))
(speed_test_fkt)generic->RGBToRGB_16s8u_P3AC4R,
(speed_test_fkt)optimized->RGBToRGB_16s8u_P3AC4R, cnv.cpv, 64 * 2,
((BYTE*)dst) + 1, 64 * 4, &roi64x64))
return FALSE;
return TRUE;