Changeset 1235 for pjproject/trunk/pjlib/src/pj/hash.c
- Timestamp:
- Apr 30, 2007 9:03:32 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/hash.c
r1210 r1235 56 56 57 57 if (keylen==PJ_HASH_KEY_STRING) { 58 const unsigned char *p =key;58 const pj_uint8_t *p = (const pj_uint8_t*)key; 59 59 for ( ; *p; ++p ) { 60 60 hash = (hash * PJ_HASH_MULTIPLIER) + *p; 61 61 } 62 62 } else { 63 const unsigned char *p =key,64 *end = p + keylen;63 const pj_uint8_t *p = (const pj_uint8_t*)key, 64 *end = p + keylen; 65 65 for ( ; p!=end; ++p) { 66 66 hash = (hash * PJ_HASH_MULTIPLIER) + *p; … … 104 104 PJ_ASSERT_RETURN(sizeof(pj_hash_entry)==PJ_HASH_ENTRY_SIZE, NULL); 105 105 106 h = pj_pool_alloc(pool, sizeof(pj_hash_table_t));106 h = PJ_POOL_ALLOC_T(pool, pj_hash_table_t); 107 107 h->count = 0; 108 108 … … 120 120 121 121 h->rows = table_size; 122 h->table = pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*)); 122 h->table = (pj_hash_entry**) 123 pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*)); 123 124 return h; 124 125 } … … 143 144 hash=0; 144 145 if (keylen==PJ_HASH_KEY_STRING) { 145 const unsigned char *p =key;146 const pj_uint8_t *p = (const pj_uint8_t*)key; 146 147 for ( ; *p; ++p ) { 147 148 hash = hash * PJ_HASH_MULTIPLIER + *p; … … 149 150 keylen = p - (const unsigned char*)key; 150 151 } else { 151 const unsigned char *p =key,152 *end = p + keylen;152 const pj_uint8_t *p = (const pj_uint8_t*)key, 153 *end = p + keylen; 153 154 for ( ; p!=end; ++p) { 154 155 hash = hash * PJ_HASH_MULTIPLIER + *p; … … 180 181 */ 181 182 if (entry_buf) { 182 entry = entry_buf;183 entry = (pj_hash_entry*)entry_buf; 183 184 } else { 184 185 /* Pool must be specified! */ 185 186 PJ_ASSERT_RETURN(pool != NULL, NULL); 186 187 187 entry = pj_pool_alloc(pool, sizeof(pj_hash_entry));188 entry = PJ_POOL_ALLOC_T(pool, pj_hash_entry); 188 189 PJ_LOG(6, ("hashtbl", 189 190 "%p: New p_entry %p created, pool used=%u, cap=%u",
Note: See TracChangeset
for help on using the changeset viewer.