Fixed warnings

This commit is contained in:
akallabeth 2021-06-17 09:21:20 +02:00 committed by akallabeth
parent 2e0d1cc33c
commit 8d82adb28a
23 changed files with 73 additions and 22 deletions

View File

@ -19,6 +19,11 @@
#include <freerdp/svc.h>
/* The 'entry' function pointers have variable arguments. */
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#endif
struct _STATIC_ENTRY
{
const char* name;
@ -49,3 +54,7 @@ struct _STATIC_ADDIN_TABLE
const STATIC_SUBSYSTEM_ENTRY* table;
};
typedef struct _STATIC_ADDIN_TABLE STATIC_ADDIN_TABLE;
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

View File

@ -98,7 +98,7 @@ struct xf_cliprdr_fuse_inode
};
typedef struct xf_cliprdr_fuse_inode xfCliprdrFuseInode;
void xf_cliprdr_fuse_inode_free(void* obj)
static void xf_cliprdr_fuse_inode_free(void* obj)
{
xfCliprdrFuseInode* inode = (xfCliprdrFuseInode*)obj;
if (!inode)

View File

@ -216,7 +216,7 @@ fail:
return status;
}
UINT32 x11_pad_scanline(UINT32 scanline, UINT32 inPad)
static UINT32 x11_pad_scanline(UINT32 scanline, UINT32 inPad)
{
/* Ensure X11 alignment is met */
if (inPad > 0)

View File

@ -72,7 +72,7 @@ static double z_vector;
static double px_vector;
static double py_vector;
const char* xf_input_get_class_string(int class)
static const char* xf_input_get_class_string(int class)
{
if (class == XIKeyClass)
return "XIKeyClass";

View File

@ -169,7 +169,7 @@ BOOL rdp_send_server_control_cooperate_pdu(rdpRdp* rdp)
return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->userId);
}
BOOL rdp_send_server_control_granted_pdu(rdpRdp* rdp)
static BOOL rdp_send_server_control_granted_pdu(rdpRdp* rdp)
{
wStream* s = rdp_data_pdu_init(rdp);
if (!s)

View File

@ -185,7 +185,6 @@
*/
static int rdp_client_connect_finalize(rdpRdp* rdp);
static BOOL rdp_send_server_control_granted_pdu(rdpRdp* rdp);
static BOOL rdp_client_reset_codecs(rdpContext* context)
{

View File

@ -50,7 +50,7 @@ static DWORD VIRTUAL_SCANCODE_TO_X11_KEYCODE[256][2] = { 0 };
static DWORD X11_KEYCODE_TO_VIRTUAL_SCANCODE[256] = { 0 };
static DWORD REMAPPING_TABLE[0x10000] = { 0 };
int freerdp_detect_keyboard(DWORD* keyboardLayoutId)
static int freerdp_detect_keyboard(DWORD* keyboardLayoutId)
{
#if defined(_WIN32)
CHAR name[KL_NAMELENGTH + 1] = { 0 };

View File

@ -337,7 +337,7 @@ extern "C"
* handler is supposed to answer if the execution can continue. I can also be used
* to log things.
*
* @param handler
* @param handler the error handling function to install
*/
UWAC_API void UwacInstallErrorHandler(UwacErrorHandler handler);

View File

@ -194,7 +194,7 @@ static void callback_done(void* data, struct wl_callback* callback, uint32_t ser
static const struct wl_callback_listener callback_listener = { .done = callback_done };
uint32_t get_serial(UwacSeat* s)
static uint32_t get_serial(UwacSeat* s)
{
struct wl_callback* callback;
uint32_t serial = 0;

View File

@ -1184,7 +1184,7 @@ static HANDLE_OPS ops = { CommIsHandled, CommCloseHandle,
/**
* http://msdn.microsoft.com/en-us/library/windows/desktop/aa363198%28v=vs.85%29.aspx
*
* @param lpDeviceName e.g. COM1, \\.\COM1, ...
* @param lpDeviceName e.g. COM1, "\\.\COM1", ...
*
* @param dwDesiredAccess expects GENERIC_READ | GENERIC_WRITE, a
* warning message is printed otherwise. TODO: better support.

View File

@ -147,11 +147,13 @@ static SERIAL_DRIVER _SerCx2Sys = {
.reset_device = NULL, /* not supported by SerCx2.sys */
};
SERIAL_DRIVER* SerCx2Sys_s()
SERIAL_DRIVER* SerCx2Sys_s(void)
{
/* _SerCx2Sys completed with inherited functions from SerialSys or SerCxSys */
SERIAL_DRIVER* pSerialSys = SerialSys_s();
SERIAL_DRIVER* pSerCxSys = SerCxSys_s();
if (!pSerialSys || !pSerCxSys)
return NULL;
_SerCx2Sys.set_baud_rate = pSerialSys->set_baud_rate;
_SerCx2Sys.get_baud_rate = pSerialSys->get_baud_rate;

View File

@ -29,7 +29,7 @@ extern "C"
{
#endif
SERIAL_DRIVER* SerCx2Sys_s();
SERIAL_DRIVER* SerCx2Sys_s(void);
#ifdef __cplusplus
}

View File

@ -28,6 +28,7 @@
#include <winpr/wlog.h>
#include "comm_serial_sys.h"
#include "comm_sercx_sys.h"
static BOOL _set_handflow(WINPR_COMM* pComm, const SERIAL_HANDFLOW* pHandflow)
{
@ -211,10 +212,12 @@ static SERIAL_DRIVER _SerCxSys = {
.reset_device = NULL, /* not supported by SerCx.sys */
};
SERIAL_DRIVER* SerCxSys_s()
SERIAL_DRIVER* SerCxSys_s(void)
{
/* _SerCxSys completed with inherited functions from SerialSys */
SERIAL_DRIVER* pSerialSys = SerialSys_s();
if (!pSerialSys)
return NULL;
_SerCxSys.set_baud_rate = pSerialSys->set_baud_rate;
_SerCxSys.get_baud_rate = pSerialSys->get_baud_rate;

View File

@ -29,7 +29,7 @@ extern "C"
{
#endif
SERIAL_DRIVER* SerCxSys_s();
SERIAL_DRIVER* SerCxSys_s(void);
#ifdef __cplusplus
}

View File

@ -1609,7 +1609,7 @@ static SERIAL_DRIVER _SerialSys = {
.reset_device = _reset_device,
};
SERIAL_DRIVER* SerialSys_s()
SERIAL_DRIVER* SerialSys_s(void)
{
return &_SerialSys;
}

View File

@ -29,7 +29,7 @@ extern "C"
{
#endif
SERIAL_DRIVER* SerialSys_s();
SERIAL_DRIVER* SerialSys_s(void);
#ifdef __cplusplus
}

View File

@ -33,7 +33,7 @@ struct winpr_none_handle
typedef struct winpr_none_handle WINPR_NONE_HANDLE;
HANDLE CreateNoneHandle();
HANDLE CreateNoneHandle(void);
#endif /*_WIN32*/

View File

@ -223,7 +223,10 @@ USHORT QueryDepthSList(WINPR_PSLIST_HEADER ListHead)
LONG InterlockedIncrement(LONG volatile* Addend)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
return __sync_add_and_fetch(Addend, 1);
#pragma GCC diagnostic pop
#else
return 0;
#endif
@ -232,7 +235,10 @@ LONG InterlockedIncrement(LONG volatile* Addend)
LONG InterlockedDecrement(LONG volatile* Addend)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
return __sync_sub_and_fetch(Addend, 1);
#pragma GCC diagnostic pop
#else
return 0;
#endif
@ -241,6 +247,8 @@ LONG InterlockedDecrement(LONG volatile* Addend)
LONG InterlockedExchange(LONG volatile* Target, LONG Value)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
return __sync_val_compare_and_swap(Target, *Target, Value);
#else
return 0;
@ -250,7 +258,10 @@ LONG InterlockedExchange(LONG volatile* Target, LONG Value)
LONG InterlockedExchangeAdd(LONG volatile* Addend, LONG Value)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
return __sync_fetch_and_add(Addend, Value);
#pragma GCC diagnostic pop
#else
return 0;
#endif
@ -259,7 +270,10 @@ LONG InterlockedExchangeAdd(LONG volatile* Addend, LONG Value)
LONG InterlockedCompareExchange(LONG volatile* Destination, LONG Exchange, LONG Comperand)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
#pragma GCC diagnostic pop
#else
return 0;
#endif
@ -269,7 +283,10 @@ PVOID InterlockedCompareExchangePointer(PVOID volatile* Destination, PVOID Excha
PVOID Comperand)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
#pragma GCC diagnostic pop
#else
return 0;
#endif
@ -350,7 +367,10 @@ LONGLONG InterlockedCompareExchange64(LONGLONG volatile* Destination, LONGLONG E
LONGLONG Comperand)
{
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
#pragma GCC diagnostic pop
#else
return 0;
#endif

View File

@ -33,6 +33,11 @@
#include "sspi.h"
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
#endif
static wLog* g_Log = NULL;
static INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT;
@ -1123,3 +1128,7 @@ SecurityFunctionTableW sspi_SecurityFunctionTableW = {
sspi_DecryptMessage, /* DecryptMessage */
sspi_SetContextAttributesW, /* SetContextAttributes */
};
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

View File

@ -36,6 +36,11 @@ typedef unsigned long ULONG;
#endif
typedef LONG SECURITY_STATUS;
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
#endif
/**
* Standard SSPI API
*/
@ -318,3 +323,7 @@ SSPI_EXPORT SECURITY_STATUS SEC_ENTRY VerifySignature(void* phContext, void* pMe
{
return sspi_VerifySignature(phContext, pMessage, MessageSeqNo, pfQOP);
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

View File

@ -248,7 +248,7 @@ static INIT_ONCE threads_InitOnce = INIT_ONCE_STATIC_INIT;
static pthread_t mainThreadId;
static DWORD currentThreadTlsIndex = TLS_OUT_OF_INDEXES;
BOOL initializeThreads(PINIT_ONCE InitOnce, PVOID Parameter, PVOID* Context)
static BOOL initializeThreads(PINIT_ONCE InitOnce, PVOID Parameter, PVOID* Context)
{
if (!apc_init(&mainThread.apc))
{
@ -657,7 +657,7 @@ typedef struct
ULONG_PTR completionArg;
} UserApcItem;
void userAPC(LPVOID arg)
static void userAPC(LPVOID arg)
{
UserApcItem* userApc = (UserApcItem*)arg;

View File

@ -112,7 +112,7 @@ BOOL ArrayList_IsSynchronized(wArrayList* arrayList)
* Lock access to the ArrayList
*/
void ArrayList_Lock_Conditional(wArrayList* arrayList)
static void ArrayList_Lock_Conditional(wArrayList* arrayList)
{
WINPR_ASSERT(arrayList);
if (arrayList->synchronized)
@ -129,7 +129,7 @@ void ArrayList_Lock(wArrayList* arrayList)
* Unlock access to the ArrayList
*/
void ArrayList_Unlock_Conditional(wArrayList* arrayList)
static void ArrayList_Unlock_Conditional(wArrayList* arrayList)
{
WINPR_ASSERT(arrayList);
if (arrayList->synchronized)

View File

@ -4732,8 +4732,8 @@ TRIO_PUBLIC int trio_asprintfv TRIO_ARGS3((result, format, args), char** result,
/**
Register new user-defined specifier.
@param callback
@param name
@param callback a function to call
@param name a name for the specifier
@return Handle.
*/
TRIO_PUBLIC trio_pointer_t trio_register TRIO_ARGS2((callback, name), trio_callback_t callback,