[channels] fix function pointer casts

* Cast freerdp_load_channel_addin_entry return with a union (removes the
  incompatible function pointer cast warnings)
* Typedef function pointers in tables.h
This commit is contained in:
akallabeth
2024-09-03 11:23:02 +02:00
parent f3d84d4557
commit b77d6e8550
8 changed files with 67 additions and 39 deletions

View File

@@ -57,7 +57,7 @@ static void* freerdp_channels_find_static_entry_in_table(const STATIC_ENTRY_TABL
union
{
void* pv;
UINT (*entry)();
static_entry_fn_t entry;
} cnv;
cnv.entry = pEntry->entry;
return cnv.pv;

View File

@@ -24,10 +24,11 @@
WINPR_PRAGMA_DIAG_PUSH
WINPR_PRAGMA_DIAG_IGNORED_STRICT_PROTOTYPES
typedef UINT (*static_entry_fn_t)();
typedef struct
{
const char* name;
UINT (*entry)();
static_entry_fn_t entry;
} STATIC_ENTRY;
typedef struct
@@ -36,18 +37,20 @@ typedef struct
const STATIC_ENTRY* table;
} STATIC_ENTRY_TABLE;
typedef UINT (*static_subsystem_entry_fn_t)();
typedef struct
{
const char* name;
const char* type;
UINT (*entry)();
static_subsystem_entry_fn_t entry;
} STATIC_SUBSYSTEM_ENTRY;
typedef UINT (*static_addin_entry_fn_t)();
typedef struct
{
const char* name;
const char* type;
UINT (*entry)();
static_addin_entry_fn_t entry;
const STATIC_SUBSYSTEM_ENTRY* table;
} STATIC_ADDIN_TABLE;