diff --git a/src/lib/decrypter.c b/src/lib/decrypter.c index 5f31c27..8e7ae22 100644 --- a/src/lib/decrypter.c +++ b/src/lib/decrypter.c @@ -51,7 +51,7 @@ outputFlags decryptText(char *text, char *keyNew, inputFlags flags) strcpy(key, keyNew); //GET LENGTH OF returningText AND textKeyChain - for (int i = 0; i < strlen(text); i++) + for (int i = 0; i < (int) strlen(text); i++) { if (text[i] == getEncryptionSeparator()) numberBuffer++; } @@ -71,7 +71,7 @@ outputFlags decryptText(char *text, char *keyNew, inputFlags flags) numberBuffer = 0; //GET LENGTH OF EACH CHARACTER - for (int j = 0; j < strlen(text); j++) + for (int j = 0; j < (int) strlen(text); j++) { if (text[j] == getEncryptionSeparator()) break; @@ -81,7 +81,7 @@ outputFlags decryptText(char *text, char *keyNew, inputFlags flags) textBuffer = malloc(numberBuffer + 1); //LOAD textBuffer - for (int j = 0; j < strlen(text); j++) + for (int j = 0; j < (int) strlen(text); j++) { textBuffer[j] = text[j]; diff --git a/src/lib/encrypter.c b/src/lib/encrypter.c index a225202..3a14eb7 100644 --- a/src/lib/encrypter.c +++ b/src/lib/encrypter.c @@ -63,7 +63,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags) } //LOAD KEY - for (int i = 0; i < getKeyLength(); i++) + for (int i = 0; i < (int) getKeyLength(); i++) { //SET numberBuffer TO RANDOM NUMBER BETWEEN 0 AND 52 numberBuffer = (rand() % 52) + 1; @@ -89,13 +89,13 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags) generateTextKeyChain(key, textKeyChain, strlen(text)); //ACTUALLY ENCRYPT TEXT - for (int i = 0; i < strlen(text); i++) + for (int i = 0; i < (int) strlen(text); i++) { textKeyChain[i] -= (int) text[i]; } //COUNT REQUIRED SIZE FOR returningText - for (int i = 0; i < strlen(text); i++) + for (int i = 0; i < (int) strlen(text); i++) { numberBuffer += countIntLength(textKeyChain[i]); } @@ -105,7 +105,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags) strcpy(returningText, ""); //LOAD returningText - for (int i = 0; i < strlen(text); i++) + for (int i = 0; i < (int) strlen(text); i++) { numberBuffer = sizeof(int) * countIntLength(textKeyChain[i]); @@ -122,7 +122,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags) strcat(returningText, textBuffer); - if (i != strlen(text) - 1) + if (i != (int) strlen(text) - 1) { textBuffer = realloc(textBuffer, 2); sprintf(textBuffer, "%c", getEncryptionSeparator()); diff --git a/src/lib/flags.c b/src/lib/flags.c index 3acedd3..011976c 100644 --- a/src/lib/flags.c +++ b/src/lib/flags.c @@ -23,7 +23,7 @@ outputFlags noOutput(unsigned char exitCode) emptyText[0] = '\0'; char *emptyKey = malloc(getKeyLength() + 1); //KEY - for (int i = 0; i < getKeyLength(); i++) + for (int i = 0; i < (int) getKeyLength(); i++) { emptyKey[i] = 'x'; } diff --git a/src/lib/misc.c b/src/lib/misc.c index f76fdc7..252fe63 100644 --- a/src/lib/misc.c +++ b/src/lib/misc.c @@ -13,7 +13,7 @@ #include -int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) +int unlink_cb(const char *fpath, UNUSED const struct stat *sb, UNUSED int typeflag, UNUSED struct FTW *ftwbuf) { int rv = remove(fpath); @@ -208,7 +208,7 @@ unsigned char checkVersion(inputFlags flags) json_object_object_get_ex(parsedJson, "deprecated", &deprecated); //COUNT versionsIndex - for (int i = 0; i < json_object_array_length(deprecated); i++) + for (int i = 0; i < (int) json_object_array_length(deprecated); i++) { //IT'S A MATCH, BABY :D if (strcmp(json_object_get_string(json_object_array_get_idx(deprecated, i)), VERSION) == 0) @@ -258,7 +258,7 @@ void generateTextKeyChain(char *key, int *textKeyChain, int textKeyChainSize) numberBuffer = i; //CHECK, IF numberBuffer ISN'T GREATER THAN keyLength AND CUT UNUSED LENGTH - while (numberBuffer >= getKeyLength()) + while (numberBuffer >= (int) getKeyLength()) { numberBuffer -= getKeyLength(); }