about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
authorAlexandre Julliard <julliard@winehq.org>2023-06-24 18:20:24 +0200
committerGitHub <noreply@github.com>2023-06-24 18:20:24 +0200
commit770cba7e2b46d3bbd0ce309dbc253f7a4517087a (patch)
treeb32abe8503710fba68ef11964f1226e9ac4bb96f /src/include
parent8aa98d3f53600ce978a2a4a41d51f394ef312fd8 (diff)
downloadbox64-770cba7e2b46d3bbd0ce309dbc253f7a4517087a.tar.gz
box64-770cba7e2b46d3bbd0ce309dbc253f7a4517087a.zip
A few cosmetic fixes (#858)
* [DYNAREC] Don't include pthread.h in C files.

It's already included from box64context.h.

Since there's no pthread.h on Win32, including it only once avoids
having to add ifdefs everywhere.

* [DYNAREC] Remove some duplicate definitions of the GETG helper macros.

* Declare void functions with an explicit void.

To avoid 'function declaration is not a prototype' warnings when using
-Wstrict-prototypes.

* Avoid including bridge_private.h in files that don't need it.

* Avoid defining ZYDIS_RUNTIME_ADDRESS_NONE.

It's not used, and conflicts with the original Zydis headers.
Diffstat (limited to 'src/include')
-rwxr-xr-xsrc/include/box64context.h6
-rwxr-xr-xsrc/include/bridge.h8
-rw-r--r--src/include/custommem.h6
-rwxr-xr-xsrc/include/debug.h2
-rwxr-xr-xsrc/include/dictionnary.h2
-rwxr-xr-xsrc/include/dynablock.h2
-rw-r--r--src/include/dynarec_rv64.h2
-rwxr-xr-xsrc/include/fileutils.h4
-rwxr-xr-xsrc/include/globalsymbols.h16
-rwxr-xr-xsrc/include/gtkclass.h2
-rwxr-xr-xsrc/include/librarian.h2
-rw-r--r--src/include/rcfile.h2
-rwxr-xr-xsrc/include/sdl1rwops.h2
-rwxr-xr-xsrc/include/sdl2rwops.h2
-rwxr-xr-xsrc/include/signals.h2
-rw-r--r--src/include/symbols.h4
-rwxr-xr-xsrc/include/threads.h4
-rwxr-xr-xsrc/include/wine_tools.h4
-rwxr-xr-xsrc/include/x64emu.h2
-rwxr-xr-xsrc/include/x64run.h2
-rwxr-xr-xsrc/include/x64trace.h2
21 files changed, 38 insertions, 40 deletions
diff --git a/src/include/box64context.h b/src/include/box64context.h
index 954d93cb..5b2c5a63 100755
--- a/src/include/box64context.h
+++ b/src/include/box64context.h
@@ -217,7 +217,7 @@ typedef struct box64context_s {
 #define mutex_trylock(A)    pthread_mutex_trylock(A)
 #define mutex_unlock(A)     pthread_mutex_unlock(A)
 #else
-int GetTID();
+int GetTID(void);
 #define mutex_lock(A)       {uint32_t tid = (uint32_t)GetTID(); while(native_lock_storeifnull_d(A, tid)) sched_yield();}
 #define mutex_trylock(A)    native_lock_storeifnull_d(A, (uint32_t)GetTID())
 #define mutex_unlock(A)     native_lock_storeifref_d(A, 0, (uint32_t)GetTID())
@@ -243,10 +243,10 @@ int AddTLSPartition(box64context_t* context, int tlssize);
 
 // defined in fact in threads.c
 void thread_set_emu(x64emu_t* emu);
-x64emu_t* thread_get_emu();
+x64emu_t* thread_get_emu(void);
 
 // unlock mutex that are locked by current thread (for signal handling). Return a mask of unlock mutex
-int unlockMutex();
+int unlockMutex(void);
 // relock the muxtex that were unlocked
 void relockMutex(int locks);
 
diff --git a/src/include/bridge.h b/src/include/bridge.h
index 9859ae85..77f4e41a 100755
--- a/src/include/bridge.h
+++ b/src/include/bridge.h
@@ -7,7 +7,7 @@ typedef struct bridge_s bridge_t;
 typedef struct box64context_s box64context_t;
 typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
 
-bridge_t *NewBridge();
+bridge_t *NewBridge(void);
 void FreeBridge(bridge_t** bridge);
 
 uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name);
@@ -22,13 +22,13 @@ uintptr_t AddVSyscall(bridge_t* bridge, int num);
 int hasAlternate(void* addr);
 void* getAlternate(void* addr);
 void addAlternate(void* addr, void* alt);
-void cleanAlternate();
+void cleanAlternate(void);
 
 #ifdef HAVE_TRACE
 const char* getBridgeName(void* addr);
 #endif
 
-void init_bridge_helper();
-void fini_bridge_helper();
+void init_bridge_helper(void);
+void fini_bridge_helper(void);
 
 #endif //__BRIDGE_H_
\ No newline at end of file
diff --git a/src/include/custommem.h b/src/include/custommem.h
index e7623db2..13e73c4f 100644
--- a/src/include/custommem.h
+++ b/src/include/custommem.h
@@ -32,7 +32,7 @@ int setJumpTableIfRef64(void* addr, void* jmp, void* ref); // return 1 if write
 void setJumpTableDefault64(void* addr);
 void setJumpTableDefaultRef64(void* addr, void* jmp);
 int isJumpTableDefault64(void* addr);
-uintptr_t getJumpTable64();
+uintptr_t getJumpTable64(void);
 uintptr_t getJumpTableAddress64(uintptr_t addr);
 uintptr_t getJumpAddress64(uintptr_t addr);
 
@@ -64,7 +64,7 @@ void freeProtection(uintptr_t addr, size_t size);
 void refreshProtection(uintptr_t addr);
 uint32_t getProtection(uintptr_t addr);
 int getMmapped(uintptr_t addr);
-void loadProtectionFromMap();
+void loadProtectionFromMap(void);
 #ifdef DYNAREC
 void protectDB(uintptr_t addr, size_t size);
 void unprotectDB(uintptr_t addr, size_t size, int mark);    // if mark==0, the blocks are not marked as potentially dirty
@@ -79,7 +79,7 @@ void* find47bitBlock(size_t size);
 void* find47bitBlockNearHint(void* hint, size_t size);
 
 // unlock mutex that are locked by current thread (for signal handling). Return a mask of unlock mutex
-int unlockCustommemMutex();
+int unlockCustommemMutex(void);
 // relock the muxtex that were unlocked
 void relockCustommemMutex(int locks);
 
diff --git a/src/include/debug.h b/src/include/debug.h
index 352e9b12..8397d6c5 100755
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -103,7 +103,7 @@ void printf_ftrace(const char* fmt, ...);
 #define EXPORTDYN 
 #endif
 
-void init_malloc_hook();
+void init_malloc_hook(void);
 extern size_t(*box_malloc_usable_size)(void*);
 #ifdef ANDROID
 extern void*(*__libc_malloc)(size_t);
diff --git a/src/include/dictionnary.h b/src/include/dictionnary.h
index e2ec1466..efa5e1cc 100755
--- a/src/include/dictionnary.h
+++ b/src/include/dictionnary.h
@@ -4,7 +4,7 @@
 

 typedef void dic_t;

 

-dic_t *NewDictionnary();

+dic_t *NewDictionnary(void);

 void FreeDictionnary(dic_t **dic);

 

 const char* AddDictionnary(dic_t* dic, const char* s);

diff --git a/src/include/dynablock.h b/src/include/dynablock.h
index ed7b3c8a..757ca4ae 100755
--- a/src/include/dynablock.h
+++ b/src/include/dynablock.h
@@ -19,6 +19,6 @@ dynablock_t* DBGetBlock(x64emu_t* emu, uintptr_t addr, int create, int is32bits)
 dynablock_t* DBAlternateBlock(x64emu_t* emu, uintptr_t addr, uintptr_t filladdr, int is32bits);
 
 // for use in signal handler
-void cancelFillBlock();
+void cancelFillBlock(void);
 
 #endif //__DYNABLOCK_H_
\ No newline at end of file
diff --git a/src/include/dynarec_rv64.h b/src/include/dynarec_rv64.h
index 9abb704b..dd3b734e 100644
--- a/src/include/dynarec_rv64.h
+++ b/src/include/dynarec_rv64.h
@@ -4,7 +4,7 @@
 typedef struct dynablock_s dynablock_t;
 typedef struct x64emu_s x64emu_t;
 
-void CancelBlock64();
+void CancelBlock64(void);
 void* FillBlock64(dynablock_t* block, uintptr_t addr);
 
 #endif //__DYNAREC_RV64_H_
\ No newline at end of file
diff --git a/src/include/fileutils.h b/src/include/fileutils.h
index c666f0be..2e983c74 100755
--- a/src/include/fileutils.h
+++ b/src/include/fileutils.h
@@ -19,13 +19,13 @@ int FileIsX64ELF(const char* filename);
 int FileIsShell(const char* filename);
 
 // return temp folder (will return /tmp if nothing is correct)
-const char* GetTmpDir();
+const char* GetTmpDir(void);
 
 // will lower case the string and return a copy. Nothing fancy here, just A..Z transformed to a..z, rest is untouched
 char* LowerCase(const char* s);
 
 #if defined(RPI) || defined(RK3399) || defined(RK3326)
-void sanitize_mojosetup_gtk_background();
+void sanitize_mojosetup_gtk_background(void);
 #endif
 
 #endif //__FILEUTILS_H_
\ No newline at end of file
diff --git a/src/include/globalsymbols.h b/src/include/globalsymbols.h
index fc2753ef..d0eb3012 100755
--- a/src/include/globalsymbols.h
+++ b/src/include/globalsymbols.h
@@ -2,18 +2,18 @@
 #define _GLOBAL_SYMBOLS_H_

 

 //GTK stuff

-void my_checkGlobalGdkDisplay();

-void my_setGlobalGThreadsInit();

+void my_checkGlobalGdkDisplay(void);

+void my_setGlobalGThreadsInit(void);

 

-//void** my_GetGTKDisplay();

-void** my_GetGthreadsGotInitialized();  // defined in wrappedgthread2

+//void** my_GetGTKDisplay(void);

+void** my_GetGthreadsGotInitialized(void);  // defined in wrappedgthread2

 

 // NCurse / TInfo

-void my_checkGlobalTInfo();

-void my_updateGlobalTInfo();

+void my_checkGlobalTInfo(void);

+void my_updateGlobalTInfo(void);

 

 // getopt

-void my_checkGlobalOpt();

-void my_updateGlobalOpt();

+void my_checkGlobalOpt(void);

+void my_updateGlobalOpt(void);

 

 #endif //_GLOBAL_SYMBOLS_H_
\ No newline at end of file
diff --git a/src/include/gtkclass.h b/src/include/gtkclass.h
index ad262fda..6835a68b 100755
--- a/src/include/gtkclass.h
+++ b/src/include/gtkclass.h
@@ -840,7 +840,7 @@ my_GTypeInfo_t* findFreeGTypeInfo(my_GTypeInfo_t* fcts, size_t parent);
 my_GtkTypeInfo_t* findFreeGtkTypeInfo(my_GtkTypeInfo_t* fcts, size_t parent);
 
 void InitGTKClass(bridge_t *bridge);
-void FiniGTKClass();
+void FiniGTKClass(void);
 
 #define GTKCLASSES()                \
 GTKCLASS(GObject)                   \
diff --git a/src/include/librarian.h b/src/include/librarian.h
index 6219f00c..c05ce963 100755
--- a/src/include/librarian.h
+++ b/src/include/librarian.h
@@ -16,7 +16,7 @@ typedef char* cstr_t;
 
 lib_t *NewLibrarian(box64context_t* context, int ownlibs);
 void FreeLibrarian(lib_t **maplib, x64emu_t* emu);
-dlprivate_t *NewDLPrivate();
+dlprivate_t *NewDLPrivate(void);
 void FreeDLPrivate(dlprivate_t **lib);
 
 box64context_t* GetLibrarianContext(lib_t* maplib);
diff --git a/src/include/rcfile.h b/src/include/rcfile.h
index c194e9ae..ebad7048 100644
--- a/src/include/rcfile.h
+++ b/src/include/rcfile.h
@@ -2,7 +2,7 @@
 #define __RCFILE_H__
 
 void LoadRCFile(const char* filename);
-void DeleteParams();
+void DeleteParams(void);
 void ApplyParams(const char* name);
 
 #endif //__RCFILE_H__
\ No newline at end of file
diff --git a/src/include/sdl1rwops.h b/src/include/sdl1rwops.h
index 46b73519..76fd890f 100755
--- a/src/include/sdl1rwops.h
+++ b/src/include/sdl1rwops.h
@@ -4,7 +4,7 @@
 typedef struct SDL1_RWops_s SDL1_RWops_t;   // the actual SDL1 SDL_RWops
 typedef struct x64emu_s x64emu_t;
 
-typedef SDL1_RWops_t* (*sdl1_allocrw)();
+typedef SDL1_RWops_t* (*sdl1_allocrw)(void);
 typedef void (*sdl1_freerw)(SDL1_RWops_t*);
 
 // each function will be added to dictionary, and each native functions will be wrapped so they run in emulated world
diff --git a/src/include/sdl2rwops.h b/src/include/sdl2rwops.h
index f03f17c2..1b13c091 100755
--- a/src/include/sdl2rwops.h
+++ b/src/include/sdl2rwops.h
@@ -4,7 +4,7 @@
 typedef struct SDL2_RWops_s SDL2_RWops_t;   // the actual SDL2 SDL_RWops
 typedef struct x64emu_s x64emu_t;
 
-typedef SDL2_RWops_t* (*sdl2_allocrw)();
+typedef SDL2_RWops_t* (*sdl2_allocrw)(void);
 typedef void (*sdl2_freerw)(SDL2_RWops_t*);
 
 typedef struct SDL2RWSave_s {
diff --git a/src/include/signals.h b/src/include/signals.h
index 22e96d15..f3697f48 100755
--- a/src/include/signals.h
+++ b/src/include/signals.h
@@ -34,7 +34,7 @@ int my___sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_si
 int my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigaction_restorer_t *act, x64_sigaction_restorer_t *oldact, int sigsetsize);
 
 void init_signal_helper(box64context_t* context);
-void fini_signal_helper();
+void fini_signal_helper(void);
 
 void emit_signal(x64emu_t* emu, int sig, void* addr, int code);
 
diff --git a/src/include/symbols.h b/src/include/symbols.h
index a7ac4321..32e54b20 100644
--- a/src/include/symbols.h
+++ b/src/include/symbols.h
@@ -9,7 +9,7 @@ typedef struct versymbols_s versymbols_t;
 
 KHASH_MAP_DECLARE_STR(mapsymbols, versymbols_t)
 
-kh_mapsymbols_t* NewMapSymbols();
+kh_mapsymbols_t* NewMapSymbols(void);
 void FreeMapSymbols(kh_mapsymbols_t** map);
 
 // replace if already there
@@ -25,7 +25,7 @@ const char* GetSymbolName(kh_mapsymbols_t* mapsymbols, void* p, uintptr_t* offs,
 
 // default version handling
 KHASH_MAP_DECLARE_STR(defaultversion, const char*)
-kh_defaultversion_t* NewDefaultVersion();
+kh_defaultversion_t* NewDefaultVersion(void);
 void FreeDefaultVersion(kh_defaultversion_t** def);
 
 void AddDefaultVersion(kh_defaultversion_t* def, const char* symname, const char* vername);
diff --git a/src/include/threads.h b/src/include/threads.h
index 847d4ee6..ec133d16 100755
--- a/src/include/threads.h
+++ b/src/include/threads.h
@@ -12,9 +12,9 @@ typedef struct emu_jmpbuf_s {
 
 void CleanStackSize(box64context_t* context);
 
-emu_jmpbuf_t* GetJmpBuf();
+emu_jmpbuf_t* GetJmpBuf(void);
 
-void init_pthread_helper();
+void init_pthread_helper(void);
 void fini_pthread_helper(box64context_t* context);
 
 // prepare an "emuthread structure" in pet and return address of function pointer for a "thread creation routine"
diff --git a/src/include/wine_tools.h b/src/include/wine_tools.h
index 52993cea..5c60fec2 100755
--- a/src/include/wine_tools.h
+++ b/src/include/wine_tools.h
@@ -4,10 +4,10 @@
 void wine_prereserve(const char* reserve);
 
 extern int wine_preloaded;
-void* get_wine_prereserve();
+void* get_wine_prereserve(void);
 
 #ifdef DYNAREC
-void dynarec_wine_prereserve();
+void dynarec_wine_prereserve(void);
 #endif
 
 #endif //__WINE_TOOLS_H__
diff --git a/src/include/x64emu.h b/src/include/x64emu.h
index 355c7fa1..51a27a18 100755
--- a/src/include/x64emu.h
+++ b/src/include/x64emu.h
@@ -14,7 +14,7 @@ void CopyEmu(x64emu_t *newemu, const x64emu_t* emu);
 void SetTraceEmu(uintptr_t trace_start, uintptr_t trace_end);
 
 box64context_t* GetEmuContext(x64emu_t* emu);
-uint32_t* GetParityTab();
+uint32_t* GetParityTab(void);
 
 uint32_t GetEAX(x64emu_t *emu);
 uint64_t GetRAX(x64emu_t *emu);
diff --git a/src/include/x64run.h b/src/include/x64run.h
index 0e156341..11f07cfa 100755
--- a/src/include/x64run.h
+++ b/src/include/x64run.h
@@ -11,6 +11,6 @@ int DynaRun(x64emu_t *emu);
 uint32_t LibSyscall(x64emu_t *emu);
 void PltResolver(x64emu_t* emu);
 extern uintptr_t pltResolver;
-int GetTID();
+int GetTID(void);
 
 #endif //__X64RUN_H_
\ No newline at end of file
diff --git a/src/include/x64trace.h b/src/include/x64trace.h
index 9ecbb9d5..e7c3efd7 100755
--- a/src/include/x64trace.h
+++ b/src/include/x64trace.h
@@ -15,6 +15,4 @@ void DeleteX64TraceDecoder(zydis_dec_t **dec);
 
 const char* DecodeX64Trace(zydis_dec_t *dec, uintptr_t p);
 
-#define ZYDIS_RUNTIME_ADDRESS_NONE (uint64_t)(-1)
-
 #endif //__X64TRACE_H_
\ No newline at end of file