Fixed compile on cygwin
git-svn-id: http://picoc.googlecode.com/svn/trunk@446 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
08b08595f4
commit
06acdabc6f
|
@ -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)
|
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)
|
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)
|
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)
|
void StdioFileno(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
||||||
|
|
8
lex.c
8
lex.c
|
@ -205,7 +205,7 @@ enum LexToken LexGetWord(struct LexState *Lexer, struct Value *Value)
|
||||||
|
|
||||||
do {
|
do {
|
||||||
LEXER_INC(Lexer);
|
LEXER_INC(Lexer);
|
||||||
} while (Lexer->Pos != Lexer->End && isCident(*Lexer->Pos));
|
} while (Lexer->Pos != Lexer->End && isCident((int)*Lexer->Pos));
|
||||||
|
|
||||||
Value->Typ = NULL;
|
Value->Typ = NULL;
|
||||||
Value->Val->Identifier = TableStrRegister2(StartPos, Lexer->Pos - StartPos);
|
Value->Val->Identifier = TableStrRegister2(StartPos, Lexer->Pos - StartPos);
|
||||||
|
@ -367,7 +367,7 @@ enum LexToken LexScanGetToken(struct LexState *Lexer, struct Value **Value)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
*Value = &LexValue;
|
*Value = &LexValue;
|
||||||
while (Lexer->Pos != Lexer->End && isspace(*Lexer->Pos))
|
while (Lexer->Pos != Lexer->End && isspace((int)*Lexer->Pos))
|
||||||
{
|
{
|
||||||
if (*Lexer->Pos == '\n')
|
if (*Lexer->Pos == '\n')
|
||||||
{
|
{
|
||||||
|
@ -387,10 +387,10 @@ enum LexToken LexScanGetToken(struct LexState *Lexer, struct Value **Value)
|
||||||
return TokenEOF;
|
return TokenEOF;
|
||||||
|
|
||||||
ThisChar = *Lexer->Pos;
|
ThisChar = *Lexer->Pos;
|
||||||
if (isCidstart(ThisChar))
|
if (isCidstart((int)ThisChar))
|
||||||
return LexGetWord(Lexer, *Value);
|
return LexGetWord(Lexer, *Value);
|
||||||
|
|
||||||
if (isdigit(ThisChar))
|
if (isdigit((int)ThisChar))
|
||||||
return LexGetNumber(Lexer, *Value);
|
return LexGetNumber(Lexer, *Value);
|
||||||
|
|
||||||
NextChar = (Lexer->Pos+1 != Lexer->End) ? *(Lexer->Pos+1) : 0;
|
NextChar = (Lexer->Pos+1 != Lexer->End) ? *(Lexer->Pos+1) : 0;
|
||||||
|
|
|
@ -9,9 +9,9 @@ printf("%s\n", a);
|
||||||
strncpy(a, "gosh", 2);
|
strncpy(a, "gosh", 2);
|
||||||
printf("%s\n", a);
|
printf("%s\n", a);
|
||||||
|
|
||||||
printf("%d\n", strcmp(a, "apple"));
|
printf("%d\n", strcmp(a, "apple") > 0);
|
||||||
printf("%d\n", strcmp(a, "goere"));
|
printf("%d\n", strcmp(a, "goere") > 0);
|
||||||
printf("%d\n", strcmp(a, "zebra"));
|
printf("%d\n", strcmp(a, "zebra") < 0);
|
||||||
|
|
||||||
printf("%d\n", strlen(a));
|
printf("%d\n", strlen(a));
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ printf("%s\n", a);
|
||||||
memcpy(&a[2], a, 2);
|
memcpy(&a[2], a, 2);
|
||||||
printf("%s\n", a);
|
printf("%s\n", a);
|
||||||
|
|
||||||
printf("%d\n", memcmp(a, "apple", 4));
|
printf("%d\n", memcmp(a, "apple", 4) > 0);
|
||||||
printf("%d\n", memcmp(a, "grgr", 4));
|
printf("%d\n", memcmp(a, "grgr", 4) == 0);
|
||||||
printf("%d\n", memcmp(a, "zebra", 4));
|
printf("%d\n", memcmp(a, "zebra", 4) < 0);
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ hello
|
||||||
gollo
|
gollo
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
-1
|
1
|
||||||
5
|
5
|
||||||
gollo!
|
gollo!
|
||||||
1
|
1
|
||||||
|
@ -15,5 +15,5 @@ lo!
|
||||||
grrrr!
|
grrrr!
|
||||||
grgrr!
|
grgrr!
|
||||||
1
|
1
|
||||||
0
|
1
|
||||||
-1
|
1
|
||||||
|
|
Loading…
Reference in a new issue