biatch, added every missing type cast
if you're asking why, look at next commit
This commit is contained in:
parent
d293941646
commit
9ffefa4419
@ -51,7 +51,7 @@ outputFlags decryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
strcpy(key, keyNew);
|
strcpy(key, keyNew);
|
||||||
|
|
||||||
//GET LENGTH OF returningText AND textKeyChain
|
//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++;
|
if (text[i] == getEncryptionSeparator()) numberBuffer++;
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ outputFlags decryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
numberBuffer = 0;
|
numberBuffer = 0;
|
||||||
|
|
||||||
//GET LENGTH OF EACH CHARACTER
|
//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;
|
if (text[j] == getEncryptionSeparator()) break;
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ outputFlags decryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
textBuffer = malloc(numberBuffer + 1);
|
textBuffer = malloc(numberBuffer + 1);
|
||||||
|
|
||||||
//LOAD textBuffer
|
//LOAD textBuffer
|
||||||
for (int j = 0; j < strlen(text); j++)
|
for (int j = 0; j < (int) strlen(text); j++)
|
||||||
{
|
{
|
||||||
textBuffer[j] = text[j];
|
textBuffer[j] = text[j];
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//LOAD KEY
|
//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
|
//SET numberBuffer TO RANDOM NUMBER BETWEEN 0 AND 52
|
||||||
numberBuffer = (rand() % 52) + 1;
|
numberBuffer = (rand() % 52) + 1;
|
||||||
@ -89,13 +89,13 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
generateTextKeyChain(key, textKeyChain, strlen(text));
|
generateTextKeyChain(key, textKeyChain, strlen(text));
|
||||||
|
|
||||||
//ACTUALLY ENCRYPT 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];
|
textKeyChain[i] -= (int) text[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
//COUNT REQUIRED SIZE FOR returningText
|
//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]);
|
numberBuffer += countIntLength(textKeyChain[i]);
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
strcpy(returningText, "");
|
strcpy(returningText, "");
|
||||||
|
|
||||||
//LOAD 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]);
|
numberBuffer = sizeof(int) * countIntLength(textKeyChain[i]);
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
|
|
||||||
strcat(returningText, textBuffer);
|
strcat(returningText, textBuffer);
|
||||||
|
|
||||||
if (i != strlen(text) - 1)
|
if (i != (int) strlen(text) - 1)
|
||||||
{
|
{
|
||||||
textBuffer = realloc(textBuffer, 2);
|
textBuffer = realloc(textBuffer, 2);
|
||||||
sprintf(textBuffer, "%c", getEncryptionSeparator());
|
sprintf(textBuffer, "%c", getEncryptionSeparator());
|
||||||
|
@ -23,7 +23,7 @@ outputFlags noOutput(unsigned char exitCode)
|
|||||||
emptyText[0] = '\0';
|
emptyText[0] = '\0';
|
||||||
|
|
||||||
char *emptyKey = malloc(getKeyLength() + 1); //KEY
|
char *emptyKey = malloc(getKeyLength() + 1); //KEY
|
||||||
for (int i = 0; i < getKeyLength(); i++)
|
for (int i = 0; i < (int) getKeyLength(); i++)
|
||||||
{
|
{
|
||||||
emptyKey[i] = 'x';
|
emptyKey[i] = 'x';
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include <why2/flags.h>
|
#include <why2/flags.h>
|
||||||
|
|
||||||
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);
|
int rv = remove(fpath);
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ unsigned char checkVersion(inputFlags flags)
|
|||||||
json_object_object_get_ex(parsedJson, "deprecated", &deprecated);
|
json_object_object_get_ex(parsedJson, "deprecated", &deprecated);
|
||||||
|
|
||||||
//COUNT versionsIndex
|
//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
|
//IT'S A MATCH, BABY :D
|
||||||
if (strcmp(json_object_get_string(json_object_array_get_idx(deprecated, i)), VERSION) == 0)
|
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;
|
numberBuffer = i;
|
||||||
|
|
||||||
//CHECK, IF numberBuffer ISN'T GREATER THAN keyLength AND CUT UNUSED LENGTH
|
//CHECK, IF numberBuffer ISN'T GREATER THAN keyLength AND CUT UNUSED LENGTH
|
||||||
while (numberBuffer >= getKeyLength())
|
while (numberBuffer >= (int) getKeyLength())
|
||||||
{
|
{
|
||||||
numberBuffer -= getKeyLength();
|
numberBuffer -= getKeyLength();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user