mirror of
https://github.com/lua/lua
synced 2025-03-20 12:42:53 +03:00
Fixed warning about casts between function pointers
gcc now warns (with -Wextra) about casts between pointers to different function types. The type 'void(*)(void)' works as a 'void*' for function pointers, cleaning the warning.
This commit is contained in:
parent
0ddc0f47bd
commit
a901c505ab
@ -67,6 +67,13 @@ static const char *const CLIBS = "_CLIBS";
|
|||||||
#define setprogdir(L) ((void)0)
|
#define setprogdir(L) ((void)0)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Special type equivalent to '(void*)' for functions in gcc
|
||||||
|
** (to supress warnings when converting function pointers)
|
||||||
|
*/
|
||||||
|
typedef void (*voidf)(void);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** system-dependent functions
|
** system-dependent functions
|
||||||
*/
|
*/
|
||||||
@ -206,7 +213,7 @@ static void *lsys_load (lua_State *L, const char *path, int seeglb) {
|
|||||||
|
|
||||||
|
|
||||||
static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) {
|
static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) {
|
||||||
lua_CFunction f = (lua_CFunction)GetProcAddress((HMODULE)lib, sym);
|
lua_CFunction f = (lua_CFunction)(voidf)GetProcAddress((HMODULE)lib, sym);
|
||||||
if (f == NULL) pusherror(L);
|
if (f == NULL) pusherror(L);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user