diff --git a/scanner.c b/scanner.c index 925d3f8..e5b463c 100755 --- a/scanner.c +++ b/scanner.c @@ -372,7 +372,7 @@ int char_class(char c) Return values: Token */ Token aa_func02(char lexeme[]) { - unsigned int i, kw_idx, offset; /* Variable to contain keyword table index */ + unsigned kw_idx, offset; /* Variable to contain keyword table index */ Token t; char v_type; char* temp_str; @@ -431,7 +431,7 @@ Token aa_func02(char lexeme[]) { */ Token aa_func03(char lexeme[]) { Token t; - unsigned int i, offset; + unsigned offset; char* temp_str; if ((temp_str = (char*)calloc(VID_LEN + 2, sizeof(char))) == NULL) { return aa_table[ES]("RUN TIME ERROR: "); diff --git a/stable.c b/stable.c index d28ced3..422e70e 100644 --- a/stable.c +++ b/stable.c @@ -60,7 +60,6 @@ STD st_create(int st_size){ */ int st_install(STD s_table, char *lexeme, char type, int line){ unsigned int offset, i; - char f_realloc; /* Reallocation flag */ /* Cannot add new entry, table full */ if (s_table.st_offset >= s_table.st_size) @@ -78,9 +77,6 @@ int st_install(STD s_table, char *lexeme, char type, int line){ for (i = 0; i < strlen(lexeme); ++i){ if (!b_addc(s_table.plsBD, lexeme[i])) return -1; - - if (b_rflag(s_table.plsBD) == SET_R_FLAG) - f_realloc = SET_R_FLAG; } if (!b_addc(s_table.plsBD, '\0')) @@ -107,7 +103,7 @@ int st_install(STD s_table, char *lexeme, char type, int line){ } /* TODO: Handle reallocation flag behaviour - if (f_realloc == SET_R_FLAG){ + if (b_rflag(s_table.plsBD) == SET_R_FLAG){ } */ @@ -293,12 +289,14 @@ int st_store(STD s_table){ int i; /* Windows does not like fopen, and fopen_s is Windows-only. This will ensure the - * use of the proper function call if PLATYPUS is being built on a non-windows system + * use of the proper function call if PLATYPUS is being built on a non-windows system. + * Best approach is to add _CRT_SECURE_NO_WARNINGS to the preprocessor definitions, but + * this works, too. */ #ifdef _WIN32 if(fopen_s(&out, ST_FILE_NAME, "w+") != 0) #else - if ((out = fopen(ST_FILE_NAME, "w+")) == NULL) + if ((out = fopen(ST_FILE_NAME, "w+")) == NULL) #endif return -1; /* Can't open file, stop. */ @@ -357,5 +355,8 @@ static void st_incoffset(void){ * Algorithm: */ int st_sort(STD s_table, char s_order){ + /* Compiler warning about unused parameter, + * this is fine for this "future" implementation + */ return 0; /* SYKE! */ }