X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fdtimep.lex;h=2e79c46c9da2af88aad9639748a2d258a970dd92;hb=2bb7e26c6ae27f9b8a0ca9e5b7ddd1c824bcedda;hp=4f019808c42d844a1643e0856c56c1b493a7170e;hpb=859187428420e9089e91a45f3a833135172d1822;p=mmh diff --git a/sbr/dtimep.lex b/sbr/dtimep.lex index 4f01980..2e79c46 100644 --- a/sbr/dtimep.lex +++ b/sbr/dtimep.lex @@ -86,8 +86,10 @@ static int month_map[] = { }; /* - * Same trick for day-of-week using the hash function - * (c1 & 7) + (c2 & 4) + * Lookup table for day-of-week using the same hash trick as for above name-of- + * month table, but using the first and second character, not second and third. + * + * Compute index into table using: (day_name[0] & 7) + (day_name[1] & 4) */ static int day_map[] = { 0, @@ -115,8 +117,7 @@ static int day_map[] = { */ #define INIT() { cp = yytext;} -#define SETWDAY() { cp++; \ - tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \ +#define SETWDAY() { tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \ tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \ SKIPA(); } #define SETMON() { cp++; \