mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
r18921: Fix some c++ warnings.
Guenther
(This used to be commit b1bc7fd347
)
This commit is contained in:
parent
52d45a51d3
commit
bd2f02e696
@ -114,11 +114,11 @@ dictionary * dictionary_new(int size)
|
||||
/* If no size was specified, allocate space for DICTMINSZ */
|
||||
if (size<DICTMINSZ) size=DICTMINSZ ;
|
||||
|
||||
d = calloc(1, sizeof(dictionary));
|
||||
d = (dictionary *)calloc(1, sizeof(dictionary));
|
||||
d->size = size ;
|
||||
d->val = calloc(size, sizeof(char*));
|
||||
d->key = calloc(size, sizeof(char*));
|
||||
d->hash = calloc(size, sizeof(unsigned));
|
||||
d->val = (char **)calloc(size, sizeof(char*));
|
||||
d->key = (char **)calloc(size, sizeof(char*));
|
||||
d->hash = (unsigned int *)calloc(size, sizeof(unsigned));
|
||||
return d ;
|
||||
}
|
||||
|
||||
@ -316,9 +316,9 @@ void dictionary_set(dictionary * d, char * key, char * val)
|
||||
if (d->n==d->size) {
|
||||
|
||||
/* Reached maximum size: reallocate blackboard */
|
||||
d->val = mem_double(d->val, d->size * sizeof(char*)) ;
|
||||
d->key = mem_double(d->key, d->size * sizeof(char*)) ;
|
||||
d->hash = mem_double(d->hash, d->size * sizeof(unsigned)) ;
|
||||
d->val = (char **)mem_double(d->val, d->size * sizeof(char*)) ;
|
||||
d->key = (char **)mem_double(d->key, d->size * sizeof(char*)) ;
|
||||
d->hash = (unsigned int *)mem_double(d->hash, d->size * sizeof(unsigned)) ;
|
||||
|
||||
/* Double size */
|
||||
d->size *= 2 ;
|
||||
|
Loading…
Reference in New Issue
Block a user