Changeset 789 for pjproject/branches/symbian/pjlib/src/pj/hash.c
- Timestamp:
- Oct 29, 2006 6:13:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/symbian/pjlib/src/pj/hash.c
r433 r789 56 56 57 57 if (keylen==PJ_HASH_KEY_STRING) { 58 const unsigned char *p = key;58 const unsigned char *p = (const unsigned char*) 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,63 const unsigned char *p = (const unsigned char*) key, 64 64 *end = p + keylen; 65 65 for ( ; p!=end; ++p) { … … 93 93 PJ_ASSERT_RETURN(sizeof(pj_hash_entry)==PJ_HASH_ENTRY_SIZE, NULL); 94 94 95 h = pj_pool_alloc(pool, sizeof(pj_hash_table_t));95 h = (pj_hash_table_t*) pj_pool_alloc(pool, sizeof(pj_hash_table_t)); 96 96 h->count = 0; 97 97 … … 109 109 110 110 h->rows = table_size; 111 h->table = pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*));111 h->table = (pj_hash_entry**) pj_pool_calloc(pool, table_size+1, sizeof(pj_hash_entry*)); 112 112 return h; 113 113 } … … 129 129 hash=0; 130 130 if (keylen==PJ_HASH_KEY_STRING) { 131 const unsigned char *p = key;131 const unsigned char *p = (const unsigned char*)key; 132 132 for ( ; *p; ++p ) { 133 133 hash = hash * PJ_HASH_MULTIPLIER + *p; … … 135 135 keylen = p - (const unsigned char*)key; 136 136 } else { 137 const unsigned char *p = key,137 const unsigned char *p = (const unsigned char*) key, 138 138 *end = p + keylen; 139 139 for ( ; p!=end; ++p) { … … 166 166 */ 167 167 if (entry_buf) { 168 entry = entry_buf;168 entry = (pj_hash_entry*) entry_buf; 169 169 } else { 170 170 /* Pool must be specified! */ 171 171 PJ_ASSERT_RETURN(pool != NULL, NULL); 172 172 173 entry = pj_pool_alloc(pool, sizeof(pj_hash_entry));173 entry = (pj_hash_entry*) pj_pool_alloc(pool, sizeof(pj_hash_entry)); 174 174 PJ_LOG(6, ("hashtbl", 175 175 "%p: New p_entry %p created, pool used=%u, cap=%u",
Note: See TracChangeset
for help on using the changeset viewer.