diff options
author | Bill Meier <wmeier@newsguy.com> | 2010-01-28 18:45:46 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2010-01-28 18:45:46 +0000 |
commit | 9d663d7081ba8204a3b43fcfb84a460a82c38ba0 (patch) | |
tree | baadc97af6d6e836a3eea362eaea9c22bd80104b /epan | |
parent | 8a39d11aa1a70ca1c51317833c2e7d90441c5df8 (diff) | |
download | wireshark-9d663d7081ba8204a3b43fcfb84a460a82c38ba0.tar.gz wireshark-9d663d7081ba8204a3b43fcfb84a460a82c38ba0.tar.bz2 wireshark-9d663d7081ba8204a3b43fcfb84a460a82c38ba0.zip |
Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31720
Diffstat (limited to 'epan')
-rw-r--r-- | epan/emem.c | 16 | ||||
-rw-r--r-- | epan/epan.c | 12 | ||||
-rw-r--r-- | epan/epan.h | 8 | ||||
-rw-r--r-- | epan/follow.c | 34 | ||||
-rw-r--r-- | epan/prefs.c | 6 | ||||
-rw-r--r-- | epan/report_err.c | 16 | ||||
-rw-r--r-- | epan/sigcomp-udvm.c | 68 | ||||
-rw-r--r-- | epan/strutil.c | 8 | ||||
-rw-r--r-- | epan/to_str.c | 86 | ||||
-rw-r--r-- | epan/tvbparse.c | 8 | ||||
-rw-r--r-- | epan/tvbuff.c | 32 |
11 files changed, 147 insertions, 147 deletions
diff --git a/epan/emem.c b/epan/emem.c index 97ceada4c6..77e9e97743 100644 --- a/epan/emem.c +++ b/epan/emem.c @@ -1739,11 +1739,11 @@ emem_tree_insert_string(emem_tree_t* se_tree, const gchar* k, void* v, guint32 f emem_tree_key_t key[2]; guint32 *aligned=NULL; guint32 len = (guint32) strlen(k); - guint32 div = (len+3)/4+1; + guint32 divx = (len+3)/4+1; guint32 i; guint32 tmp; - aligned = g_malloc(div * sizeof (guint32)); + aligned = g_malloc(divx * sizeof (guint32)); /* pack the bytes one one by one into guint32s */ tmp = 0; @@ -1773,9 +1773,9 @@ emem_tree_insert_string(emem_tree_t* se_tree, const gchar* k, void* v, guint32 f } /* add the terminator */ - aligned[div-1] = 0x00000001; + aligned[divx-1] = 0x00000001; - key[0].length = div; + key[0].length = divx; key[0].key = aligned; key[1].length = 0; key[1].key = NULL; @@ -1791,12 +1791,12 @@ emem_tree_lookup_string(emem_tree_t* se_tree, const gchar* k, guint32 flags) emem_tree_key_t key[2]; guint32 *aligned=NULL; guint32 len = (guint) strlen(k); - guint32 div = (len+3)/4+1; + guint32 divx = (len+3)/4+1; guint32 i; guint32 tmp; void *ret; - aligned = g_malloc(div * sizeof (guint32)); + aligned = g_malloc(divx * sizeof (guint32)); /* pack the bytes one one by one into guint32s */ tmp = 0; @@ -1826,9 +1826,9 @@ emem_tree_lookup_string(emem_tree_t* se_tree, const gchar* k, guint32 flags) } /* add the terminator */ - aligned[div-1] = 0x00000001; + aligned[divx-1] = 0x00000001; - key[0].length = div; + key[0].length = divx; key[0].key = aligned; key[1].length = 0; key[1].key = NULL; diff --git a/epan/epan.c b/epan/epan.c index 1f725da07f..ec1211a077 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -69,13 +69,13 @@ epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_da void (*register_all_handoffs_func)(register_cb cb, gpointer client_data), register_cb cb, gpointer client_data, - void (*report_failure)(const char *, va_list), - void (*report_open_failure)(const char *, int, gboolean), - void (*report_read_failure)(const char *, int), - void (*report_write_failure)(const char *, int)) + void (*report_failure_fcn_p)(const char *, va_list), + void (*report_open_failure_fcn_p)(const char *, int, gboolean), + void (*report_read_failure_fcn_p)(const char *, int), + void (*report_write_failure_fcn_p)(const char *, int)) { - init_report_err(report_failure, report_open_failure, - report_read_failure, report_write_failure); + init_report_err(report_failure_fcn_p, report_open_failure_fcn_p, + report_read_failure_fcn_p, report_write_failure_fcn_p); /* initialize memory allocation subsystem */ emem_init(); diff --git a/epan/epan.h b/epan/epan.h index 65f3ef8436..d7c9742ad3 100644 --- a/epan/epan.h +++ b/epan/epan.h @@ -38,10 +38,10 @@ void epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer clie void (*register_all_handoffs_func)(register_cb cb, gpointer client_data), register_cb cb, void *client_data, - void (*report_failure)(const char *, va_list), - void (*report_open_failure)(const char *, int, gboolean), - void (*report_read_failure)(const char *, int), - void (*report_write_failure)(const char *, int)); + void (*report_failure_fcn_p)(const char *, va_list), + void (*report_open_failure_fcn_p)(const char *, int, gboolean), + void (*report_read_failure_fcn_p)(const char *, int), + void (*report_write_failure_fcn_p)(const char *, int)); /* cleanup the whole epan module, this is used to be called only once in a program */ void epan_cleanup(void); diff --git a/epan/follow.c b/epan/follow.c index d351164a74..83f2c4b4e1 100644 --- a/epan/follow.c +++ b/epan/follow.c @@ -301,13 +301,13 @@ reassemble_tcp( guint32 tcp_stream, gulong sequence, gulong acknowledgement, /* here we search through all the frag we have collected to see if one fits */ static int -check_fragments( int index, tcp_stream_chunk *sc, gulong acknowledged ) { +check_fragments( int idx, tcp_stream_chunk *sc, gulong acknowledged ) { tcp_frag *prev = NULL; tcp_frag *current; gulong lowest_seq; gchar *dummy_str; - current = frags[index]; + current = frags[idx]; if( current ) { lowest_seq = current->seq; while( current ) { @@ -315,27 +315,27 @@ check_fragments( int index, tcp_stream_chunk *sc, gulong acknowledged ) { lowest_seq = current->seq; } - if( current->seq < seq[index] ) { + if( current->seq < seq[idx] ) { gulong newseq; /* this sequence number seems dated, but check the end to make sure it has no more info than we have already seen */ newseq = current->seq + current->len; - if( newseq > seq[index] ) { + if( newseq > seq[idx] ) { gulong new_pos; /* this one has more than we have seen. let's get the payload that we have not seen. This happens when part of this frame has been retransmitted */ - new_pos = seq[index] - current->seq; + new_pos = seq[idx] - current->seq; if ( current->data_len > new_pos ) { sc->dlen = current->data_len - new_pos; - write_packet_data( index, sc, current->data + new_pos ); + write_packet_data( idx, sc, current->data + new_pos ); } - seq[index] += (current->len - new_pos); + seq[idx] += (current->len - new_pos); } /* Remove the fragment from the list as the "new" part of it @@ -344,24 +344,24 @@ check_fragments( int index, tcp_stream_chunk *sc, gulong acknowledged ) { if( prev ) { prev->next = current->next; } else { - frags[index] = current->next; + frags[idx] = current->next; } g_free( current->data ); g_free( current ); return 1; } - if( current->seq == seq[index] ) { + if( current->seq == seq[idx] ) { /* this fragment fits the stream */ if( current->data ) { sc->dlen = current->data_len; - write_packet_data( index, sc, current->data ); + write_packet_data( idx, sc, current->data ); } - seq[index] += current->len; + seq[idx] += current->len; if( prev ) { prev->next = current->next; } else { - frags[index] = current->next; + frags[idx] = current->next; } g_free( current->data ); g_free( current ); @@ -376,11 +376,11 @@ check_fragments( int index, tcp_stream_chunk *sc, gulong acknowledged ) { * "[xxx bytes missing in capture file]". */ dummy_str = g_strdup_printf("[%d bytes missing in capture file]", - (int)(lowest_seq - seq[index]) ); + (int)(lowest_seq - seq[idx]) ); sc->dlen = (guint32) strlen(dummy_str); - write_packet_data( index, sc, dummy_str ); + write_packet_data( idx, sc, dummy_str ); g_free(dummy_str); - seq[index] = lowest_seq; + seq[idx] = lowest_seq; return 1; } } @@ -415,7 +415,7 @@ reset_tcp_reassembly(void) } static void -write_packet_data( int index, tcp_stream_chunk *sc, const char *data ) +write_packet_data( int idx, tcp_stream_chunk *sc, const char *data ) { size_t ret; @@ -425,6 +425,6 @@ write_packet_data( int index, tcp_stream_chunk *sc, const char *data ) ret = fwrite( data, 1, sc->dlen, data_out_file ); DISSECTOR_ASSERT(sc->dlen == ret); - bytes_written[index] += sc->dlen; + bytes_written[idx] += sc->dlen; empty_tcp_stream = FALSE; } diff --git a/epan/prefs.c b/epan/prefs.c index 58eae249bc..81cf8a5f57 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -2658,12 +2658,12 @@ write_pref(gpointer data, gpointer user_data) case PREF_RANGE: { - char *range_string; + char *range_string_p; - range_string = range_convert_range(*pref->varp.range); + range_string_p = range_convert_range(*pref->varp.range); fprintf(arg->pf, "# A string denoting an positive integer range (e.g., \"1-20,30-40\").\n"); fprintf(arg->pf, "%s.%s: %s\n", arg->module->name, pref->name, - range_string); + range_string_p); break; } diff --git a/epan/report_err.c b/epan/report_err.c index ca03bb210c..0cba843663 100644 --- a/epan/report_err.c +++ b/epan/report_err.c @@ -42,15 +42,15 @@ static void (*report_open_failure_func)(const char *, int, gboolean); static void (*report_read_failure_func)(const char *, int); static void (*report_write_failure_func)(const char *, int); -void init_report_err(void (*report_failure)(const char *, va_list), - void (*report_open_failure)(const char *, int, gboolean), - void (*report_read_failure)(const char *, int), - void (*report_write_failure)(const char *, int)) +void init_report_err(void (*report_failure_fcn_p)(const char *, va_list), + void (*report_open_failure_fcn_p)(const char *, int, gboolean), + void (*report_read_failure_fcn_p)(const char *, int), + void (*report_write_failure_fcn_p)(const char *, int)) { - report_failure_func = report_failure; - report_open_failure_func = report_open_failure; - report_read_failure_func = report_read_failure; - report_write_failure_func = report_write_failure; + report_failure_func = report_failure_fcn_p; + report_open_failure_func = report_open_failure_fcn_p; + report_read_failure_func = report_read_failure_fcn_p; + report_write_failure_func = report_write_failure_fcn_p; } /* diff --git a/epan/sigcomp-udvm.c b/epan/sigcomp-udvm.c index 047382f0e6..c8d3e757fa 100644 --- a/epan/sigcomp-udvm.c +++ b/epan/sigcomp-udvm.c @@ -187,7 +187,7 @@ decompress_sigcomp_message(tvbuff_t *bytecode_tvb, tvbuff_t *message_tvb, packet guint16 length; guint16 at_address; guint16 destination; - guint16 address; + guint16 addr; guint16 value; guint16 p_id_start; guint16 p_id_length; @@ -918,10 +918,10 @@ execute_next_instruction: } operand_address = current_address + 1; /* %address */ - next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &address); + next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &addr); if (show_instr_detail_level == 2 ){ proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1,"Addr: %u Address %u", - operand_address, address); + operand_address, addr); } operand_address = next_operand_address; /* %value */ @@ -930,19 +930,19 @@ execute_next_instruction: { proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1, "Addr: %u ## LOAD (%%address=%u, %%value=%u)", - current_address, address, value); + current_address, addr, value); } lsb = value & 0xff; msb = value >> 8; - buff[address] = msb; - buff[address + 1] = lsb; + buff[addr] = msb; + buff[addr + 1] = lsb; if (print_level_1 ){ proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1,"Addr: %u Value %u", operand_address, value); proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1," Loading bytes at %u Value %u 0x%x", - address, value, value); + addr, value, value); } used_udvm_cycles++; current_address = next_operand_address; @@ -962,10 +962,10 @@ execute_next_instruction: } operand_address = current_address + 1; /* %address */ - next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &address); + next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &addr); if (show_instr_detail_level == 2 ){ proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1,"Addr: %u Address %u", - operand_address, address); + operand_address, addr); } operand_address = next_operand_address; @@ -979,7 +979,7 @@ execute_next_instruction: { proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1, "Addr: %u ## MULTILOAD (%%address=%u, #n=%u, value_0, ..., value_%d)", - current_address, address, n, n-1); + current_address, addr, n, n-1); } operand_address = next_operand_address; used_udvm_cycles = used_udvm_cycles + 1 + n; @@ -990,20 +990,20 @@ execute_next_instruction: lsb = value & 0xff; msb = value >> 8; - if (address >= UDVM_MEMORY_SIZE - 1) + if (addr >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; - buff[address] = msb; - buff[address + 1] = lsb; + buff[addr] = msb; + buff[addr + 1] = lsb; /* debug */ length = next_operand_address - operand_address; if (print_level_1 ){ proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1, "Addr: %u Value %5u - Loading bytes at %5u Value %5u 0x%x", - operand_address, value, address, value, value); + operand_address, value, addr, value, value); } - address = address + 2; + addr = addr + 2; operand_address = next_operand_address; } current_address = next_operand_address; @@ -1036,13 +1036,13 @@ execute_next_instruction: stack_location = (buff[70] << 8) | buff[71]; stack_fill = (buff[stack_location] << 8) | buff[(stack_location+1) & 0xFFFF]; - address = (stack_location + stack_fill * 2 + 2) & 0xFFFF; + addr = (stack_location + stack_fill * 2 + 2) & 0xFFFF; - if (address >= UDVM_MEMORY_SIZE - 1) + if (addr >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; - buff[address] = (value >> 8) & 0x00FF; - buff[(address+1) & 0xFFFF] = value & 0x00FF; + buff[addr] = (value >> 8) & 0x00FF; + buff[(addr+1) & 0xFFFF] = value & 0x00FF; if (stack_location >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; @@ -1094,13 +1094,13 @@ execute_next_instruction: buff[stack_location] = (stack_fill >> 8) & 0x00FF; buff[(stack_location+1) & 0xFFFF] = stack_fill & 0x00FF; - address = (stack_location + stack_fill * 2 + 2) & 0xFFFF; + addr = (stack_location + stack_fill * 2 + 2) & 0xFFFF; - if (address >= UDVM_MEMORY_SIZE - 1) + if (addr >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; - value = (buff[address] << 8) - | buff[(address+1) & 0xFFFF]; + value = (buff[addr] << 8) + | buff[(addr+1) & 0xFFFF]; /* ... and store the popped value. */ if (destination >= UDVM_MEMORY_SIZE - 1) @@ -1433,10 +1433,10 @@ execute_next_instruction: operand_address = current_address + 1; /* %address */ - next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &address); + next_operand_address = decode_udvm_multitype_operand(buff, operand_address, &addr); if (show_instr_detail_level == 2 ){ proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1,"Addr: %u Address %u", - operand_address, address); + operand_address, addr); } operand_address = next_operand_address; @@ -1465,7 +1465,7 @@ execute_next_instruction: { proto_tree_add_text(udvm_tree, bytecode_tvb, 0, -1, "Addr: %u ## MEMSET (address=%u, length=%u, start_value=%u, offset=%u)", - current_address, address, length, start_value, multy_offset); + current_address, addr, length, start_value, multy_offset); } current_address = next_operand_address; /* exetute the instruction @@ -1475,7 +1475,7 @@ execute_next_instruction: * Seq[n] := (start_value + n * offset) modulo 256 */ n = 0; - k = address; + k = addr; byte_copy_right = buff[66] << 8; byte_copy_right = byte_copy_right | buff[67]; byte_copy_left = buff[64] << 8; @@ -1629,11 +1629,11 @@ execute_next_instruction: stack_location = (buff[70] << 8) | buff[71]; stack_fill = (buff[stack_location] << 8) | buff[(stack_location+1) & 0xFFFF]; - address = (stack_location + stack_fill * 2 + 2) & 0xFFFF; - if (address >= UDVM_MEMORY_SIZE - 1) + addr = (stack_location + stack_fill * 2 + 2) & 0xFFFF; + if (addr >= UDVM_MEMORY_SIZE - 1) goto decompression_failure; - buff[address] = (current_address >> 8) & 0x00FF; - buff[(address+1) & 0xFFFF] = current_address & 0x00FF; + buff[addr] = (current_address >> 8) & 0x00FF; + buff[(addr+1) & 0xFFFF] = current_address & 0x00FF; stack_fill = (stack_fill + 1) & 0xFFFF; if (stack_location >= UDVM_MEMORY_SIZE - 1) @@ -1672,9 +1672,9 @@ execute_next_instruction: buff[stack_location] = (stack_fill >> 8) & 0x00FF; buff[(stack_location+1) & 0xFFFF] = stack_fill & 0x00FF; - address = (stack_location + stack_fill * 2 + 2) & 0xFFFF; - at_address = (buff[address] << 8) - | buff[(address+1) & 0xFFFF]; + addr = (stack_location + stack_fill * 2 + 2) & 0xFFFF; + at_address = (buff[addr] << 8) + | buff[(addr+1) & 0xFFFF]; /* ... and set the PC to the popped value */ current_address = at_address; diff --git a/epan/strutil.c b/epan/strutil.c index f6b9b9e4d7..eebbff38ed 100644 --- a/epan/strutil.c +++ b/epan/strutil.c @@ -993,7 +993,7 @@ escape_string(char *buf, const char *string) const gchar *p; gchar c; char *bufp; - char hex[3]; + char hexbuf[3]; bufp = buf; *bufp++ = '"'; @@ -1008,11 +1008,11 @@ escape_string(char *buf, const char *string) * in ASCII need to be escaped. */ else if (!isprint((unsigned char)c)) { /* c --> \xNN */ - g_snprintf(hex,sizeof(hex), "%02x", (unsigned char) c); + g_snprintf(hexbuf,sizeof(hexbuf), "%02x", (unsigned char) c); *bufp++ = '\\'; *bufp++ = 'x'; - *bufp++ = hex[0]; - *bufp++ = hex[1]; + *bufp++ = hexbuf[0]; + *bufp++ = hexbuf[1]; } /* Other characters are just passed through. */ else { diff --git a/epan/to_str.c b/epan/to_str.c index 88a7590984..c320d62776 100644 --- a/epan/to_str.c +++ b/epan/to_str.c @@ -143,32 +143,32 @@ bytestring_to_str(const guint8 *ad, guint32 len, char punct) { * If time is negative, add a '-' to all non-null components. */ static void -time_secs_to_str_buf(gint32 time, guint32 frac, gboolean is_nsecs, +time_secs_to_str_buf(gint32 time_val, guint32 frac, gboolean is_nsecs, emem_strbuf_t *buf) { int hours, mins, secs; const gchar *msign = ""; gboolean do_comma = FALSE; - if(time == G_MININT32) { /* That Which Shall Not Be Negated */ - ep_strbuf_append_printf(buf, "Unable to cope with time value %d", time); + if(time_val == G_MININT32) { /* That Which Shall Not Be Negated */ + ep_strbuf_append_printf(buf, "Unable to cope with time value %d", time_val); return; } - if(time < 0){ - time = -time; + if(time_val < 0){ + time_val = -time_val; msign = "-"; } - secs = time % 60; - time /= 60; - mins = time % 60; - time /= 60; - hours = time % 24; - time /= 24; + secs = time_val % 60; + time_val /= 60; + mins = time_val % 60; + time_val /= 60; + hours = time_val % 24; + time_val /= 24; - if (time != 0) { - ep_strbuf_append_printf(buf, "%s%u day%s", msign, time, PLURALIZE(time)); + if (time_val != 0) { + ep_strbuf_append_printf(buf, "%s%u day%s", msign, time_val, PLURALIZE(time_val)); do_comma = TRUE; msign=""; } @@ -194,37 +194,37 @@ time_secs_to_str_buf(gint32 time, guint32 frac, gboolean is_nsecs, } gchar * -time_secs_to_str(gint32 time) +time_secs_to_str(gint32 time_val) { emem_strbuf_t *buf; buf=ep_strbuf_sized_new(TIME_SECS_LEN+1, TIME_SECS_LEN+1); - if (time == 0) { + if (time_val == 0) { ep_strbuf_append(buf, "0 time"); return buf->str; } - time_secs_to_str_buf(time, 0, FALSE, buf); + time_secs_to_str_buf(time_val, 0, FALSE, buf); return buf->str; } static void -time_secs_to_str_buf_unsigned(guint32 time, guint32 frac, gboolean is_nsecs, +time_secs_to_str_buf_unsigned(guint32 time_val, guint32 frac, gboolean is_nsecs, emem_strbuf_t *buf) { int hours, mins, secs; gboolean do_comma = FALSE; - secs = time % 60; - time /= 60; - mins = time % 60; - time /= 60; - hours = time % 24; - time /= 24; + secs = time_val % 60; + time_val /= 60; + mins = time_val % 60; + time_val /= 60; + hours = time_val % 24; + time_val /= 24; - if (time != 0) { - ep_strbuf_append_printf(buf, "%u day%s", time, PLURALIZE(time)); + if (time_val != 0) { + ep_strbuf_append_printf(buf, "%u day%s", time_val, PLURALIZE(time_val)); do_comma = TRUE; } if (hours != 0) { @@ -247,47 +247,47 @@ time_secs_to_str_buf_unsigned(guint32 time, guint32 frac, gboolean is_nsecs, } gchar * -time_secs_to_str_unsigned(guint32 time) +time_secs_to_str_unsigned(guint32 time_val) { emem_strbuf_t *buf; buf=ep_strbuf_sized_new(TIME_SECS_LEN+1, TIME_SECS_LEN+1); - if (time == 0) { + if (time_val == 0) { ep_strbuf_append(buf, "0 time"); return buf->str; } - time_secs_to_str_buf_unsigned(time, 0, FALSE, buf); + time_secs_to_str_buf_unsigned(time_val, 0, FALSE, buf); return buf->str; } gchar * -time_msecs_to_str(gint32 time) +time_msecs_to_str(gint32 time_val) { emem_strbuf_t *buf; int msecs; buf=ep_strbuf_sized_new(TIME_SECS_LEN+1+3+1, TIME_SECS_LEN+1+3+1); - if (time == 0) { + if (time_val == 0) { ep_strbuf_append(buf, "0 time"); return buf->str; } - if(time<0){ + if(time_val<0){ /* oops we got passed a negative time */ - time= -time; - msecs = time % 1000; - time /= 1000; - time= -time; + time_val= -time_val; + msecs = time_val % 1000; + time_val /= 1000; + time_val= -time_val; } else { - msecs = time % 1000; - time /= 1000; + msecs = time_val % 1000; + time_val /= 1000; } - time_secs_to_str_buf(time, msecs, FALSE, buf); + time_secs_to_str_buf(time_val, msecs, FALSE, buf); return buf->str; } @@ -510,7 +510,7 @@ rel_time_to_str(nstime_t *rel_time) { emem_strbuf_t *buf; const char *sign; - gint32 time; + gint32 time_val; gint32 nsec; buf=ep_strbuf_sized_new(1+TIME_SECS_LEN+1+6+1, 1+TIME_SECS_LEN+1+6+1); @@ -520,9 +520,9 @@ rel_time_to_str(nstime_t *rel_time) (the seconds part should be zero in that case), stick a "-" in front of the entire time stamp. */ sign = ""; - time = (gint) rel_time->secs; + time_val = (gint) rel_time->secs; nsec = rel_time->nsecs; - if (time == 0 && nsec == 0) { + if (time_val == 0 && nsec == 0) { ep_strbuf_append(buf, "0.000000000 seconds"); return buf->str; } @@ -535,10 +535,10 @@ rel_time_to_str(nstime_t *rel_time) * or zero; if it's not, the time stamp is bogus, * with a positive seconds and negative microseconds. */ - time = (gint) -rel_time->secs; + time_val = (gint) -rel_time->secs; } - time_secs_to_str_buf(time, nsec, TRUE, buf); + time_secs_to_str_buf(time_val, nsec, TRUE, buf); return buf->str; } diff --git a/epan/tvbparse.c b/epan/tvbparse.c index 53bee6fec6..34d78298e2 100644 --- a/epan/tvbparse.c +++ b/epan/tvbparse.c @@ -104,7 +104,7 @@ static tvbparse_elem_t* new_tok(tvbparse_t* tt, return tok; } -static int ignore(tvbparse_t* tt,int offset) { +static int ignore_fcn(tvbparse_t* tt,int offset) { int len = 0; int consumed; tvbparse_elem_t* ignored = NULL; @@ -626,7 +626,7 @@ static int cond_seq(tvbparse_t* tt, int offset, const tvbparse_wanted_t * wanted } offset += len; - offset += ignore(tt,offset); + offset += ignore_fcn(tt,offset); } *tok = ret_tok; @@ -1282,7 +1282,7 @@ gboolean tvbparse_peek(tvbparse_t* tt, if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) g_warning("tvbparse_peek: ENTER offset=%i",offset); #endif - offset += ignore(tt,offset); + offset += ignore_fcn(tt,offset); #ifdef TVBPARSE_DEBUG if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_PEEK) g_warning("tvbparse_peek: after ignore offset=%i",offset); @@ -1314,7 +1314,7 @@ tvbparse_elem_t* tvbparse_get(tvbparse_t* tt, if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) g_warning("tvbparse_get: ENTER offset=%i",offset); #endif - offset += ignore(tt,offset); + offset += ignore_fcn(tt,offset); #ifdef TVBPARSE_DEBUG if (TVBPARSE_DEBUG & TVBPARSE_DEBUG_GET) g_warning("tvbparse_get: after ignore offset=%i",offset); diff --git a/epan/tvbuff.c b/epan/tvbuff.c index e4190ae983..5979d114f9 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -346,7 +346,7 @@ tvb_new_child_real_data(tvbuff_t *parent, const guint8* data, guint length, gint * that gets an exception, so the error is reported as an error in that * protocol rather than the containing protocol. */ static gboolean -compute_offset_length(guint tvb_length, guint tvb_reported_length, gint offset, gint length, +compute_offset_length(guint tvb_length_val, guint tvb_reported_length_val, gint offset, gint length_val, guint *offset_ptr, guint *length_ptr, int *exception) { DISSECTOR_ASSERT(offset_ptr); @@ -355,13 +355,13 @@ compute_offset_length(guint tvb_length, guint tvb_reported_length, gint offset, /* Compute the offset */ if (offset >= 0) { /* Positive offset - relative to the beginning of the packet. */ - if ((guint) offset > tvb_reported_length) { + if ((guint) offset > tvb_reported_length_val) { if (exception) { *exception = ReportedBoundsError; } return FALSE; } - else if ((guint) offset > tvb_length) { + else if ((guint) offset > tvb_length_val) { if (exception) { *exception = BoundsError; } @@ -373,36 +373,36 @@ compute_offset_length(guint tvb_length, guint tvb_reported_length, gint offset, } else { /* Negative offset - relative to the end of the packet. */ - if ((guint) -offset > tvb_reported_length) { + if ((guint) -offset > tvb_reported_length_val) { if (exception) { *exception = ReportedBoundsError; } return FALSE; } - else if ((guint) -offset > tvb_length) { + else if ((guint) -offset > tvb_length_val) { if (exception) { *exception = BoundsError; } return FALSE; } else { - *offset_ptr = tvb_length + offset; + *offset_ptr = tvb_length_val + offset; } } /* Compute the length */ - if (length < -1) { + if (length_val < -1) { if (exception) { /* XXX - ReportedBoundsError? */ *exception = BoundsError; } return FALSE; } - else if (length == -1) { - *length_ptr = tvb_length - *offset_ptr; + else if (length_val == -1) { + *length_ptr = tvb_length_val - *offset_ptr; } else { - *length_ptr = length; + *length_ptr = length_val; } return TRUE; @@ -410,12 +410,12 @@ compute_offset_length(guint tvb_length, guint tvb_reported_length, gint offset, static gboolean -check_offset_length_no_exception(guint tvb_length, guint tvb_reported_length, gint offset, gint length, +check_offset_length_no_exception(guint tvb_length_val, guint tvb_reported_length_val, gint offset, gint length_val, guint *offset_ptr, guint *length_ptr, int *exception) { guint end_offset; - if (!compute_offset_length(tvb_length, tvb_reported_length, offset, length, offset_ptr, length_ptr, exception)) { + if (!compute_offset_length(tvb_length_val, tvb_reported_length_val, offset, length_val, offset_ptr, length_ptr, exception)) { return FALSE; } @@ -439,10 +439,10 @@ check_offset_length_no_exception(guint tvb_length, guint tvb_reported_length, gi * If not, return TRUE; otherwise, return FALSE and, if "exception" * is non-null, return the appropriate exception through it. */ - if (end_offset <= tvb_length) { + if (end_offset <= tvb_length_val) { return TRUE; } - else if (end_offset <= tvb_reported_length) { + else if (end_offset <= tvb_reported_length_val) { if (exception) { *exception = BoundsError; } @@ -460,12 +460,12 @@ check_offset_length_no_exception(guint tvb_length, guint tvb_reported_length, gi * either is out of bounds. Sets integer ptrs to the new offset * and length. */ static void -check_offset_length(guint tvb_length, guint tvb_reported_length, gint offset, gint length, +check_offset_length(guint tvb_length_val, guint tvb_reported_length_val, gint offset, gint length_val, guint *offset_ptr, guint *length_ptr) { int exception = 0; - if (!check_offset_length_no_exception(tvb_length, tvb_reported_length, offset, length, offset_ptr, length_ptr, &exception)) { + if (!check_offset_length_no_exception(tvb_length_val, tvb_reported_length_val, offset, length_val, offset_ptr, length_ptr, &exception)) { DISSECTOR_ASSERT(exception > 0); THROW(exception); } |