I believe that this patch gets all of these: include/parrot/key.h:51: warning: declaration of `index' shadows global declaration include/parrot/key.h:52: warning: declaration of `index' shadows global declaration include/parrot/key.h:53: warning: declaration of `index' shadows global declaration include/parrot/key.h:54: warning: declaration of `index' shadows global declaration include/parrot/key.h:55: warning: declaration of `index' shadows global declaration include/parrot/key.h:57: warning: declaration of `index' shadows global declaration
by renaming index as idx Nicholas Clark --- ./include/parrot/packfile.h~ Wed Jan 2 22:44:52 2002 +++ ./include/parrot/packfile.h Mon Jan 7 20:44:02 2002 @@ -135,7 +135,7 @@ PackFile_ConstTable_push_constant(struct PackFile_ConstTable * self, struct PackFile_Constant * constant); struct PackFile_Constant * -PackFile_ConstTable_constant(struct PackFile_ConstTable * self, opcode_t index); +PackFile_ConstTable_constant(struct PackFile_ConstTable * self, opcode_t idx); opcode_t PackFile_ConstTable_unpack(struct Parrot_Interp *interpreter, struct PackFile_ConstTable * self, char * packed, opcode_t packed_size); --- ./include/parrot/string.h~ Tue Jan 1 18:09:21 2002 +++ ./include/parrot/string.h Mon Jan 7 20:41:59 2002 @@ -51,7 +51,7 @@ UINTVAL string_length(const STRING*); INTVAL -string_ord(const STRING* s, INTVAL index); +string_ord(const STRING* s, INTVAL idx); FLOATVAL string_to_num (const STRING *s); INTVAL @@ -70,7 +70,7 @@ void string_init(void); INTVAL -string_index(const STRING* s, UINTVAL index); +string_index(const STRING* s, UINTVAL idx); #endif --- ./include/parrot/vtable.h~ Mon Jan 7 20:38:08 2002 +++ ./include/parrot/vtable.h Mon Jan 7 20:42:43 2002 @@ -28,14 +28,14 @@ typedef INTVAL (*real_size_method_t)(struct Parrot_Interp *interpreter, PMC* pmc); typedef void (*destroy_method_t)(struct Parrot_Interp *interpreter, PMC* pmc); typedef INTVAL (*get_integer_method_t)(struct Parrot_Interp *interpreter, PMC* pmc); -typedef INTVAL (*get_integer_index_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, INTVAL index); -typedef INTVAL (*get_integer_index_s_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, STRING* index); +typedef INTVAL (*get_integer_index_method_t)(struct Parrot_Interp *interpreter, PMC* +pmc, INTVAL idx); +typedef INTVAL (*get_integer_index_s_method_t)(struct Parrot_Interp *interpreter, +PMC* pmc, STRING* idx); typedef FLOATVAL (*get_number_method_t)(struct Parrot_Interp *interpreter, PMC* pmc); -typedef FLOATVAL (*get_number_index_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, INTVAL index); -typedef FLOATVAL (*get_number_index_s_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, STRING* index); +typedef FLOATVAL (*get_number_index_method_t)(struct Parrot_Interp *interpreter, PMC* +pmc, INTVAL idx); +typedef FLOATVAL (*get_number_index_s_method_t)(struct Parrot_Interp *interpreter, +PMC* pmc, STRING* idx); typedef STRING* (*get_string_method_t)(struct Parrot_Interp *interpreter, PMC* pmc); -typedef STRING* (*get_string_index_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, INTVAL index); -typedef STRING* (*get_string_index_s_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, STRING* index); +typedef STRING* (*get_string_index_method_t)(struct Parrot_Interp *interpreter, PMC* +pmc, INTVAL idx); +typedef STRING* (*get_string_index_s_method_t)(struct Parrot_Interp *interpreter, +PMC* pmc, STRING* idx); typedef BOOLVAL (*get_bool_method_t)(struct Parrot_Interp *interpreter, PMC* pmc); typedef void* (*get_value_method_t)(struct Parrot_Interp *interpreter, PMC* pmc); typedef BOOLVAL (*is_same_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, PMC* pmc2); @@ -43,21 +43,21 @@ typedef void (*set_integer_native_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, INTVAL value); typedef void (*set_integer_bigint_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, BIGINT value); typedef void (*set_integer_same_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, PMC * value); -typedef void (*set_integer_index_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, INTVAL value, INTVAL index); -typedef void (*set_integer_index_s_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, INTVAL value, STRING* index); +typedef void (*set_integer_index_method_t)(struct Parrot_Interp *interpreter, PMC* +pmc, INTVAL value, INTVAL idx); +typedef void (*set_integer_index_s_method_t)(struct Parrot_Interp *interpreter, PMC* +pmc, INTVAL value, STRING* idx); typedef void (*set_number_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, PMC * value); typedef void (*set_number_native_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, FLOATVAL value); typedef void (*set_number_bigfloat_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, BIGFLOAT value); typedef void (*set_number_same_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, PMC * value); -typedef void (*set_number_index_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, FLOATVAL value, INTVAL index); -typedef void (*set_number_index_s_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, FLOATVAL value, STRING* index); +typedef void (*set_number_index_method_t)(struct Parrot_Interp *interpreter, PMC* +pmc, FLOATVAL value, INTVAL idx); +typedef void (*set_number_index_s_method_t)(struct Parrot_Interp *interpreter, PMC* +pmc, FLOATVAL value, STRING* idx); typedef void (*set_string_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, PMC * value); typedef void (*set_string_native_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, STRING * value); typedef void (*set_string_unicode_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, STRING * value); typedef void (*set_string_other_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, STRING * value); typedef void (*set_string_same_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, PMC * value); -typedef void (*set_string_index_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, STRING* value, INTVAL index); -typedef void (*set_string_index_s_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, STRING* value, STRING* index); +typedef void (*set_string_index_method_t)(struct Parrot_Interp *interpreter, PMC* +pmc, STRING* value, INTVAL idx); +typedef void (*set_string_index_s_method_t)(struct Parrot_Interp *interpreter, PMC* +pmc, STRING* value, STRING* idx); typedef void (*set_value_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, void* value); typedef void (*add_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, PMC * value, PMC* dest); typedef void (*add_int_method_t)(struct Parrot_Interp *interpreter, PMC* pmc, INTVAL value, PMC* dest); --- ./include/parrot/key.h~ Sat Jan 5 12:49:19 2002 +++ ./include/parrot/key.h Mon Jan 7 20:43:11 2002 @@ -48,13 +48,13 @@ INTVAL key_size(struct Parrot_Interp *interpreter, KEY *key); void key_set_size(struct Parrot_Interp *interpreter, KEY *key, INTVAL size); void key_destroy(struct Parrot_Interp *interpreter, KEY *key); -INTVAL key_element_type(struct Parrot_Interp *interpreter, KEY* key, INTVAL index); -KEY_PAIR* key_element_value_i(struct Parrot_Interp *interpreter, KEY *key, INTVAL index); -KEY_PAIR* key_element_value_s(struct Parrot_Interp *interpreter, KEY *key, STRING* index); -void key_set_element_value_i(struct Parrot_Interp *interpreter, KEY *key, INTVAL index, KEY_PAIR* value); -void key_set_element_value_s(struct Parrot_Interp *interpreter, KEY *key, STRING* index, KEY_PAIR* value); +INTVAL key_element_type(struct Parrot_Interp *interpreter, KEY* key, INTVAL idx); +KEY_PAIR* key_element_value_i(struct Parrot_Interp *interpreter, KEY *key, INTVAL +idx); +KEY_PAIR* key_element_value_s(struct Parrot_Interp *interpreter, KEY *key, STRING* +idx); +void key_set_element_value_i(struct Parrot_Interp *interpreter, KEY *key, INTVAL idx, +KEY_PAIR* value); +void key_set_element_value_s(struct Parrot_Interp *interpreter, KEY *key, STRING* +idx, KEY_PAIR* value); void key_chop(struct Parrot_Interp *interpreter, KEY *key); -void key_inc(struct Parrot_Interp *interpreter, KEY *key, INTVAL index); +void key_inc(struct Parrot_Interp *interpreter, KEY *key, INTVAL idx); #endif --- ./key.c~ Mon Jan 7 16:25:02 2002 +++ ./key.c Mon Jan 7 20:46:36 2002 @@ -146,10 +146,10 @@ */ INTVAL key_element_type(struct Parrot_Interp *interpreter, KEY* key, - INTVAL index) { + INTVAL idx) { if(key != NULL) { - if((index >= 0) || (index < key->size)) { - KEY_PAIR* pair = &key->keys[index]; + if((idx >= 0) || (idx < key->size)) { + KEY_PAIR* pair = &key->keys[idx]; return pair->type; } else { @@ -169,10 +169,10 @@ */ KEY_PAIR* key_element_value_i(struct Parrot_Interp *interpreter, KEY* key, - INTVAL index) { + INTVAL idx) { if(key != NULL) { - if((index >= 0) || (index < key->size)) { - KEY_PAIR* pair = &key->keys[index]; + if((idx >= 0) || (idx < key->size)) { + KEY_PAIR* pair = &key->keys[idx]; if(pair != NULL) { return pair; } @@ -189,9 +189,9 @@ } KEY_PAIR* key_element_value_s(struct Parrot_Interp *interpreter, KEY* key, - STRING* index) { + STRING* idx) { if(key != NULL) { - INTVAL hash = key_hash(interpreter,index); + INTVAL hash = key_hash(interpreter,idx); KEY_PAIR* pair; hash = hash % NUM_BUCKETS; pair = &key->keys[hash]; @@ -213,10 +213,10 @@ */ void key_set_element_value_i(struct Parrot_Interp *interpreter, KEY* key, - INTVAL index, KEY_PAIR* value) { + INTVAL idx, KEY_PAIR* value) { if(key != NULL) { - if((index >= 0) || (index < key->size)) { - memcpy(&key->keys[index],value,sizeof(KEY_PAIR)); + if((idx >= 0) || (idx < key->size)) { + memcpy(&key->keys[idx],value,sizeof(KEY_PAIR)); } else { fprintf(stderr, @@ -236,9 +236,9 @@ */ void key_set_element_value_s(struct Parrot_Interp *interpreter, KEY* key, - STRING* index, KEY_PAIR* value) { + STRING* idx, KEY_PAIR* value) { if(key != NULL) { - INTVAL hash = key_hash(interpreter,index); + INTVAL hash = key_hash(interpreter,idx); hash = hash % NUM_BUCKETS; memcpy(&key->keys[hash],value,sizeof(KEY_PAIR)); } @@ -282,10 +282,10 @@ =cut */ -void key_inc(struct Parrot_Interp *interpreter, KEY* key, INTVAL index) { +void key_inc(struct Parrot_Interp *interpreter, KEY* key, INTVAL idx) { if(key != NULL) { - if(index > 0 && index <= key->size) { - KEY_PAIR* pair = &key->keys[index]; + if(idx > 0 && idx <= key->size) { + KEY_PAIR* pair = &key->keys[idx]; pair->type++; } else { --- ./string.c~ Wed Jan 2 20:18:11 2002 +++ ./string.c Mon Jan 7 20:47:36 2002 @@ -91,15 +91,15 @@ * functions are fleshed out, this function can DTRT. */ INTVAL -string_index(const STRING* s, UINTVAL index) { - return s->encoding->decode(s->encoding->skip_forward(s->bufstart, index)); +string_index(const STRING* s, UINTVAL idx) { + return s->encoding->decode(s->encoding->skip_forward(s->bufstart, idx)); } /*=for api string string_ord * return the length of the string */ INTVAL -string_ord(const STRING* s, INTVAL index) { +string_ord(const STRING* s, INTVAL idx) { UINTVAL len = 0; if (s != NULL) { @@ -112,15 +112,15 @@ } else { UINTVAL true_index; - true_index = (UINTVAL) index; + true_index = (UINTVAL) idx; - if (index < 0) { - if ((INTVAL)(index + len) < 0) { + if (idx < 0) { + if ((INTVAL)(idx + len) < 0) { INTERNAL_EXCEPTION(ORD_OUT_OF_STRING, "Cannot get character before beginning of string"); } else { - true_index = (UINTVAL)(len + index); + true_index = (UINTVAL)(len + idx); } } --- ./packfile.c~ Fri Jan 4 00:22:43 2002 +++ ./packfile.c Mon Jan 7 20:48:21 2002 @@ -883,17 +883,17 @@ ***************************************/ struct PackFile_Constant * -PackFile_ConstTable_constant(struct PackFile_ConstTable * self, opcode_t index) { +PackFile_ConstTable_constant(struct PackFile_ConstTable * self, opcode_t idx) { if (!self) { fprintf(stderr, "PackFile_ConstTable_constant: self == NULL!\n"); return NULL; } - if (index < 0 || index >= self->const_count) { + if (idx < 0 || idx >= self->const_count) { return NULL; } - return self->constants[index]; + return self->constants[idx]; }