OSDN Git Service

* Object.m: Fix signed/unsigned warning.
[pf3gnuchains/gcc-fork.git] / libobjc / sarray.c
index a71432e..14135af 100644 (file)
@@ -44,10 +44,6 @@ const char* __objc_sparse2_id = "2 level sparse indices";
 const char* __objc_sparse3_id = "3 level sparse indices";
 #endif
 
-#if defined(__alpha__) || (defined(__sparc__) && (defined(__sparcv9) || defined(__arch64__))) || (defined(__ia64__) && defined(__LP64__))
-const void *memcpy (void*, const void*, size_t);
-#endif
-
 /* This function removes any structures left over from free operations
    that were not safe in a multi-threaded environment. */
 void
@@ -215,7 +211,7 @@ sarray_new (int size, void* default_element)
   size_t num_indices = ((size-1)/BUCKET_SIZE)+1;
   struct sbucket ** new_buckets;
 #endif
-  int counter;
+  size_t counter;
 
   assert(size > 0);
 
@@ -306,7 +302,7 @@ sarray_realloc(struct sarray* array, int newsize)
   
 #endif
 
-  int counter;
+  size_t counter;
 
   assert(newsize > 0);
 
@@ -386,8 +382,8 @@ sarray_realloc(struct sarray* array, int newsize)
 /* Free a sparse array allocated with sarray_new */
 
 void 
-sarray_free(struct sarray* array) {
-
+sarray_free(struct sarray* array)
+{
 #ifdef OBJC_SPARSE3
   size_t old_max_index = (array->capacity-1)/INDEX_CAPACITY;
   struct sindex ** old_indices;
@@ -395,7 +391,7 @@ sarray_free(struct sarray* array) {
   size_t old_max_index = (array->capacity-1)/BUCKET_SIZE;
   struct sbucket ** old_buckets;
 #endif
-  int counter = 0;
+  size_t counter = 0;
 
   assert(array->ref_count != 0);       /* Freed multiple times!!! */