Coverage Report

Created: 2026-01-09 06:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/resiprocate/resip/stack/gen/DayOfWeekHash.cxx
Line
Count
Source
1
/* C++ code produced by gperf version 3.1 */
2
/* Command-line: gperf -C -D -E -L C++ -t --key-positions='*' --compare-strncmp -Z DayOfWeekHash DayOfWeekHash.gperf  */
3
4
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
5
      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
6
      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
7
      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
8
      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
9
      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
10
      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
11
      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
12
      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
13
      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
14
      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
15
      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
16
      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
17
      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
18
      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
19
      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
20
      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
21
      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
22
      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
23
      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
24
      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
25
      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
26
      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
27
/* The character set is not based on ISO-646.  */
28
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
29
#endif
30
31
#line 1 "DayOfWeekHash.gperf"
32
33
#include <string.h>
34
#include <ctype.h>
35
#include "resip/stack/DateCategory.hxx"
36
37
namespace resip
38
{
39
#line 9 "DayOfWeekHash.gperf"
40
struct days { const char *name; DayOfWeek type; };
41
/* maximum key range = 16, duplicates = 0 */
42
43
class DayOfWeekHash
44
{
45
private:
46
  static inline unsigned int hash (const char *str, size_t len);
47
public:
48
  static const struct days *in_word_set (const char *str, size_t len);
49
};
50
51
inline unsigned int
52
DayOfWeekHash::hash (const char *str, size_t len)
53
39
{
54
39
  static const unsigned char asso_values[] =
55
39
    {
56
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
57
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
58
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
59
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
60
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
61
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
62
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
63
39
       2, 16, 16, 16, 16, 16, 16,  2, 16, 16,
64
39
      16, 16, 16,  0,  5, 16, 16,  2, 16, 16,
65
39
      16, 16, 16, 16, 16, 16, 16,  0, 16, 16,
66
39
       0,  5, 16, 16,  0,  5, 16, 16, 16, 16,
67
39
       0,  0, 16, 16,  5, 16,  0,  5, 16, 16,
68
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
69
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
70
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
71
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
72
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
73
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
74
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
75
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
76
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
77
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
78
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
79
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
80
39
      16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
81
39
      16, 16, 16, 16, 16, 16
82
39
    };
83
39
  return asso_values[static_cast<unsigned char>(str[2])] + asso_values[static_cast<unsigned char>(str[1])] + asso_values[static_cast<unsigned char>(str[0])];
84
39
}
85
86
const struct days *
87
DayOfWeekHash::in_word_set (const char *str, size_t len)
88
860
{
89
860
  enum
90
860
    {
91
860
      TOTAL_KEYWORDS = 7,
92
860
      MIN_WORD_LENGTH = 3,
93
860
      MAX_WORD_LENGTH = 3,
94
860
      MIN_HASH_VALUE = 0,
95
860
      MAX_HASH_VALUE = 15
96
860
    };
97
98
860
  static const struct days wordlist[] =
99
860
    {
100
860
#line 17 "DayOfWeekHash.gperf"
101
860
      {"Sat", Sat},
102
860
#line 12 "DayOfWeekHash.gperf"
103
860
      {"Mon", Mon},
104
860
#line 11 "DayOfWeekHash.gperf"
105
860
      {"Sun", Sun},
106
860
#line 14 "DayOfWeekHash.gperf"
107
860
      {"Wed", Wed},
108
860
#line 15 "DayOfWeekHash.gperf"
109
860
      {"Thu", Thu},
110
860
#line 16 "DayOfWeekHash.gperf"
111
860
      {"Fri", Fri},
112
860
#line 13 "DayOfWeekHash.gperf"
113
860
      {"Tue", Tue}
114
860
    };
115
116
860
  static const signed char lookup[] =
117
860
    {
118
860
       0, -1,  1, -1, -1,  2, -1,  3, -1, -1,  4, -1,  5, -1,
119
860
      -1,  6
120
860
    };
121
122
860
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
123
39
    {
124
39
      unsigned int key = hash (str, len);
125
126
39
      if (key <= MAX_HASH_VALUE)
127
19
        {
128
19
          int index = lookup[key];
129
130
19
          if (index >= 0)
131
18
            {
132
18
              const char *s = wordlist[index].name;
133
134
18
              if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
135
1
                return &wordlist[index];
136
18
            }
137
19
        }
138
39
    }
139
859
  return 0;
140
860
}
141
#line 18 "DayOfWeekHash.gperf"
142
143
}