[warnings] fix various compiler warnings

This commit is contained in:
akallabeth 2024-10-29 12:32:14 +01:00
parent 4078b0d5b9
commit aa954d9be9
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
12 changed files with 24 additions and 19 deletions

View File

@ -1730,8 +1730,8 @@ BOOL SdlContext::update_resizeable(BOOL enable)
}
SdlContext::SdlContext(rdpContext* context)
: _context(context), log(WLog_Get(SDL_TAG)), update_complete(true), disp(this), clip(this),
input(this), primary(nullptr, SDL_DestroySurface), rdp_thread_running(false)
: _context(context), log(WLog_Get(SDL_TAG)), update_complete(true), disp(this), input(this),
clip(this), primary(nullptr, SDL_DestroySurface), rdp_thread_running(false)
{
WINPR_ASSERT(context);
grab_kbd_enabled = freerdp_settings_get_bool(context->settings, FreeRDP_GrabKeyboard);

View File

@ -202,8 +202,6 @@ if (WITH_XFIXES)
endif()
endif()
include_directories(${PROJECT_SOURCE_DIR}/resources)
list(APPEND PUB_LIBS
freerdp-client
)

View File

@ -1015,7 +1015,7 @@ static int freerdp_client_command_line_post_filter_int(void* context, COMMAND_LI
size_t count = 0;
char** ptr = CommandLineParseCommaSeparatedValues(arg->Value, &count);
if (!freerdp_client_add_device_channel(settings, count, (const char**)ptr))
if (!freerdp_client_add_device_channel(settings, count, (const char* const*)ptr))
status = COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
if (!freerdp_settings_set_bool(settings, FreeRDP_DeviceRedirection, TRUE))
status = COMMAND_LINE_ERROR;

View File

@ -2310,7 +2310,8 @@ BOOL freerdp_client_populate_settings_from_rdp_file(const rdpFile* file, rdpSett
size_t count = 0;
char** ptr = CommandLineParseCommaSeparatedValuesEx(LOCATION_CHANNEL_NAME, NULL, &count);
const BOOL rc = freerdp_client_add_dynamic_channel(settings, count, (const char**)ptr);
const BOOL rc =
freerdp_client_add_dynamic_channel(settings, count, (const char* const*)ptr);
CommandLineParserFree(ptr);
if (!rc)
return FALSE;

View File

@ -1030,9 +1030,9 @@ static BOOL http_response_parse_header(HttpResponse* response)
break;
}
const int rc = http_response_parse_header_field(response, name, value);
const int res = http_response_parse_header_field(response, name, value);
*end_of_header = end_of_header_char;
if (!rc)
if (!res)
goto fail;
}

View File

@ -287,7 +287,7 @@ static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, uint
its.it_interval.tv_nsec = 0;
its.it_value.tv_sec = 0;
its.it_value.tv_nsec = 0;
timerfd_settime(input->repeat_timer_fd, 0, &its, NULL);
(void)timerfd_settime(input->repeat_timer_fd, 0, &its, NULL);
UwacPointerEnterLeaveEvent* event =
(UwacPointerEnterLeaveEvent*)UwacDisplayNewEvent(input->display, UWAC_EVENT_POINTER_LEAVE);
@ -403,7 +403,7 @@ static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, uint32
its.it_interval.tv_nsec = 0;
its.it_value.tv_sec = 0;
its.it_value.tv_nsec = 0;
timerfd_settime(input->repeat_timer_fd, 0, &its, NULL);
(void)timerfd_settime(input->repeat_timer_fd, 0, &its, NULL);
}
else if (state == WL_KEYBOARD_KEY_STATE_PRESSED &&
xkb_keymap_key_repeats(input->xkb.keymap, code))
@ -415,7 +415,7 @@ static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, uint32
its.it_interval.tv_nsec = input->repeat_rate_nsec;
its.it_value.tv_sec = input->repeat_delay_sec;
its.it_value.tv_nsec = input->repeat_delay_nsec;
timerfd_settime(input->repeat_timer_fd, 0, &its, NULL);
(void)timerfd_settime(input->repeat_timer_fd, 0, &its, NULL);
}
keyEvent = (UwacKeyEvent*)UwacDisplayNewEvent(input->display, UWAC_EVENT_KEY);

View File

@ -462,6 +462,8 @@ static const EVP_CIPHER* winpr_openssl_get_evp_cipher(WINPR_CIPHER_TYPE cipher)
case WINPR_CIPHER_BLOWFISH_CTR:
evp = EVP_get_cipherbyname("blowfish-ctr");
break;
default:
break;
}
return evp;

View File

@ -1100,7 +1100,7 @@ WINSCARDAPI char* WINAPI SCardGetReaderStateString(DWORD dwReaderState)
return buffer;
}
#define WINSCARD_LOAD_PROC(_name, ...) \
#define WINSCARD_LOAD_PROC(_name) \
do \
{ \
WINPR_PRAGMA_DIAG_PUSH \

View File

@ -553,7 +553,7 @@ exit:
set_event(thread);
signal_thread_ready(thread);
(void)signal_thread_ready(thread);
if (thread->detached || !thread->started)
cleanup_handle(thread);

View File

@ -81,7 +81,7 @@ static void append_timezone(const char* dir, const char* name)
tzset();
const time_t t = time(NULL);
struct tm lt = { 0 };
localtime_r(&t, &lt);
(void)localtime_r(&t, &lt);
append(tz, lt.tm_zone);
if (oldtz)
{

View File

@ -393,7 +393,7 @@ static struct tm next_day(const struct tm* start)
cur.tm_isdst = -1;
cur.tm_mday++;
const time_t t = mktime(&cur);
localtime_r(&t, &cur);
(void)localtime_r(&t, &cur);
return cur;
}
@ -405,7 +405,7 @@ static struct tm adjust_time(const struct tm* start, int hour, int minute)
cur.tm_sec = 0;
cur.tm_isdst = -1;
const time_t t = mktime(&cur);
localtime_r(&t, &cur);
(void)localtime_r(&t, &cur);
return cur;
}
@ -426,7 +426,7 @@ static WORD get_transition_weekday_occurrence(const SYSTEMTIME* st)
next.tm_mday++;
struct tm cur = { 0 };
localtime_r(&t, &cur);
(void)localtime_r(&t, &cur);
if (cur.tm_mon + 1 != st->wMonth)
break;

View File

@ -112,8 +112,12 @@ static BOOL WLog_JournaldAppender_WriteMessage(wLog* log, wLogAppender* appender
WLog_Layout_GetMessagePrefix(log, appender->Layout, message);
if (message->Level != WLOG_OFF)
(void)fprintf(journaldAppender->stream, formatStr, message->PrefixString,
message->TextString);
{
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL(void)
fprintf(journaldAppender->stream, formatStr, message->PrefixString, message->TextString);
WINPR_PRAGMA_DIAG_POP
}
return TRUE;
}