diff options
author | kan <kan@FreeBSD.org> | 2004-07-28 03:12:12 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2004-07-28 03:12:12 +0000 |
commit | faa0a30e665e4b99547718fea8c46655b053f4a4 (patch) | |
tree | 692b0b1ffb09a0fba199d48352cc84bcdeadcdb9 /contrib/libobjc/objc/sarray.h | |
parent | 96bad46eee8bf907dceb152bbb9d128bed5a4956 (diff) | |
download | FreeBSD-src-faa0a30e665e4b99547718fea8c46655b053f4a4.zip FreeBSD-src-faa0a30e665e4b99547718fea8c46655b053f4a4.tar.gz |
Gcc 3.4.2 20040728 Objective C support bits.
Diffstat (limited to 'contrib/libobjc/objc/sarray.h')
-rw-r--r-- | contrib/libobjc/objc/sarray.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/libobjc/objc/sarray.h b/contrib/libobjc/objc/sarray.h index 17da272..a94a98a 100644 --- a/contrib/libobjc/objc/sarray.h +++ b/contrib/libobjc/objc/sarray.h @@ -2,20 +2,20 @@ Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. Contributed by Kresten Krab Thorup. -This file is part of GNU CC. +This file is part of GCC. -GNU CC is free software; you can redistribute it and/or modify +GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. -GNU CC is distributed in the hope that it will be useful, +GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to +along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -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]); } |