From 3776ad5e02326c62ca50c847b530848ba75ed830 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sun, 11 Dec 2022 14:56:20 +0100 Subject: [PATCH] added void parameter to every function without any parameters --- include/flags.h | 12 ++++++------ include/logger/flags.h | 2 +- include/misc.h | 2 +- src/core/lib/flags.c | 12 ++++++------ src/core/lib/misc.c | 2 +- src/logger/lib/flags.c | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/flags.h b/include/flags.h index 4e414a1..e96bbfe 100644 --- a/include/flags.h +++ b/include/flags.h @@ -72,13 +72,13 @@ typedef struct //NOTE: Variables were moved to 'flags.c' to force y'all using getters //GETTERS -char getEncryptionSeparator(); -unsigned long getKeyLength(); -inputFlags getDefaultFlags(); //THIS GENERATES inputFlags WITH DEFAULT VALUES -inputFlags getFlags(); //RETURNS USED FLAGS +char getEncryptionSeparator(void); +unsigned long getKeyLength(void); +inputFlags getDefaultFlags(void); //THIS GENERATES inputFlags WITH DEFAULT VALUES +inputFlags getFlags(void); //RETURNS USED FLAGS outputFlags noOutput(boolean exitCode); //SAME AS getDefaultFlags() BUT FOR outputFlags -encryptionOperation_type_cb getEncryptionOperation(); //RETURNS FUNCTION WHICH IS USED FOR ENCRYPTION & DECRYPTION -boolean getFlagsChanged(); +encryptionOperation_type_cb getEncryptionOperation(void); //RETURNS FUNCTION WHICH IS USED FOR ENCRYPTION & DECRYPTION +boolean getFlagsChanged(void); //SETTERS void setEncryptionSeparator(char encryptionSeparatorNew); diff --git a/include/logger/flags.h b/include/logger/flags.h index 8fba230..d6c2f81 100644 --- a/include/logger/flags.h +++ b/include/logger/flags.h @@ -55,7 +55,7 @@ typedef struct } logFlags; //GETTERS -logFlags getLogFlags(); +logFlags getLogFlags(void); //SETTERS void setLogFlags(logFlags logFlagsNew); diff --git a/include/misc.h b/include/misc.h index 9878c51..be84d06 100644 --- a/include/misc.h +++ b/include/misc.h @@ -26,7 +26,7 @@ along with this program. If not, see . void generateTextKeyChain(char *key, int *textKeyChain, int textKeyChainSize); //GENERATES ARRAY FOR ENCRYPTION/DECRYPTION void generateKey(char *key, int keyLength); //GENERATE ENCRYPTION KEY void deallocateOutput(outputFlags flags); //DEALLOCATES flags -boolean checkVersion(); //THIS FUNCTION CHECKS IF LATEST VERSION OF WHY2 IS USED +boolean checkVersion(void); //THIS FUNCTION CHECKS IF LATEST VERSION OF WHY2 IS USED boolean checkKey(char *key); //CHECKS IF KEY IS VALID boolean checkText(char *text); //CHECKS IF TEXT IS VALID unsigned long countIntLength(int number); //RETURNS LENGTH OF number diff --git a/src/core/lib/flags.c b/src/core/lib/flags.c index 7ca026c..d501385 100644 --- a/src/core/lib/flags.c +++ b/src/core/lib/flags.c @@ -33,22 +33,22 @@ encryptionOperation_type_cb encryptionOperation_cb = encryptionOperation; boolean flagsChanged = 0; //CHANGES TO 1 WHEN U USE setFlags //GETTERS -char getEncryptionSeparator() +char getEncryptionSeparator(void) { return encryptionSeparator; } -unsigned long getKeyLength() +unsigned long getKeyLength(void) { return keyLength; } -inputFlags getDefaultFlags() +inputFlags getDefaultFlags(void) { return DEFAULT_FLAGS; } -inputFlags getFlags() +inputFlags getFlags(void) { return flags; } @@ -68,12 +68,12 @@ outputFlags noOutput(boolean exitCode) return (outputFlags) { emptyText, emptyKey, 0, 0, 0, exitCode }; } -encryptionOperation_type_cb getEncryptionOperation() +encryptionOperation_type_cb getEncryptionOperation(void) { return encryptionOperation_cb; } -boolean getFlagsChanged() +boolean getFlagsChanged(void) { return flagsChanged; } diff --git a/src/core/lib/misc.c b/src/core/lib/misc.c index 9193ea3..9a603dd 100644 --- a/src/core/lib/misc.c +++ b/src/core/lib/misc.c @@ -87,7 +87,7 @@ char *replaceWord(char *string, char *old, char *new) //CODE FROM: https://www.g return result; } -boolean checkVersion() +boolean checkVersion(void) { if (getFlags().noCheck) return SUCCESS; diff --git a/src/logger/lib/flags.c b/src/logger/lib/flags.c index 68f9f75..d1eaff2 100644 --- a/src/logger/lib/flags.c +++ b/src/logger/lib/flags.c @@ -24,7 +24,7 @@ along with this program. If not, see . logFlags flags = { NULL }; //GETTERS -logFlags getLogFlags() +logFlags getLogFlags(void) { return flags; }