projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
No need to define the month and day names a second time
[mmh]
/
sbr
/
dtimep.lex
diff --git
a/sbr/dtimep.lex
b/sbr/dtimep.lex
index
e06a068
..
4f07aac
100644
(file)
--- a/
sbr/dtimep.lex
+++ b/
sbr/dtimep.lex
@@
-56,16
+56,6
@@
*/
int europeandate = 0;
*/
int europeandate = 0;
-static char *monthnames[] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
- NULL
-};
-
-static char *daynames[] = {
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", NULL
-};
-
static int
name2num(char *name, char *names[])
{
static int
name2num(char *name, char *names[])
{
@@
-91,9
+81,9
@@
name2num(char *name, char *names[])
*/
#define INIT() { cp = yytext;}
*/
#define INIT() { cp = yytext;}
-#define SETWDAY() { tw.tw_wday = name2num(cp, daynames); \
+#define SETWDAY() { tw.tw_wday = name2num(cp, tw_dotw); \
tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; SKIPA(); }
tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; SKIPA(); }
-#define SETMON() { tw.tw_mon = name2num(cp, monthnames); SKIPA(); }
+#define SETMON() { tw.tw_mon = name2num(cp, tw_moty); SKIPA(); }
#define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; SKIPD(); }
#define SETYEAR() { tw.tw_year = atoi(cp); SKIPD(); }
#define SETDAY() { tw.tw_mday = atoi(cp); tw.tw_flags |= TW_YES; SKIPD(); }
#define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; SKIPD(); }
#define SETYEAR() { tw.tw_year = atoi(cp); SKIPD(); }
#define SETDAY() { tw.tw_mday = atoi(cp); tw.tw_flags |= TW_YES; SKIPD(); }