| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | | - |
| 11 | | - |
| 12 | | - |
| 13 | | - |
| 14 | | - |
| 15 | | - |
| 16 | static BUCKET_CONTENTS *copy_bucket_array (BUCKET_CONTENTS *, sh_string_func_t *); | - |
| 17 | | - |
| 18 | | - |
| 19 | | - |
| 20 | HASH_TABLE * | - |
| 21 | hash_create (buckets) | - |
| 22 | int buckets; | - |
| 23 | { | - |
| 24 | HASH_TABLE *new_table; | - |
| 25 | register int i; | - |
| 26 | | - |
| 27 | new_table = (HASH_TABLE *)sh_xmalloc((sizeof (HASH_TABLE)), "hashlib.c", 52); | - |
| 28 | if (buckets == 0| TRUE | evaluated 11010 times by 1 test | | FALSE | evaluated 20047 times by 1 test |
) | 11010-20047 |
| 29 | buckets = 128;executed 11010 times by 1 test: buckets = 128; | 11010 |
| 30 | | - |
| 31 | new_table->bucket_array = | - |
| 32 | (BUCKET_CONTENTS **)sh_xmalloc((buckets * sizeof (BUCKET_CONTENTS *)), "hashlib.c", 57); | - |
| 33 | new_table->nbuckets = buckets; | - |
| 34 | new_table->nentries = 0; | - |
| 35 | | - |
| 36 | for (i = 0; i < buckets| TRUE | evaluated 12654064 times by 1 test | | FALSE | evaluated 31057 times by 1 test |
; i++) | 31057-12654064 |
| 37 | new_table->bucket_array[i] = (BUCKET_CONTENTS *)executed 12654064 times by 1 test: new_table->bucket_array[i] = (BUCKET_CONTENTS *) ((void *)0) ; | 12654064 |
| 38 | ((void *)0)executed 12654064 times by 1 test: new_table->bucket_array[i] = (BUCKET_CONTENTS *) ((void *)0) ; | 12654064 |
| 39 | ;executed 12654064 times by 1 test: new_table->bucket_array[i] = (BUCKET_CONTENTS *) ((void *)0) ; | 12654064 |
| 40 | | - |
| 41 | returnexecuted 31057 times by 1 test: return (new_table); (new_table);executed 31057 times by 1 test: return (new_table); | 31057 |
| 42 | } | - |
| 43 | | - |
| 44 | int | - |
| 45 | hash_size (table) | - |
| 46 | HASH_TABLE *table; | - |
| 47 | { | - |
| 48 | return never executed: return (((table) ? (table)->nentries : 0)); (((table) ? (table)->nentries : 0));never executed: return (((table) ? (table)->nentries : 0)); | 0 |
| 49 | } | - |
| 50 | | - |
| 51 | static BUCKET_CONTENTS * | - |
| 52 | copy_bucket_array (ba, cpdata) | - |
| 53 | BUCKET_CONTENTS *ba; | - |
| 54 | sh_string_func_t *cpdata; | - |
| 55 | { | - |
| 56 | BUCKET_CONTENTS *new_bucket, *n, *e; | - |
| 57 | | - |
| 58 | if (ba == 0| TRUE | evaluated 2472 times by 1 test | | FALSE | evaluated 88 times by 1 test |
) | 88-2472 |
| 59 | returnexecuted 2472 times by 1 test: return ((BUCKET_CONTENTS *)0); ((BUCKET_CONTENTS *)0);executed 2472 times by 1 test: return ((BUCKET_CONTENTS *)0); | 2472 |
| 60 | | - |
| 61 | for (n = (BUCKET_CONTENTS *)0, e = ba; e| TRUE | evaluated 88 times by 1 test | | FALSE | evaluated 88 times by 1 test |
; e = e->next) | 88 |
| 62 | { | - |
| 63 | if (n == 0| TRUE | evaluated 88 times by 1 test | | FALSE | never evaluated |
) | 0-88 |
| 64 | { | - |
| 65 | new_bucket = (BUCKET_CONTENTS *)sh_xmalloc((sizeof (BUCKET_CONTENTS)), "hashlib.c", 88); | - |
| 66 | n = new_bucket; | - |
| 67 | }executed 88 times by 1 test: end of block | 88 |
| 68 | else | - |
| 69 | { | - |
| 70 | n->next = (BUCKET_CONTENTS *)sh_xmalloc((sizeof (BUCKET_CONTENTS)), "hashlib.c", 93); | - |
| 71 | n = n->next; | - |
| 72 | } never executed: end of block | 0 |
| 73 | | - |
| 74 | n->key = (char *)strcpy (sh_xmalloc((1 + strlen (e->key)), "hashlib.c", 97), (e->key)); | - |
| 75 | n->data = e->data| TRUE | evaluated 88 times by 1 test | | FALSE | never evaluated |
? (cpdata| TRUE | never evaluated | | FALSE | evaluated 88 times by 1 test |
? (*cpdata) (e->data) : (char *)strcpy (sh_xmalloc((1 + strlen (e->data)), "hashlib.c", 98), (e->data))) | 0-88 |
| 76 | : | - |
| 77 | ((void *)0) | - |
| 78 | ; | - |
| 79 | n->khash = e->khash; | - |
| 80 | n->times_found = e->times_found; | - |
| 81 | n->next = (BUCKET_CONTENTS *) | - |
| 82 | ((void *)0) | - |
| 83 | ; | - |
| 84 | }executed 88 times by 1 test: end of block | 88 |
| 85 | | - |
| 86 | returnexecuted 88 times by 1 test: return new_bucket; new_bucket;executed 88 times by 1 test: return new_bucket; | 88 |
| 87 | } | - |
| 88 | | - |
| 89 | HASH_TABLE * | - |
| 90 | hash_copy (table, cpdata) | - |
| 91 | HASH_TABLE *table; | - |
| 92 | sh_string_func_t *cpdata; | - |
| 93 | { | - |
| 94 | HASH_TABLE *new_table; | - |
| 95 | int i; | - |
| 96 | | - |
| 97 | if (table == 0| TRUE | never evaluated | | FALSE | evaluated 20 times by 1 test |
) | 0-20 |
| 98 | return never executed: return ((HASH_TABLE *) ((void *)0) ); ((HASH_TABLE *)never executed: return ((HASH_TABLE *) ((void *)0) ); | 0 |
| 99 | ((void *)0) never executed: return ((HASH_TABLE *) ((void *)0) ); | 0 |
| 100 | ); never executed: return ((HASH_TABLE *) ((void *)0) ); | 0 |
| 101 | | - |
| 102 | new_table = hash_create (table->nbuckets); | - |
| 103 | | - |
| 104 | for (i = 0; i < table->nbuckets| TRUE | evaluated 2560 times by 1 test | | FALSE | evaluated 20 times by 1 test |
; i++) | 20-2560 |
| 105 | new_table->bucket_array[i] = copy_bucket_array (table->bucket_array[i], cpdata);executed 2560 times by 1 test: new_table->bucket_array[i] = copy_bucket_array (table->bucket_array[i], cpdata); | 2560 |
| 106 | | - |
| 107 | new_table->nentries = table->nentries; | - |
| 108 | returnexecuted 20 times by 1 test: return new_table; new_table;executed 20 times by 1 test: return new_table; | 20 |
| 109 | } | - |
| 110 | | - |
| 111 | | - |
| 112 | | - |
| 113 | unsigned int | - |
| 114 | hash_string (s) | - |
| 115 | const char *s; | - |
| 116 | { | - |
| 117 | register unsigned int i; | - |
| 118 | | - |
| 119 | | - |
| 120 | | - |
| 121 | | - |
| 122 | | - |
| 123 | | - |
| 124 | for (i = 0; *| TRUE | evaluated 1450221733 times by 1 test | | FALSE | evaluated 353387759 times by 1 test |
s| TRUE | evaluated 1450221733 times by 1 test | | FALSE | evaluated 353387759 times by 1 test |
; s++) | 353387759-1450221733 |
| 125 | { | - |
| 126 | i *= 16777619; | - |
| 127 | i ^= *s; | - |
| 128 | }executed 1450221733 times by 1 test: end of block | 1450221733 |
| 129 | | - |
| 130 | returnexecuted 353387759 times by 1 test: return i; i;executed 353387759 times by 1 test: return i; | 353387759 |
| 131 | } | - |
| 132 | | - |
| 133 | | - |
| 134 | | - |
| 135 | | - |
| 136 | int | - |
| 137 | hash_bucket (string, table) | - |
| 138 | const char *string; | - |
| 139 | HASH_TABLE *table; | - |
| 140 | { | - |
| 141 | unsigned int h; | - |
| 142 | | - |
| 143 | return never executed: return ((((h) = hash_string (string)) & ((table)->nbuckets - 1))); ((((h) = hash_string (string)) & ((table)->nbuckets - 1)));never executed: return ((((h) = hash_string (string)) & ((table)->nbuckets - 1))); | 0 |
| 144 | } | - |
| 145 | | - |
| 146 | | - |
| 147 | | - |
| 148 | BUCKET_CONTENTS * | - |
| 149 | hash_search (string, table, flags) | - |
| 150 | const char *string; | - |
| 151 | HASH_TABLE *table; | - |
| 152 | int flags; | - |
| 153 | { | - |
| 154 | BUCKET_CONTENTS *list; | - |
| 155 | int bucket; | - |
| 156 | unsigned int hv; | - |
| 157 | | - |
| 158 | if (table == 0| TRUE | evaluated 255305696 times by 1 test | | FALSE | evaluated 353014125 times by 1 test |
|| ((| TRUE | evaluated 353013535 times by 1 test | | FALSE | evaluated 590 times by 1 test |
flags & 0x02) == 0| TRUE | evaluated 353013535 times by 1 test | | FALSE | evaluated 590 times by 1 test |
&& ((| TRUE | evaluated 353013535 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 74418 times by 1 test | | FALSE | evaluated 352939117 times by 1 test |
table)| TRUE | evaluated 353013535 times by 1 test | | FALSE | never evaluated |
? (table)->nentries : 0) == 0| TRUE | evaluated 74418 times by 1 test | | FALSE | evaluated 352939117 times by 1 test |
)) | 0-353014125 |
| 159 | returnexecuted 255380114 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; (BUCKET_CONTENTS *)executed 255380114 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; | 255380114 |
| 160 | ((void *)0)executed 255380114 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; | 255380114 |
| 161 | ;executed 255380114 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; | 255380114 |
| 162 | | - |
| 163 | bucket = (((hv) = hash_string (string)) & ((table)->nbuckets - 1)); | - |
| 164 | | - |
| 165 | for (list = table->bucket_array ? table->bucket_array[bucket] : 0; list| TRUE | evaluated 319487111 times by 1 test | | FALSE | evaluated 35149839 times by 1 test |
; list = list->next) | 35149839-319487111 |
| 166 | { | - |
| 167 | | - |
| 168 | if (hv == list->khash| TRUE | evaluated 317789868 times by 1 test | | FALSE | evaluated 1697243 times by 1 test |
&& ((| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
list->key)[0] == (string)[0]| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
&& | 0-317789868 |
| 169 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 170 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 171 | ) && __builtin_constant_p (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 172 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 173 | ) && (__s1_len = __builtin_strlen (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 174 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 175 | ), __s2_len = __builtin_strlen (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 176 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 177 | ), (!((size_t)(const void *)((| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 178 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 179 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 180 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 181 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 182 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 183 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 184 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 185 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 186 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 187 | , | TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 188 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 189 | ) : (__builtin_constant_p (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 190 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 191 | ) && ((size_t)(const void *)((| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 192 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 193 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 194 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 195 | ) == 1) && (__s1_len = __builtin_strlen (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 196 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 197 | ), __s1_len < 4) ? (__builtin_constant_p (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 198 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 199 | ) && ((size_t)(const void *)((| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 200 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 201 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 202 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 203 | ) == 1) ? __builtin_strcmp (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 204 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 205 | , | TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 206 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 207 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 208 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 209 | ); int __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 210 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 211 | ))[0] - __s2[0]); if (__s1_len > 0| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 212 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 213 | ))[1] - __s2[1]); if (__s1_len > 1| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 214 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 215 | ))[2] - __s2[2]); if (__s1_len > 2| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( list->key ))[3] - __s2[3]); | TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 216 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( list->key ))[3] - __s2[3]); | 0-317789868 |
| 217 | ))[3] - __s2[3]);| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( list->key ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 218 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 219 | ) && ((size_t)(const void *)((| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 220 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 221 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 222 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 223 | ) == 1) && (__s2_len = __builtin_strlen (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 224 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 225 | ), __s2_len < 4) ? (__builtin_constant_p (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 226 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 227 | ) && ((size_t)(const void *)((| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 228 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 229 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 230 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 231 | ) == 1) ? __builtin_strcmp (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 232 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 233 | , | TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 234 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 235 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 236 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 237 | ); int __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 238 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 239 | ))[0] - __s2[0]); if (__s2_len > 0| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 240 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 241 | ))[1] - __s2[1]); if (__s2_len > 1| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 242 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 243 | ))[2] - __s2[2]); if (__s2_len > 2| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( string ))[3] - __s2[3]); | TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 244 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( string ))[3] - __s2[3]); | 0-317789868 |
| 245 | ))[3] - __s2[3]);| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( string ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : __builtin_strcmp (| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 246 | list->key| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 247 | , | TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 248 | string| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 249 | )))); }) | TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
| 0-317789868 |
| 250 | == 0| TRUE | evaluated 317789868 times by 1 test | | FALSE | never evaluated |
)) | 0-317789868 |
| 251 | { | - |
| 252 | list->times_found++; | - |
| 253 | returnexecuted 317789868 times by 1 test: return (list); (list);executed 317789868 times by 1 test: return (list); | 317789868 |
| 254 | } | - |
| 255 | }executed 1697243 times by 1 test: end of block | 1697243 |
| 256 | | - |
| 257 | if (flags & 0x02| TRUE | evaluated 562 times by 1 test | | FALSE | evaluated 35149277 times by 1 test |
) | 562-35149277 |
| 258 | { | - |
| 259 | list = (BUCKET_CONTENTS *)sh_xmalloc((sizeof (BUCKET_CONTENTS)), "hashlib.c", 192); | - |
| 260 | list->next = table->bucket_array[bucket]; | - |
| 261 | table->bucket_array[bucket] = list; | - |
| 262 | | - |
| 263 | list->data = | - |
| 264 | ((void *)0) | - |
| 265 | ; | - |
| 266 | list->key = (char *)string; | - |
| 267 | list->khash = hv; | - |
| 268 | list->times_found = 0; | - |
| 269 | | - |
| 270 | table->nentries++; | - |
| 271 | returnexecuted 562 times by 1 test: return (list); (list);executed 562 times by 1 test: return (list); | 562 |
| 272 | } | - |
| 273 | | - |
| 274 | returnexecuted 35149277 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; (BUCKET_CONTENTS *)executed 35149277 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; | 35149277 |
| 275 | ((void *)0)executed 35149277 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; | 35149277 |
| 276 | ;executed 35149277 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; | 35149277 |
| 277 | } | - |
| 278 | | - |
| 279 | | - |
| 280 | | - |
| 281 | | - |
| 282 | BUCKET_CONTENTS * | - |
| 283 | hash_remove (string, table, flags) | - |
| 284 | const char *string; | - |
| 285 | HASH_TABLE *table; | - |
| 286 | int flags; | - |
| 287 | { | - |
| 288 | int bucket; | - |
| 289 | BUCKET_CONTENTS *prev, *temp; | - |
| 290 | unsigned int hv; | - |
| 291 | | - |
| 292 | if (table == 0| TRUE | evaluated 5498 times by 1 test | | FALSE | evaluated 26584 times by 1 test |
|| ((| TRUE | evaluated 26584 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 1577 times by 1 test | | FALSE | evaluated 25007 times by 1 test |
table)| TRUE | evaluated 26584 times by 1 test | | FALSE | never evaluated |
? (table)->nentries : 0) == 0| TRUE | evaluated 1577 times by 1 test | | FALSE | evaluated 25007 times by 1 test |
) | 0-26584 |
| 293 | returnexecuted 7075 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; (BUCKET_CONTENTS *)executed 7075 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; | 7075 |
| 294 | ((void *)0)executed 7075 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; | 7075 |
| 295 | ;executed 7075 times by 1 test: return (BUCKET_CONTENTS *) ((void *)0) ; | 7075 |
| 296 | | - |
| 297 | bucket = (((hv) = hash_string (string)) & ((table)->nbuckets - 1)); | - |
| 298 | prev = (BUCKET_CONTENTS *) | - |
| 299 | ((void *)0) | - |
| 300 | ; | - |
| 301 | for (temp = table->bucket_array[bucket]; temp| TRUE | evaluated 12088 times by 1 test | | FALSE | evaluated 12956 times by 1 test |
; temp = temp->next) | 12088-12956 |
| 302 | { | - |
| 303 | if (hv == temp->khash| TRUE | evaluated 12051 times by 1 test | | FALSE | evaluated 37 times by 1 test |
&& ((| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
temp->key)[0] == (string)[0]| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
&& | 0-12051 |
| 304 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 305 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 306 | ) && __builtin_constant_p (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 307 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 308 | ) && (__s1_len = __builtin_strlen (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 309 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 310 | ), __s2_len = __builtin_strlen (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 311 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 312 | ), (!((size_t)(const void *)((| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 313 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 314 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 315 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 316 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 317 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 318 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 319 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 320 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 321 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 322 | , | TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 323 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 324 | ) : (__builtin_constant_p (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 325 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 326 | ) && ((size_t)(const void *)((| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 327 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 328 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 329 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 330 | ) == 1) && (__s1_len = __builtin_strlen (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 331 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 332 | ), __s1_len < 4) ? (__builtin_constant_p (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 333 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 334 | ) && ((size_t)(const void *)((| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 335 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 336 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 337 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 338 | ) == 1) ? __builtin_strcmp (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 339 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 340 | , | TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 341 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 342 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 343 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 344 | ); int __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 345 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 346 | ))[0] - __s2[0]); if (__s1_len > 0| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 347 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 348 | ))[1] - __s2[1]); if (__s1_len > 1| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 349 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 350 | ))[2] - __s2[2]); if (__s1_len > 2| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( temp->key ))[3] - __s2[3]); | TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 351 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( temp->key ))[3] - __s2[3]); | 0-12051 |
| 352 | ))[3] - __s2[3]);| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( temp->key ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 353 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 354 | ) && ((size_t)(const void *)((| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 355 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 356 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 357 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 358 | ) == 1) && (__s2_len = __builtin_strlen (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 359 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 360 | ), __s2_len < 4) ? (__builtin_constant_p (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 361 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 362 | ) && ((size_t)(const void *)((| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 363 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 364 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 365 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 366 | ) == 1) ? __builtin_strcmp (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 367 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 368 | , | TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 369 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 370 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 371 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 372 | ); int __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 373 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 374 | ))[0] - __s2[0]); if (__s2_len > 0| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 375 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 376 | ))[1] - __s2[1]); if (__s2_len > 1| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 377 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 378 | ))[2] - __s2[2]); if (__s2_len > 2| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( string ))[3] - __s2[3]); | TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 379 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( string ))[3] - __s2[3]); | 0-12051 |
| 380 | ))[3] - __s2[3]);| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( string ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : __builtin_strcmp (| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 381 | temp->key| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 382 | , | TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 383 | string| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 384 | )))); }) | TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
| 0-12051 |
| 385 | == 0| TRUE | evaluated 12051 times by 1 test | | FALSE | never evaluated |
)) | 0-12051 |
| 386 | { | - |
| 387 | if (prev| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 12049 times by 1 test |
) | 2-12049 |
| 388 | prev->next = temp->next;executed 2 times by 1 test: prev->next = temp->next; | 2 |
| 389 | else | - |
| 390 | table->bucket_array[bucket] = temp->next;executed 12049 times by 1 test: table->bucket_array[bucket] = temp->next; | 12049 |
| 391 | | - |
| 392 | table->nentries--; | - |
| 393 | returnexecuted 12051 times by 1 test: return (temp); (temp);executed 12051 times by 1 test: return (temp); | 12051 |
| 394 | } | - |
| 395 | prev = temp; | - |
| 396 | }executed 37 times by 1 test: end of block | 37 |
| 397 | returnexecuted 12956 times by 1 test: return ((BUCKET_CONTENTS *) ((void *)0) ); ((BUCKET_CONTENTS *) executed 12956 times by 1 test: return ((BUCKET_CONTENTS *) ((void *)0) ); | 12956 |
| 398 | ((void *)0)executed 12956 times by 1 test: return ((BUCKET_CONTENTS *) ((void *)0) ); | 12956 |
| 399 | );executed 12956 times by 1 test: return ((BUCKET_CONTENTS *) ((void *)0) ); | 12956 |
| 400 | } | - |
| 401 | | - |
| 402 | | - |
| 403 | | - |
| 404 | BUCKET_CONTENTS * | - |
| 405 | hash_insert (string, table, flags) | - |
| 406 | char *string; | - |
| 407 | HASH_TABLE *table; | - |
| 408 | int flags; | - |
| 409 | { | - |
| 410 | BUCKET_CONTENTS *item; | - |
| 411 | int bucket; | - |
| 412 | unsigned int hv; | - |
| 413 | | - |
| 414 | if (table == 0| TRUE | never evaluated | | FALSE | evaluated 423049 times by 1 test |
) | 0-423049 |
| 415 | table = hash_create (0); never executed: table = hash_create (0); | 0 |
| 416 | | - |
| 417 | item = (| TRUE | evaluated 417149 times by 1 test | | FALSE | evaluated 5900 times by 1 test |
flags & 0x01)| TRUE | evaluated 417149 times by 1 test | | FALSE | evaluated 5900 times by 1 test |
? (BUCKET_CONTENTS *) | 5900-417149 |
| 418 | ((void *)0) | - |
| 419 | | - |
| 420 | : hash_search (string, table, 0); | - |
| 421 | | - |
| 422 | if (item == 0| TRUE | evaluated 423045 times by 1 test | | FALSE | evaluated 4 times by 1 test |
) | 4-423045 |
| 423 | { | - |
| 424 | bucket = (((hv) = hash_string (string)) & ((table)->nbuckets - 1)); | - |
| 425 | | - |
| 426 | item = (BUCKET_CONTENTS *)sh_xmalloc((sizeof (BUCKET_CONTENTS)), "hashlib.c", 265); | - |
| 427 | item->next = table->bucket_array[bucket]; | - |
| 428 | table->bucket_array[bucket] = item; | - |
| 429 | | - |
| 430 | item->data = | - |
| 431 | ((void *)0) | - |
| 432 | ; | - |
| 433 | item->key = string; | - |
| 434 | item->khash = hv; | - |
| 435 | item->times_found = 0; | - |
| 436 | | - |
| 437 | table->nentries++; | - |
| 438 | }executed 423045 times by 1 test: end of block | 423045 |
| 439 | | - |
| 440 | returnexecuted 423049 times by 1 test: return (item); (item);executed 423049 times by 1 test: return (item); | 423049 |
| 441 | } | - |
| 442 | | - |
| 443 | | - |
| 444 | | - |
| 445 | | - |
| 446 | void | - |
| 447 | hash_flush (table, free_data) | - |
| 448 | HASH_TABLE *table; | - |
| 449 | sh_free_func_t *free_data; | - |
| 450 | { | - |
| 451 | int i; | - |
| 452 | register BUCKET_CONTENTS *bucket, *item; | - |
| 453 | | - |
| 454 | if (table == 0| TRUE | never evaluated | | FALSE | evaluated 2614 times by 1 test |
|| ((| TRUE | evaluated 2614 times by 1 test | | FALSE | never evaluated |
| TRUE | evaluated 439 times by 1 test | | FALSE | evaluated 2175 times by 1 test |
table)| TRUE | evaluated 2614 times by 1 test | | FALSE | never evaluated |
? (table)->nentries : 0) == 0| TRUE | evaluated 439 times by 1 test | | FALSE | evaluated 2175 times by 1 test |
) | 0-2614 |
| 455 | return;executed 439 times by 1 test: return; | 439 |
| 456 | | - |
| 457 | for (i = 0; i < table->nbuckets| TRUE | evaluated 40120 times by 1 test | | FALSE | evaluated 2175 times by 1 test |
; i++) | 2175-40120 |
| 458 | { | - |
| 459 | bucket = table->bucket_array[i]; | - |
| 460 | | - |
| 461 | while (bucket| TRUE | evaluated 3621 times by 1 test | | FALSE | evaluated 40120 times by 1 test |
) | 3621-40120 |
| 462 | { | - |
| 463 | item = bucket; | - |
| 464 | bucket = bucket->next; | - |
| 465 | | - |
| 466 | if (free_data| TRUE | evaluated 3345 times by 1 test | | FALSE | evaluated 276 times by 1 test |
) | 276-3345 |
| 467 | (*executed 3345 times by 1 test: (*free_data) (item->data); free_data) (item->data);executed 3345 times by 1 test: (*free_data) (item->data); | 3345 |
| 468 | else | - |
| 469 | sh_xfree((item->data), "hashlib.c", 306);executed 276 times by 1 test: sh_xfree((item->data), "hashlib.c", 306); | 276 |
| 470 | sh_xfree((item->key), "hashlib.c", 307); | - |
| 471 | sh_xfree((item), "hashlib.c", 308); | - |
| 472 | }executed 3621 times by 1 test: end of block | 3621 |
| 473 | table->bucket_array[i] = (BUCKET_CONTENTS *) | - |
| 474 | ((void *)0) | - |
| 475 | ; | - |
| 476 | }executed 40120 times by 1 test: end of block | 40120 |
| 477 | | - |
| 478 | table->nentries = 0; | - |
| 479 | }executed 2175 times by 1 test: end of block | 2175 |
| 480 | | - |
| 481 | | - |
| 482 | void | - |
| 483 | hash_dispose (table) | - |
| 484 | HASH_TABLE *table; | - |
| 485 | { | - |
| 486 | sh_xfree((table->bucket_array), "hashlib.c", 321); | - |
| 487 | sh_xfree((table), "hashlib.c", 322); | - |
| 488 | }executed 2150 times by 1 test: end of block | 2150 |
| 489 | | - |
| 490 | void | - |
| 491 | hash_walk (table, func) | - |
| 492 | HASH_TABLE *table; | - |
| 493 | hash_wfunc *func; | - |
| 494 | { | - |
| 495 | register int i; | - |
| 496 | BUCKET_CONTENTS *item; | - |
| 497 | | - |
| 498 | if (table == 0| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
|| ((| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
table) ? (table)->nentries : 0) == 0| TRUE | never evaluated | | FALSE | evaluated 3 times by 1 test |
) | 0-3 |
| 499 | return; never executed: return; | 0 |
| 500 | | - |
| 501 | for (i = 0; i < table->nbuckets| TRUE | evaluated 192 times by 1 test | | FALSE | evaluated 3 times by 1 test |
; i++) | 3-192 |
| 502 | { | - |
| 503 | for (item = ((table && (i < table->nbuckets)) ? table->bucket_array[i] : (BUCKET_CONTENTS *) | - |
| 504 | ((void *)0) | - |
| 505 | ); item| TRUE | evaluated 8 times by 1 test | | FALSE | evaluated 192 times by 1 test |
; item = item->next) | 8-192 |
| 506 | if ((*| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
func) (item) < 0| TRUE | never evaluated | | FALSE | evaluated 8 times by 1 test |
) | 0-8 |
| 507 | return; never executed: return; | 0 |
| 508 | }executed 192 times by 1 test: end of block | 192 |
| 509 | }executed 3 times by 1 test: end of block | 3 |
| 510 | | - |
| 511 | | - |
| 512 | void | - |
| 513 | hash_pstats (table, name) | - |
| 514 | HASH_TABLE *table; | - |
| 515 | char *name; | - |
| 516 | { | - |
| 517 | register int slot, bcount; | - |
| 518 | register BUCKET_CONTENTS *bc; | - |
| 519 | | - |
| 520 | if (name == 0| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 521 | name = "unknown hash table"; never executed: name = "unknown hash table"; | 0 |
| 522 | | - |
| 523 | fprintf ( | - |
| 524 | stderr | - |
| 525 | , "%s: %d buckets; %d items\n", name, table->nbuckets, table->nentries); | - |
| 526 | | - |
| 527 | | - |
| 528 | | - |
| 529 | for (slot = 0; slot < table->nbuckets| TRUE | never evaluated | | FALSE | never evaluated |
; slot++) | 0 |
| 530 | { | - |
| 531 | bc = ((table| TRUE | never evaluated | | FALSE | never evaluated |
&& (| TRUE | never evaluated | | FALSE | never evaluated |
slot < table->nbuckets)| TRUE | never evaluated | | FALSE | never evaluated |
) ? table->bucket_array[slot] : (BUCKET_CONTENTS *) | 0 |
| 532 | ((void *)0) | - |
| 533 | ); | - |
| 534 | | - |
| 535 | fprintf ( | - |
| 536 | stderr | - |
| 537 | , "\tslot %3d: ", slot); | - |
| 538 | for (bcount = 0; bc| TRUE | never evaluated | | FALSE | never evaluated |
; bc = bc->next) | 0 |
| 539 | bcount++; never executed: bcount++; | 0 |
| 540 | | - |
| 541 | fprintf ( | - |
| 542 | stderr | - |
| 543 | , "%d\n", bcount); | - |
| 544 | } never executed: end of block | 0 |
| 545 | } never executed: end of block | 0 |
| | |