src/server/util/util.c

changeset 103
d3b514e2ddbd
parent 102
136a76e293b5
child 104
a8acbb12f27c
equal deleted inserted replaced
102:136a76e293b5 103:d3b514e2ddbd
605 605
606 /* ---------------------------- util_mstr2num ----------------------------- */ 606 /* ---------------------------- util_mstr2num ----------------------------- */
607 607
608 static const int MSTR2NUM_HT_MASK = 0xf; 608 static const int MSTR2NUM_HT_MASK = 0xf;
609 609
610 static const struct { 610 struct mstr2num_ht {
611 unsigned ucmstr; // Uppercase 3 character month string in a machine word 611 unsigned ucmstr; // Uppercase 3 character month string in a machine word
612 int mnum; // 0-based month number for this month string 612 int mnum; // 0-based month number for this month string
613 } MSTR2NUM_HT[MSTR2NUM_HT_MASK + 1] = { 613 };
614
615 struct mstr2num_ht MSTR2NUM_HT[] = {
614 { 'A' << 16 | 'P' << 8 | 'R', 3 }, 616 { 'A' << 16 | 'P' << 8 | 'R', 3 },
615 { 'S' << 16 | 'E' << 8 | 'P', 8 }, 617 { 'S' << 16 | 'E' << 8 | 'P', 8 },
616 { 'M' << 16 | 'A' << 8 | 'Y', 4 }, 618 { 'M' << 16 | 'A' << 8 | 'Y', 4 },
617 { 0, -1 }, 619 { 0, -1 },
618 { 'M' << 16 | 'A' << 8 | 'R', 2 }, 620 { 'M' << 16 | 'A' << 8 | 'R', 2 },

mercurial