diff --git a/cstdlib/stdio.c b/cstdlib/stdio.c index 7915599..86f8705 100644 --- a/cstdlib/stdio.c +++ b/cstdlib/stdio.c @@ -396,17 +396,17 @@ void StdioTmpfile(struct ParseState *Parser, struct Value *ReturnValue, struct V void StdioClearerr(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { - clearerr(Param[0]->Val->Pointer); + clearerr((FILE *)Param[0]->Val->Pointer); } void StdioFeof(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { - ReturnValue->Val->Integer = feof(Param[0]->Val->Pointer); + ReturnValue->Val->Integer = feof((FILE *)Param[0]->Val->Pointer); } void StdioFerror(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) { - ReturnValue->Val->Integer = ferror(Param[0]->Val->Pointer); + ReturnValue->Val->Integer = ferror((FILE *)Param[0]->Val->Pointer); } void StdioFileno(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) diff --git a/lex.c b/lex.c index 8314f21..6a81a6e 100644 --- a/lex.c +++ b/lex.c @@ -205,7 +205,7 @@ enum LexToken LexGetWord(struct LexState *Lexer, struct Value *Value) do { LEXER_INC(Lexer); - } while (Lexer->Pos != Lexer->End && isCident(*Lexer->Pos)); + } while (Lexer->Pos != Lexer->End && isCident((int)*Lexer->Pos)); Value->Typ = NULL; Value->Val->Identifier = TableStrRegister2(StartPos, Lexer->Pos - StartPos); @@ -367,7 +367,7 @@ enum LexToken LexScanGetToken(struct LexState *Lexer, struct Value **Value) do { *Value = &LexValue; - while (Lexer->Pos != Lexer->End && isspace(*Lexer->Pos)) + while (Lexer->Pos != Lexer->End && isspace((int)*Lexer->Pos)) { if (*Lexer->Pos == '\n') { @@ -387,10 +387,10 @@ enum LexToken LexScanGetToken(struct LexState *Lexer, struct Value **Value) return TokenEOF; ThisChar = *Lexer->Pos; - if (isCidstart(ThisChar)) + if (isCidstart((int)ThisChar)) return LexGetWord(Lexer, *Value); - if (isdigit(ThisChar)) + if (isdigit((int)ThisChar)) return LexGetNumber(Lexer, *Value); NextChar = (Lexer->Pos+1 != Lexer->End) ? *(Lexer->Pos+1) : 0; diff --git a/tests/28_strings.c b/tests/28_strings.c index 24e80bd..862800e 100644 --- a/tests/28_strings.c +++ b/tests/28_strings.c @@ -9,9 +9,9 @@ printf("%s\n", a); strncpy(a, "gosh", 2); printf("%s\n", a); -printf("%d\n", strcmp(a, "apple")); -printf("%d\n", strcmp(a, "goere")); -printf("%d\n", strcmp(a, "zebra")); +printf("%d\n", strcmp(a, "apple") > 0); +printf("%d\n", strcmp(a, "goere") > 0); +printf("%d\n", strcmp(a, "zebra") < 0); printf("%d\n", strlen(a)); @@ -33,7 +33,7 @@ printf("%s\n", a); memcpy(&a[2], a, 2); printf("%s\n", a); -printf("%d\n", memcmp(a, "apple", 4)); -printf("%d\n", memcmp(a, "grgr", 4)); -printf("%d\n", memcmp(a, "zebra", 4)); +printf("%d\n", memcmp(a, "apple", 4) > 0); +printf("%d\n", memcmp(a, "grgr", 4) == 0); +printf("%d\n", memcmp(a, "zebra", 4) < 0); diff --git a/tests/28_strings.expect b/tests/28_strings.expect index d016865..fd9217a 100644 --- a/tests/28_strings.expect +++ b/tests/28_strings.expect @@ -2,7 +2,7 @@ hello gollo 1 1 --1 +1 5 gollo! 1 @@ -15,5 +15,5 @@ lo! grrrr! grgrr! 1 -0 --1 +1 +1