formatting

This commit is contained in:
Joseph Poirier 2015-06-07 02:11:13 -05:00
parent b17156c9cc
commit f9ffd4e6e8
2 changed files with 16 additions and 15 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@
*.exp *.exp
picoc picoc
build/* build/*
archives/

View file

@ -65,7 +65,7 @@ void StdStrftime(struct ParseState *Parser, struct Value *ReturnValue, struct Va
void StdStrptime(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs) void StdStrptime(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
{ {
extern char *strptime(const char *s, const char *format, struct tm *tm); extern char *strptime(const char *s, const char *format, struct tm *tm);
ReturnValue->Val->Pointer = strptime(Param[0]->Val->Pointer, Param[1]->Val->Pointer, Param[2]->Val->Pointer); ReturnValue->Val->Pointer = strptime(Param[0]->Val->Pointer, Param[1]->Val->Pointer, Param[2]->Val->Pointer);
} }
@ -89,23 +89,23 @@ typedef int clock_t;\
/* all string.h functions */ /* all string.h functions */
struct LibraryFunction StdTimeFunctions[] = struct LibraryFunction StdTimeFunctions[] =
{ {
{ StdAsctime, "char *asctime(struct tm *);" }, {StdAsctime, "char *asctime(struct tm *);"},
{ StdClock, "time_t clock();" }, {StdClock, "time_t clock();"},
{ StdCtime, "char *ctime(int *);" }, {StdCtime, "char *ctime(int *);"},
#ifndef NO_FP #ifndef NO_FP
{ StdDifftime, "double difftime(int, int);" }, {StdDifftime, "double difftime(int, int);"},
#endif #endif
{ StdGmtime, "struct tm *gmtime(int *);" }, {StdGmtime, "struct tm *gmtime(int *);"},
{ StdLocaltime, "struct tm *localtime(int *);" }, {StdLocaltime, "struct tm *localtime(int *);"},
{ StdMktime, "int mktime(struct tm *ptm);" }, {StdMktime, "int mktime(struct tm *ptm);"},
{ StdTime, "int time(int *);" }, {StdTime, "int time(int *);"},
{ StdStrftime, "int strftime(char *, int, char *, struct tm *);" }, {StdStrftime, "int strftime(char *, int, char *, struct tm *);"},
#ifndef WIN32 #ifndef WIN32
{ StdStrptime, "char *strptime(char *, char *, struct tm *);" }, {StdStrptime, "char *strptime(char *, char *, struct tm *);"},
{ StdGmtime_r, "struct tm *gmtime_r(int *, struct tm *);" }, {StdGmtime_r, "struct tm *gmtime_r(int *, struct tm *);"},
{ StdTimegm, "int timegm(struct tm *);" }, {StdTimegm, "int timegm(struct tm *);"},
#endif #endif
{ NULL, NULL } {NULL, NULL}
}; };
@ -114,7 +114,7 @@ void StdTimeSetupFunc(Picoc *pc)
{ {
/* make a "struct tm" which is the same size as a native tm structure */ /* make a "struct tm" which is the same size as a native tm structure */
TypeCreateOpaqueStruct(pc, NULL, TableStrRegister(pc, "tm"), sizeof(struct tm)); TypeCreateOpaqueStruct(pc, NULL, TableStrRegister(pc, "tm"), sizeof(struct tm));
/* define CLK_PER_SEC etc. */ /* define CLK_PER_SEC etc. */
VariableDefinePlatformVar(pc, NULL, "CLOCKS_PER_SEC", &pc->IntType, (union AnyValue *)&CLOCKS_PER_SECValue, FALSE); VariableDefinePlatformVar(pc, NULL, "CLOCKS_PER_SEC", &pc->IntType, (union AnyValue *)&CLOCKS_PER_SECValue, FALSE);
#ifdef CLK_PER_SEC #ifdef CLK_PER_SEC