Fixed a few compiler warnings

This commit is contained in:
Norbert Federa
2017-07-10 15:29:09 +02:00
parent 214a198a59
commit 36b8f54c5e
8 changed files with 29 additions and 29 deletions

View File

@@ -181,7 +181,7 @@ static BOOL drive_file_remove_dir(const WCHAR* path)
return ret;
}
static void drive_file_set_fullpath(DRIVE_FILE* file, const WCHAR* fullpath)
static void drive_file_set_fullpath(DRIVE_FILE* file, WCHAR* fullpath)
{
free(file->fullpath);
file->fullpath = fullpath;

View File

@@ -866,7 +866,7 @@ UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints,
return CHANNEL_RC_OK;
out_error:
drive_free(drive);
drive_free((DEVICE*) drive);
return error;
}

View File

@@ -295,7 +295,7 @@ static UINT xf_CreateSurface(RdpgfxClientContext* context,
surface->gdi.outputMapped = FALSE;
region16_init(&surface->gdi.invalidRegion);
if (context->SetSurfaceData(context, surface->gdi.surfaceId, (void*) surface) < 0)
if (context->SetSurfaceData(context, surface->gdi.surfaceId, (void*) surface) != CHANNEL_RC_OK)
{
WLog_ERR(TAG, "%s: an error occurred during SetSurfaceData", __FUNCTION__);
goto error_set_surface_data;

View File

@@ -2432,8 +2432,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
{
settings->AutoReconnectMaxRetries = atoi(arg->Value);
if ((settings->AutoReconnectMaxRetries < 0) ||
(settings->AutoReconnectMaxRetries > 1000))
if (settings->AutoReconnectMaxRetries > 1000)
return COMMAND_LINE_ERROR;
}
CommandLineSwitchCase(arg, "reconnect-cookie")

View File

@@ -33,6 +33,7 @@
#include "surface.h"
#include "message.h"
#include "info.h"
#include "window.h"
#include <freerdp/log.h>
#include <freerdp/peer.h>

View File

@@ -102,7 +102,7 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_func(prim_size_t roi, DWORD DstFormat)
}
}
printf("Results for %lux%lu [%s]", roi.width, roi.height, GetColorFormatName(DstFormat));
printf("Results for %"PRIu32"x%"PRIu32" [%s]", roi.width, roi.height, GetColorFormatName(DstFormat));
PROFILER_PRINT_HEADER;
PROFILER_PRINT(genericProf);
PROFILER_PRINT(optProf);

View File

@@ -58,103 +58,103 @@ int TestSynchMultipleThreads(int argc, char *argv[])
/* WaitForAll, timeout */
if (start_threads(THREADS, threads))
return -1;
return 1;
if (WaitForMultipleObjects(THREADS, threads, TRUE, 50) != WAIT_TIMEOUT)
{
printf("WaitForMultipleObjects bWaitAll, timeout 50 failed\n");
rc = -1;
rc = 2;
}
if (WaitForMultipleObjects(THREADS, threads, TRUE, INFINITE) != WAIT_OBJECT_0)
{
printf("WaitForMultipleObjects bWaitAll, INFINITE failed\n");
rc = -1;
rc = 3;
}
if (close_threads(THREADS, threads))
return -1;
return 4;
/* WaitOne, infinite */
if (rc)
return rc;
if (start_threads(THREADS, threads))
return -1;
return 5;
ev = WaitForMultipleObjects(THREADS, threads, FALSE, INFINITE);
if ((ev < WAIT_OBJECT_0) || (ev > (WAIT_OBJECT_0 + THREADS)))
{
printf("WaitForMultipleObjects INFINITE failed\n");
rc = -1;
rc = 6;
}
if (WaitForMultipleObjects(THREADS, threads, TRUE, INFINITE) != WAIT_OBJECT_0)
{
printf("WaitForMultipleObjects bWaitAll, INFINITE failed\n");
rc = -1;
rc = 7;
}
if (close_threads(THREADS, threads))
return -1;
return 8;
if (rc)
return rc;
/* WaitOne, timeout */
if (start_threads(THREADS, threads))
return -1;
return 9;
if (WaitForMultipleObjects(THREADS, threads, FALSE, 50) != WAIT_TIMEOUT)
{
printf("WaitForMultipleObjects timeout 50 failed\n");
rc = -1;
rc = 10;
}
if (WaitForMultipleObjects(THREADS, threads, TRUE, INFINITE) != WAIT_OBJECT_0)
{
printf("WaitForMultipleObjects bWaitAll, INFINITE failed\n");
rc = -1;
rc = 11;
}
if (close_threads(THREADS, threads))
return -1;
return 12;
if (rc < 0)
return rc;
if (rc)
return 13;
/* WaitOne, timeout, multiple joins */
if (start_threads(THREADS, threads))
return -1;
return 14;
for (i=0; i<THREADS; i++)
for (i = 0; i < THREADS; i++)
{
if (WaitForMultipleObjects(THREADS, threads, FALSE, 0) != WAIT_TIMEOUT)
{
printf("WaitForMultipleObjects timeout 50 failed\n");
rc = -1;
rc = 15;
}
}
if (WaitForMultipleObjects(THREADS, threads, TRUE, INFINITE) != WAIT_OBJECT_0)
{
printf("WaitForMultipleObjects bWaitAll, INFINITE failed\n");
rc = -1;
rc = 16;
}
if (close_threads(THREADS, threads))
return -1;
rc = 17;
if (rc < 0)
if (rc)
return rc;
/* Thread detach test */
if (start_threads(THREADS, threads))
return -1;
return 18;
if (close_threads(THREADS, threads))
return -1;
return 19;
return 0;
}

View File

@@ -244,7 +244,7 @@ BOOL Test_GetComputerNameEx_Format(COMPUTER_NAME_FORMAT format)
/* test with returned size */
if (GetComputerNameExA(format, computerName1, &dwSize) == FALSE)
{
fprintf(stderr, "%s: (6/%D) GetComputerNameExA failed with error: 0x%08"PRIX32"\n",
fprintf(stderr, "%s: (6/%d) GetComputerNameExA failed with error: 0x%08"PRIX32"\n",
__FUNCTION__, format, GetLastError());
return FALSE;
}