Commit 2b61d00a by Richard Kenner

(sarray_realloc): Make array index variables size_t.

From-SVN: r9721
parent 2c89fb2e
/* Sparse Arrays for Objective C dispatch tables /* Sparse Arrays for Objective C dispatch tables
Copyright (C) 1993 Free Software Foundation, Inc. Copyright (C) 1993, 1995 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -218,14 +218,14 @@ void ...@@ -218,14 +218,14 @@ void
sarray_realloc(struct sarray* array, int newsize) sarray_realloc(struct sarray* array, int newsize)
{ {
#ifdef OBJC_SPARSE3 #ifdef OBJC_SPARSE3
int old_max_index = (array->capacity-1)/INDEX_CAPACITY; size_t old_max_index = (array->capacity-1)/INDEX_CAPACITY;
int new_max_index = ((newsize-1)/INDEX_CAPACITY); size_t new_max_index = ((newsize-1)/INDEX_CAPACITY);
int rounded_size = (new_max_index+1)*INDEX_CAPACITY; size_t rounded_size = (new_max_index+1)*INDEX_CAPACITY;
#else /* OBJC_SPARSE2 */ #else /* OBJC_SPARSE2 */
int old_max_index = (array->capacity-1)/BUCKET_SIZE; size_t old_max_index = (array->capacity-1)/BUCKET_SIZE;
int new_max_index = ((newsize-1)/BUCKET_SIZE); size_t new_max_index = ((newsize-1)/BUCKET_SIZE);
int rounded_size = (new_max_index+1)*BUCKET_SIZE; size_t rounded_size = (new_max_index+1)*BUCKET_SIZE;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment