--- gcc/objc/sarray.c 2018/04/24 18:10:18 1.1.1.1 +++ gcc/objc/sarray.c 2018/04/24 18:26:54 1.1.1.3 @@ -1,5 +1,5 @@ /* 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. @@ -15,7 +15,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause @@ -40,6 +41,11 @@ const char* __objc_sparse2_id = "2 level const char* __objc_sparse3_id = "3 level sparse indices"; #endif +#ifdef __alpha__ +const void *memcpy (void*, const void*, size_t); +void free (const void*); +#endif + void sarray_at_put(struct sarray* array, sidx index, void* element) { @@ -117,7 +123,7 @@ sarray_at_put(struct sarray* array, sidx /* The bucket was previously empty (or something like that), */ /* allocate a new. This is the effect of `lazy' allocation */ *the_bucket = (struct sbucket*)__objc_xmalloc(sizeof(struct sbucket)); - memcpy( *the_bucket,array->empty_bucket, sizeof(struct sbucket)); + memcpy((void *) *the_bucket, (const void*)array->empty_bucket, sizeof(struct sbucket)); (*the_bucket)->version = array->version; nbuckets += 1; @@ -213,14 +219,14 @@ void sarray_realloc(struct sarray* array, int newsize) { #ifdef OBJC_SPARSE3 - int old_max_index = (array->capacity-1)/INDEX_CAPACITY; - int new_max_index = ((newsize-1)/INDEX_CAPACITY); - int rounded_size = (new_max_index+1)*INDEX_CAPACITY; + size_t old_max_index = (array->capacity-1)/INDEX_CAPACITY; + size_t new_max_index = ((newsize-1)/INDEX_CAPACITY); + size_t rounded_size = (new_max_index+1)*INDEX_CAPACITY; #else /* OBJC_SPARSE2 */ - int old_max_index = (array->capacity-1)/BUCKET_SIZE; - int new_max_index = ((newsize-1)/BUCKET_SIZE); - int rounded_size = (new_max_index+1)*BUCKET_SIZE; + size_t old_max_index = (array->capacity-1)/BUCKET_SIZE; + size_t new_max_index = ((newsize-1)/BUCKET_SIZE); + size_t rounded_size = (new_max_index+1)*BUCKET_SIZE; #endif