diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2022-07-22 21:08:09 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2022-07-22 21:57:39 +0200 |
commit | 1de8b89807222b5673505fea2bec1af4c0af8c7d (patch) | |
tree | f0b7a5e08013114a5b3f927d93caa8f674775fa9 /src | |
parent | e4cff606fccdb7b8ac1c9bf5204a6b52e296bfe9 (diff) | |
download | OFQT-1de8b89807222b5673505fea2bec1af4c0af8c7d.tar.gz OFQT-1de8b89807222b5673505fea2bec1af4c0af8c7d.zip |
Correct function prototypes,add more Cflags for sanity,add sanity assets
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/cli/main.c | 2 | ||||
-rw-r--r-- | src/cli/updater.c | 4 | ||||
-rw-r--r-- | src/fs.c | 1 | ||||
-rw-r--r-- | src/net.c | 4 | ||||
-rw-r--r-- | src/net.h | 4 | ||||
-rw-r--r-- | src/qt/mainwindow.cpp | 3 | ||||
-rw-r--r-- | src/qt/workers.cpp | 8 | ||||
-rw-r--r-- | src/steam.c | 10 | ||||
-rw-r--r-- | src/steam.h | 10 |
10 files changed, 34 insertions, 15 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ffc77c7..af7cbe3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,6 +6,9 @@ add_subdirectory(vdf) set(CFLAGS -Wall -Wextra -pedantic + -Wfloat-equal -Wundef + -Wstrict-overflow=5 -Wunreachable-code + -Wcast-qual -Wswitch-default -Wconversion -Wshadow -Wstrict-aliasing -Winit-self -Wcast-align -Wpointer-arith -Wmissing-declarations -Wmissing-include-dirs diff --git a/src/cli/main.c b/src/cli/main.c index 7971c7d..c27f6fc 100644 --- a/src/cli/main.c +++ b/src/cli/main.c @@ -5,7 +5,7 @@ #include "net.h" #include "commands.h" -static void help() +static void help(void) { fprintf(stderr, "OFCL <command>\n"); \ diff --git a/src/cli/updater.c b/src/cli/updater.c index 68757c5..9dcd9da 100644 --- a/src/cli/updater.c +++ b/src/cli/updater.c @@ -143,6 +143,10 @@ void update_setup(char* of_dir, char* remote, int local_rev, int remote_rev) free(buf); } break; + + default: + assert(0); + break; } } @@ -122,6 +122,7 @@ char* normalizeUnixPath(char* path) return path; } + int makeDir(const char* path) { char pathcpy[PATH_MAX]; @@ -12,12 +12,12 @@ // official servers only whitelist some UAs #define USER_AGENT "murse/0.1 (" NAME "/" VERSION ")" -void net_init() +void net_init(void) { curl_global_init(CURL_GLOBAL_ALL); } -void net_deinit() +void net_deinit(void) { curl_global_cleanup(); } @@ -13,8 +13,8 @@ struct MemoryStruct { size_t size; }; -void net_init(); -void net_deinit(); +void net_init(void); +void net_deinit(void); struct MemoryStruct* downloadToRam(const char* URL); size_t downloadToFile(const char*, const char*); diff --git a/src/qt/mainwindow.cpp b/src/qt/mainwindow.cpp index 15e5526..5bf013d 100644 --- a/src/qt/mainwindow.cpp +++ b/src/qt/mainwindow.cpp @@ -159,6 +159,9 @@ void MainWindow::workerResult(const enum Worker::Results_t& result) QMessageBox::information(this, windowTitle(), "Steam is not running" ); break; + default: + assert(0); + break; } in_progress = false; diff --git a/src/qt/workers.cpp b/src/qt/workers.cpp index a66061d..5c20f0e 100644 --- a/src/qt/workers.cpp +++ b/src/qt/workers.cpp @@ -231,6 +231,10 @@ int Worker::update_setup(int local_rev, int remote_rev) free(buf); } break; + + default: + assert(0); + break; } } @@ -334,6 +338,10 @@ void Worker::doWork(const enum Worker::Tasks_t ¶meter) { free(argv); } break; + + default: + assert(0); + break; } emit resultReady(result); diff --git a/src/steam.c b/src/steam.c index 85c9511..f8a809b 100644 --- a/src/steam.c +++ b/src/steam.c @@ -17,7 +17,7 @@ * Returns a heap allocated path to the main steam directory * If a problem occurs returns NULL */ -char* getSteamDir() +char* getSteamDir(void) { #if defined(__linux__) || defined(__FreeBSD__) char* home = getenv("HOME"); @@ -83,7 +83,7 @@ char* getSteamDir() * Returns a heap allocated path to the sourcemod dirctory * If a problem occurs returns NULL */ -char* getSourcemodDir() +char* getSourcemodDir(void) { char* steam = getSteamDir(); if (!steam) @@ -96,7 +96,7 @@ char* getSourcemodDir() return steam; } -char* getOpenFortressDir() +char* getOpenFortressDir(void) { char* sm_dir = getSourcemodDir(); if (!sm_dir) @@ -109,7 +109,7 @@ char* getOpenFortressDir() return sm_dir; } -char* getSourceSDK2013MpDir() +char* getSourceSDK2013MpDir(void) { char* librayfolders = getSteamDir(); if (!librayfolders) @@ -171,7 +171,7 @@ char* getSourceSDK2013MpDir() * function to fetch the PID of a running Steam process. * If none were found returns -1 */ -long getSteamPID() +long getSteamPID(void) { #if defined(__linux__) || defined(__FreeBSD__) diff --git a/src/steam.h b/src/steam.h index c6f6887..beffa06 100644 --- a/src/steam.h +++ b/src/steam.h @@ -50,11 +50,11 @@ extern "C" { #else #endif -char* getSteamDir(); -char* getSourcemodDir(); -char* getOpenFortressDir(); -char* getSourceSDK2013MpDir(); -long getSteamPID(); +char* getSteamDir(void); +char* getSourcemodDir(void); +char* getOpenFortressDir(void); +char* getSourceSDK2013MpDir(void); +long getSteamPID(void); int runOpenFortress(char**, size_t); #ifdef __cplusplus |