diff --git a/src/dictionary.c b/src/dictionary.c index 6c8e4934457cc8d8ffecd95357394f1fc634e13c..b62808a4ab9b5f3f82dae05a4cc45a3249ba3536 100644 --- a/src/dictionary.c +++ b/src/dictionary.c @@ -35,7 +35,7 @@ /* Doubles the allocated size associated to a pointer */ /* 'size' is the current allocated size. */ -static void * mem_double(void * ptr, int size) +static void * mem_double(void * ptr, size_t size) { void * newptr ; @@ -87,11 +87,11 @@ static char * xstrdup(const char * s) /*--------------------------------------------------------------------------*/ unsigned dictionary_hash(const char * key) { - int len ; + size_t len ; unsigned hash ; - int i ; + size_t i ; - len = (int)strlen(key); + len = strlen(key); for (hash=0, i=0 ; in==d->size) { /* Reached maximum size: reallocate dictionary */ - d->val = (char **)mem_double(d->val, d->size * (int)sizeof(char*)) ; - d->key = (char **)mem_double(d->key, d->size * (int)sizeof(char*)) ; - d->hash = (unsigned int *)mem_double(d->hash, d->size * (int)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)) ; if ((d->val==NULL) || (d->key==NULL) || (d->hash==NULL)) { /* Cannot grow dictionary */ return -1 ;