aboutsummaryrefslogtreecommitdiff
path: root/libobjc
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-07 13:37:26 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-07 13:37:26 +0000
commit20d7c27cf0f38fb323830ee310214b5ef9ede4f4 (patch)
tree9d50ca02cd409c64e4295bbe4880ada3f5fc3cf9 /libobjc
parent6d2b8fda842e85e431f083972755020750e06e34 (diff)
Mainline merge as of 2003-05-04.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@66559 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r--libobjc/ChangeLog9
-rwxr-xr-xlibobjc/configure2
-rw-r--r--libobjc/objc/hash.h6
-rw-r--r--libobjc/objc/objc-list.h4
-rw-r--r--libobjc/objc/sarray.h32
5 files changed, 31 insertions, 22 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 87ba69fa3fd..1f00adf9524 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,12 @@
+2003-04-11 David Chad <davidc@freebsd.org>
+ Loren J. Rittle <ljrittle@acm.org>
+
+ libobjc/8562
+ * objc/hash.h (hash_string): Constify correctly.
+ (compare_ptrs): Use direct compare.
+ * objc/objc-list.h (list_nth): Rename index to indx to avoid shadow.
+ * objc/sarray.h: Global rename index to indx to avoid shadow.
+
2003-03-12 Andreas Schwab <schwab@suse.de>
* aclocal.m4 (GLIBCPP_EXPORT_INSTALL_INFO): Avoid trailing /. in
diff --git a/libobjc/configure b/libobjc/configure
index 40ea71e970e..be0dde9d285 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -1613,7 +1613,7 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
case $host_cpu in
- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
+ alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
diff --git a/libobjc/objc/hash.h b/libobjc/objc/hash.h
index e695012aa43..9e89f577485 100644
--- a/libobjc/objc/hash.h
+++ b/libobjc/objc/hash.h
@@ -174,8 +174,8 @@ hash_string (cache_ptr cache, const void *key)
unsigned int ctr = 0;
- while (*(char *) key) {
- ret ^= *(char *) key++ << ctr;
+ while (*(const char *) key) {
+ ret ^= *((const char *) key)++ << ctr;
ctr = (ctr + 1) % sizeof (void *);
}
@@ -187,7 +187,7 @@ hash_string (cache_ptr cache, const void *key)
static inline int
compare_ptrs (const void *k1, const void *k2)
{
- return ! (k1 - k2);
+ return (k1 == k2);
}
diff --git a/libobjc/objc/objc-list.h b/libobjc/objc/objc-list.h
index de083a5861e..318c68682f5 100644
--- a/libobjc/objc/objc-list.h
+++ b/libobjc/objc/objc-list.h
@@ -64,9 +64,9 @@ list_length(struct objc_list* list)
larger than the list length, NULL is returned */
static inline void*
-list_nth(int index, struct objc_list* list)
+list_nth(int indx, struct objc_list* list)
{
- while(index-- != 0)
+ while(indx-- != 0)
{
if(list->tail)
list = list->tail;
diff --git a/libobjc/objc/sarray.h b/libobjc/objc/sarray.h
index 17da2720364..fa6e2f0eaac 100644
--- a/libobjc/objc/sarray.h
+++ b/libobjc/objc/sarray.h
@@ -146,8 +146,8 @@ struct sarray* sarray_new(int, void* default_element);
void sarray_free(struct sarray*);
struct sarray* sarray_lazy_copy(struct sarray*);
void sarray_realloc(struct sarray*, int new_size);
-void sarray_at_put(struct sarray*, sidx index, void* elem);
-void sarray_at_put_safe(struct sarray*, sidx index, void* elem);
+void sarray_at_put(struct sarray*, sidx indx, void* elem);
+void sarray_at_put_safe(struct sarray*, sidx indx, void* elem);
struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */
void sarray_remove_garbage(void);
@@ -156,10 +156,10 @@ void sarray_remove_garbage(void);
#ifdef PRECOMPUTE_SELECTORS
/* Transform soffset values to ints and vica verca */
static inline unsigned int
-soffset_decode(sidx index)
+soffset_decode(sidx indx)
{
union sofftype x;
- x.idx = index;
+ x.idx = indx;
#ifdef OBJC_SPARSE3
return x.off.eoffset
+ (x.off.boffset*BUCKET_SIZE)
@@ -186,9 +186,9 @@ soffset_encode(size_t offset)
#else /* not PRECOMPUTE_SELECTORS */
static inline size_t
-soffset_decode(sidx index)
+soffset_decode(sidx indx)
{
- return index;
+ return indx;
}
static inline sidx
@@ -198,13 +198,13 @@ soffset_encode(size_t offset)
}
#endif /* not PRECOMPUTE_SELECTORS */
-/* Get element from the Sparse array `array' at offset `index' */
+/* Get element from the Sparse array `array' at offset `indx' */
-static inline void* sarray_get(struct sarray* array, sidx index)
+static inline void* sarray_get(struct sarray* array, sidx indx)
{
#ifdef PRECOMPUTE_SELECTORS
union sofftype x;
- x.idx = index;
+ x.idx = indx;
#ifdef OBJC_SPARSE3
return
array->
@@ -217,19 +217,19 @@ static inline void* sarray_get(struct sarray* array, sidx index)
#else /* not PRECOMPUTE_SELECTORS */
#ifdef OBJC_SPARSE3
return array->
- indices[index/INDEX_CAPACITY]->
- buckets[(index/BUCKET_SIZE)%INDEX_SIZE]->
- elems[index%BUCKET_SIZE];
+ indices[indx/INDEX_CAPACITY]->
+ buckets[(indx/BUCKET_SIZE)%INDEX_SIZE]->
+ elems[indx%BUCKET_SIZE];
#else /* OBJC_SPARSE2 */
- return array->buckets[index/BUCKET_SIZE]->elems[index%BUCKET_SIZE];
+ return array->buckets[indx/BUCKET_SIZE]->elems[indx%BUCKET_SIZE];
#endif /* not OBJC_SPARSE3 */
#endif /* not PRECOMPUTE_SELECTORS */
}
-static inline void* sarray_get_safe(struct sarray* array, sidx index)
+static inline void* sarray_get_safe(struct sarray* array, sidx indx)
{
- if(soffset_decode(index) < array->capacity)
- return sarray_get(array, index);
+ if(soffset_decode(indx) < array->capacity)
+ return sarray_get(array, indx);
else
return (array->empty_bucket->elems[0]);
}