diff options
author | Bill Meier <wmeier@newsguy.com> | 2015-02-09 13:42:51 -0500 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2015-02-09 18:57:14 +0000 |
commit | e88a11f5c92938f0ed451703a3e1de34f76a5e50 (patch) | |
tree | 3c23b42e3d0c8db0724a160783c82fa184ecbebd /ui/cli | |
parent | 2078a95e934cf1063f2525a93b5f81ddb7b43e77 (diff) |
(Trivial) Fix printf-related 'Mismatch on sign' warnings
Found by MSVC2013 Code Analysis
Change-Id: I58063946dd558e98308c87b36eeac0ddbe1a6e79
Reviewed-on: https://code.wireshark.org/review/7045
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'ui/cli')
-rw-r--r-- | ui/cli/tap-afpstat.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-camelcounter.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-camelsrt.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-comparestat.c | 10 | ||||
-rw-r--r-- | ui/cli/tap-diameter-avp.c | 4 | ||||
-rw-r--r-- | ui/cli/tap-expert.c | 4 | ||||
-rw-r--r-- | ui/cli/tap-follow.c | 6 | ||||
-rw-r--r-- | ui/cli/tap-iostat.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-protohierstat.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-rpcprogs.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-rpcstat.c | 6 | ||||
-rw-r--r-- | ui/cli/tap-scsistat.c | 7 | ||||
-rw-r--r-- | ui/cli/tap-sipstat.c | 6 | ||||
-rw-r--r-- | ui/cli/tap-smbstat.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-wspstat.c | 4 |
15 files changed, 31 insertions, 30 deletions
diff --git a/ui/cli/tap-afpstat.c b/ui/cli/tap-afpstat.c index a146223690..f6bfb82aa9 100644 --- a/ui/cli/tap-afpstat.c +++ b/ui/cli/tap-afpstat.c @@ -96,7 +96,7 @@ afpstat_draw(void *pss) } tmp_str = val_to_str_ext_wmem(NULL, i, &CommandCode_vals_ext, "Unknown (%u)"); - printf("%-25s %6d %3d.%05d %3d.%05d %3" G_GINT64_MODIFIER "u.%05" G_GINT64_MODIFIER "u\n", + printf("%-25s %6u %3d.%05d %3d.%05d %3" G_GINT64_MODIFIER "u.%05" G_GINT64_MODIFIER "u\n", tmp_str, ss->proc[i].num, (int)ss->proc[i].min.secs, ss->proc[i].min.nsecs/10000, diff --git a/ui/cli/tap-camelcounter.c b/ui/cli/tap-camelcounter.c index 0eb40de997..e0bca3263c 100644 --- a/ui/cli/tap-camelcounter.c +++ b/ui/cli/tap-camelcounter.c @@ -79,7 +79,7 @@ static void camelcounter_draw(void *phs) tmp_str = val_to_str_wmem(NULL, i, camel_opr_code_strings, "Unknown message (%d)"); printf("%30s ", tmp_str); wmem_free(NULL, tmp_str); - printf("%6d\n", p_counter->camel_msg[i]); + printf("%6u\n", p_counter->camel_msg[i]); } } /* Message Type */ printf("------------------------------------------\n"); diff --git a/ui/cli/tap-camelsrt.c b/ui/cli/tap-camelsrt.c index 7d2ab8d470..73aaff2073 100644 --- a/ui/cli/tap-camelsrt.c +++ b/ui/cli/tap-camelsrt.c @@ -124,7 +124,7 @@ static void camelsrt_draw(void *phs) if (hs->stats[j].num == 0) { tmp_str = val_to_str_wmem(NULL, j, camelSRTtype_naming, "Unknown Message 0x%02x"); printf("|%24s |%8u |%8.2f ms|%8.2f ms|%8.2f ms|%10u |%10u |\n", - tmp_str, 0, 0.0, 0.0, 0.0, 0, 0); + tmp_str, 0U, 0.0, 0.0, 0.0, 0U, 0U); wmem_free(NULL, tmp_str); continue; } diff --git a/ui/cli/tap-comparestat.c b/ui/cli/tap-comparestat.c index 3d85d4ff09..d98fee2103 100644 --- a/ui/cli/tap-comparestat.c +++ b/ui/cli/tap-comparestat.c @@ -398,11 +398,11 @@ call_foreach_print_ip_tree(gpointer key _U_, gpointer value, gpointer user_data) if (show_it) { if (fInfo->fp->count < MERGED_FILES) { - printf("Packet id :%i, count:%i Problem:", fInfo->id, fInfo->fp->count); + printf("Packet id :%u, count:%u Problem:", fInfo->id, fInfo->fp->count); printf("Packet lost\n"); } if (fInfo->fp->count > MERGED_FILES) { - printf("Packet id :%i, count:%i Problem:", fInfo->id, fInfo->fp->count); + printf("Packet id :%u, count:%u Problem:", fInfo->id, fInfo->fp->count); printf("More than two packets\n"); if (fInfo->fp->cksum == WRONG_CHKSUM) { printf("Checksum error over IP header\n"); @@ -410,7 +410,7 @@ call_foreach_print_ip_tree(gpointer key _U_, gpointer value, gpointer user_data) } if (fInfo->fp->count == MERGED_FILES) { if (fInfo->fp->cksum == WRONG_CHKSUM) { - printf("Packet id :%i, count:%i Problem:", fInfo->id, fInfo->fp->count); + printf("Packet id :%u, count:%u Problem:", fInfo->id, fInfo->fp->count); printf("Checksum error over IP header\n"); if (((delta < (average-cs->stats.variance)) || (delta > (average+cs->stats.variance))) && (delta > 0.0) && (cs->stats.variance != 0)) { printf("Not arrived in time\n"); @@ -419,13 +419,13 @@ call_foreach_print_ip_tree(gpointer key _U_, gpointer value, gpointer user_data) printf("Not correct order\n"); } } else if (((delta < (average-cs->stats.variance)) || (delta > (average+cs->stats.variance))) && (delta > 0.0) && (cs->stats.variance != 0)) { - printf("Packet id :%i, count:%i Problem:", fInfo->id, fInfo->fp->count); + printf("Packet id :%u, count:%u Problem:", fInfo->id, fInfo->fp->count); printf("Package not arrived in time\n"); if ((nstime_cmp(&fInfo->fp->predecessor_time, &fInfo->zebra_time) > 0 || nstime_cmp(&fInfo->fp->partner->fp->predecessor_time, &fInfo->fp->partner->zebra_time) > 0) && fInfo->zebra_time.nsecs != MERGED_FILES && ON_method) { printf("Not correct order\n"); } } else if ((nstime_cmp(&fInfo->fp->predecessor_time, &fInfo->zebra_time) > 0 || nstime_cmp(&fInfo->fp->partner->fp->predecessor_time, &fInfo->fp->partner->zebra_time) > 0) && fInfo->zebra_time.nsecs != MERGED_FILES && ON_method) { - printf("Packet id :%i, count:%i Problem:", fInfo->id, fInfo->fp->count); + printf("Packet id :%u, count:%u Problem:", fInfo->id, fInfo->fp->count); printf("Not correct order\n"); } } diff --git a/ui/cli/tap-diameter-avp.c b/ui/cli/tap-diameter-avp.c index 54900cf64b..c93b1744d7 100644 --- a/ui/cli/tap-diameter-avp.c +++ b/ui/cli/tap-diameter-avp.c @@ -186,7 +186,7 @@ diameteravp_packet(void *pds, packet_info *pinfo, epan_dissect_t *edt _U_, const ds->paired_ans_count++; } /* Output frame data.*/ - printf("frame='%d' time='%f' src='%s' srcport='%d' dst='%s' dstport='%d' proto='diameter' msgnr='%d' is_request='%d' cmd='%d' req_frame='%d' ans_frame='%d' resp_time='%f' ", + printf("frame='%u' time='%f' src='%s' srcport='%u' dst='%s' dstport='%u' proto='diameter' msgnr='%u' is_request='%d' cmd='%u' req_frame='%u' ans_frame='%u' resp_time='%f' ", pinfo->fd->num, nstime_to_sec(&pinfo->fd->abs_ts), address_to_str(pinfo->pool, &pinfo->src), pinfo->srcport, address_to_str(pinfo->pool, &pinfo->dst), pinfo->destport, ds->diammsg_toprocess, is_request, cmd_code, req_frame, ans_frame, resp_time); /* Visit selected nodes of one diameter message.*/ tree_traverse_pre_order(current, diam_tree_to_csv, &ds); @@ -205,7 +205,7 @@ diameteravp_draw(void *pds) { diameteravp_t *ds = (diameteravp_t *)pds; /* printing results */ - printf("=== Diameter Summary ===\nrequset count:\t%d\nanswer count:\t%d\nreq/ans pairs:\t%d\n", ds->req_count, ds->ans_count, ds->paired_ans_count); + printf("=== Diameter Summary ===\nrequset count:\t%u\nanswer count:\t%u\nreq/ans pairs:\t%u\n", ds->req_count, ds->ans_count, ds->paired_ans_count); } diff --git a/ui/cli/tap-expert.c b/ui/cli/tap-expert.c index f90002ad2b..4acdcd1692 100644 --- a/ui/cli/tap-expert.c +++ b/ui/cli/tap-expert.c @@ -159,7 +159,7 @@ static void draw_items_for_severity(GArray *items, const gchar *label) } /* Title */ - printf("\n%s (%u)\n", label, total); + printf("\n%s (%d)\n", label, total); printf("=============\n"); /* Column headings */ @@ -169,7 +169,7 @@ static void draw_items_for_severity(GArray *items, const gchar *label) for (n=0; n < items->len; n++) { ei = &g_array_index(items, expert_entry, n); tmp_str = val_to_str_wmem(NULL, ei->group, expert_group_vals, "Unknown (%d)"); - printf("%12u %10s %18s %s\n", + printf("%12d %10s %18s %s\n", ei->frequency, tmp_str, ei->protocol, ei->summary); diff --git a/ui/cli/tap-follow.c b/ui/cli/tap-follow.c index 9646cc7923..d9f4f0d610 100644 --- a/ui/cli/tap-follow.c +++ b/ui/cli/tap-follow.c @@ -596,11 +596,11 @@ followDraw( address_to_str_buf(addr[node], buf, sizeof buf); if (addr[node]->type == AT_IPv6) { - printf("Node %u: [%s]:%d\n", node, buf, port[node]); + printf("Node %d: [%s]:%d\n", node, buf, port[node]); } else { - printf("Node %u: %s:%d\n", node, buf, port[node]); + printf("Node %d: %s:%d\n", node, buf, port[node]); } } @@ -632,7 +632,7 @@ followDraw( break; case mode_ASCII: - printf("%s%d\n", node ? "\t" : "", sc.dlen); + printf("%s%u\n", node ? "\t" : "", sc.dlen); break; case mode_RAW: diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c index 6b72c3a833..e175a9be6a 100644 --- a/ui/cli/tap-iostat.c +++ b/ui/cli/tap-iostat.c @@ -891,7 +891,7 @@ iostat_draw(void *arg) else spaces_s = &spaces[borderlen - col_w[j].val]; - printf("%-2u%s|", j+1, spaces_s); + printf("%-2d%s|", j+1, spaces_s); } if (tabrow_w < borderlen) { filler_s = &spaces[tabrow_w+1]; diff --git a/ui/cli/tap-protohierstat.c b/ui/cli/tap-protohierstat.c index 178892ccdb..292e83f8a8 100644 --- a/ui/cli/tap-protohierstat.c +++ b/ui/cli/tap-protohierstat.c @@ -145,7 +145,7 @@ phs_draw(phs_t *rs, int indentation) stroff += g_snprintf(str+stroff, MAXPHSLINE-stroff, " "); } g_snprintf(str+stroff, MAXPHSLINE-stroff, "%s", rs->proto_name); - printf("%-40s frames:%d bytes:%" G_GINT64_MODIFIER "d\n", str, rs->frames, rs->bytes); + printf("%-40s frames:%u bytes:%" G_GINT64_MODIFIER "u\n", str, rs->frames, rs->bytes); phs_draw(rs->child, indentation+1); } } diff --git a/ui/cli/tap-rpcprogs.c b/ui/cli/tap-rpcprogs.c index 611abf5894..6d7c1ceaa7 100644 --- a/ui/cli/tap-rpcprogs.c +++ b/ui/cli/tap-rpcprogs.c @@ -193,7 +193,7 @@ rpcprogs_draw(void *dummy _U_) td = ((td / rp->num) + 500) / 1000; g_snprintf(str, sizeof(str), "%s(%d)", rpc_prog_name(rp->program), rp->program); - printf("%-15s %2d %6d %3d.%06d %3d.%06d %3" G_GINT64_MODIFIER "u.%06" G_GINT64_MODIFIER "u\n", + printf("%-15s %2u %6d %3d.%06d %3d.%06d %3" G_GINT64_MODIFIER "u.%06" G_GINT64_MODIFIER "u\n", str, rp->version, rp->num, diff --git a/ui/cli/tap-rpcstat.c b/ui/cli/tap-rpcstat.c index b17fed7cd9..9a74c7bda6 100644 --- a/ui/cli/tap-rpcstat.c +++ b/ui/cli/tap-rpcstat.c @@ -199,7 +199,7 @@ rpcstat_draw(void *prs) guint64 td; printf("\n"); printf("==================================================================\n"); - printf("%s Version %d SRT Statistics:\n", rs->prog, rs->version); + printf("%s Version %u SRT Statistics:\n", rs->prog, rs->version); printf("Filter: %s\n", rs->filter ? rs->filter : ""); printf("Procedure Calls Min SRT Max SRT Avg SRT Total\n"); for (i=0; i<rs->num_procedures; i++) { @@ -298,8 +298,8 @@ rpcstat_init(const char *opt_arg, void *userdata _U_) rpc_max_proc = -1; g_hash_table_foreach(rpc_procs, (GHFunc)rpcstat_find_procs, NULL); if (rpc_min_proc == -1) { - fprintf(stderr, "tshark: Invalid -z rpc,srt,%d,%d\n", rpc_program, rpc_version); - fprintf(stderr, " Program:%d version:%d isn't supported by tshark.\n", rpc_program, rpc_version); + fprintf(stderr, "tshark: Invalid -z rpc,srt,%u,%u\n", rpc_program, rpc_version); + fprintf(stderr, " Program:%u version:%u isn't supported by tshark.\n", rpc_program, rpc_version); exit(1); } diff --git a/ui/cli/tap-scsistat.c b/ui/cli/tap-scsistat.c index 8160e4e899..6bfe84f947 100644 --- a/ui/cli/tap-scsistat.c +++ b/ui/cli/tap-scsistat.c @@ -58,7 +58,8 @@ typedef struct _scsistat_t { scsi_procedure_t *procedures; } scsistat_t; -#define NANOSECS_PER_SEC 1000000000 +#define MICROSECS_PER_SEC 1000000 +#define NANOSECS_PER_SEC 1000000000 static void scsistat_reset(void *prs) @@ -153,14 +154,14 @@ scsistat_draw(void *prs) td = ((guint64)(rs->procedures[i].tot.secs)) * NANOSECS_PER_SEC + rs->procedures[i].tot.nsecs; td = ((td / rs->procedures[i].num) + 500) / 1000; - printf("%-19s %6d %3d.%06u %3d.%06u %3d.%06u \n", + printf("%-19s %6d %3d.%06d %3d.%06d %3u.%06u \n", rs->procedures[i].proc, rs->procedures[i].num, (int)(rs->procedures[i].min.secs), (rs->procedures[i].min.nsecs+500)/1000, (int)(rs->procedures[i].max.secs), (rs->procedures[i].max.nsecs+500)/1000, - (int)(td/1000000), (int)(td%1000000) + (td/MICROSECS_PER_SEC), (td%MICROSECS_PER_SEC) ); } printf("===========================================================\n"); diff --git a/ui/cli/tap-sipstat.c b/ui/cli/tap-sipstat.c index e8e0271f61..d12d620365 100644 --- a/ui/cli/tap-sipstat.c +++ b/ui/cli/tap-sipstat.c @@ -375,15 +375,15 @@ sipstat_draw(void *psp ) else printf("SIP Statistics with filter %s\n", sp->filter); - printf("\nNumber of SIP messages: %d", sp->packets); - printf("\nNumber of resent SIP messages: %d\n", sp->resent_packets); + printf("\nNumber of SIP messages: %u", sp->packets); + printf("\nNumber of resent SIP messages: %u\n", sp->resent_packets); printf( "\n* SIP Status Codes in reply packets\n"); g_hash_table_foreach(sp->hash_responses, (GHFunc)sip_draw_hash_responses, (gpointer)" SIP %3d %-15s : %5d Packets\n"); printf("\n* List of SIP Request methods\n"); g_hash_table_foreach(sp->hash_requests, (GHFunc)sip_draw_hash_requests, (gpointer)" %-15s : %5d Packets\n"); - printf( "\n* Average setup time %d ms\n Min %d ms\n Max %d ms\n", sp->average_setup_time, sp->min_setup_time, sp->max_setup_time); + printf( "\n* Average setup time %u ms\n Min %u ms\n Max %u ms\n", sp->average_setup_time, sp->min_setup_time, sp->max_setup_time); printf("===================================================================\n"); } diff --git a/ui/cli/tap-smbstat.c b/ui/cli/tap-smbstat.c index 6142d28755..a8cd9667a4 100644 --- a/ui/cli/tap-smbstat.c +++ b/ui/cli/tap-smbstat.c @@ -129,7 +129,7 @@ smbstat_draw(void *pss) td = ((td / ss->proc[i].num) + 500) / 1000; tmp_str = val_to_str_ext_wmem(NULL, i, &smb_cmd_vals_ext, "Unknown (0x%02x)"); - printf("%-25s %6d %3d.%06d %3d.%06d %3" G_GINT64_MODIFIER "u.%06" G_GINT64_MODIFIER "u\n", + printf("%-25s %6u %3d.%06d %3d.%06d %3" G_GINT64_MODIFIER "u.%06" G_GINT64_MODIFIER "u\n", tmp_str, ss->proc[i].num, (int)(ss->proc[i].min.secs), (ss->proc[i].min.nsecs+500)/1000, diff --git a/ui/cli/tap-wspstat.c b/ui/cli/tap-wspstat.c index 8c882bbfe9..eb06a67d88 100644 --- a/ui/cli/tap-wspstat.c +++ b/ui/cli/tap-wspstat.c @@ -187,10 +187,10 @@ wspstat_draw(void *psp) for (i=1; i <= ((sp->num_pdus+1)/2); i++) { guint32 ii = i+sp->num_pdus/2; - printf("%-23s %9d", sp->pdu_stats[i ].type, sp->pdu_stats[i ].packets); + printf("%-23s %9u", sp->pdu_stats[i ].type, sp->pdu_stats[i ].packets); printf(" || "); if (ii< (sp->num_pdus) ) - printf("%-23s %9d\n", sp->pdu_stats[ii].type, sp->pdu_stats[ii].packets); + printf("%-23s %9u\n", sp->pdu_stats[ii].type, sp->pdu_stats[ii].packets); else printf("\n"); } |