summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2007-04-16 04:34:07 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2007-04-16 04:34:07 +0000
commit1295039ee92089af47f3711ef42c3e9f7d77441b (patch)
treeabbc25f3f887dc99374d38bffeb295dd1713e481
parent7279a4243170652e77b3314379da930c6ca603ee (diff)
downloadwireshark-1295039ee92089af47f3711ef42c3e9f7d77441b.tar.gz
Wireshark now requires support for 64-bit types so there's no need to #ifdef
around them. Print 64-bit types using the PRI macros; add inttypes.h to tap.h (if necessary) to pick up those macros for all the taps. svn path=/trunk/; revision=21442
-rw-r--r--epan/tap.h4
-rw-r--r--tap-afpstat.c9
-rw-r--r--tap-dcerpcstat.c9
-rw-r--r--tap-rpcprogs.c9
-rw-r--r--tap-rpcstat.c9
-rw-r--r--tap-smbstat.c19
6 files changed, 18 insertions, 41 deletions
diff --git a/epan/tap.h b/epan/tap.h
index 9e50c65eef..30dfffb9f9 100644
--- a/epan/tap.h
+++ b/epan/tap.h
@@ -27,6 +27,10 @@
#include "epan/epan.h"
+#ifdef INTTYPES_H_DEFINES_FORMATS
+#include <inttypes.h>
+#endif
+
/* With MSVC and a libwireshark.dll, we need a
* special declaration of num_tap_filters.
*/
diff --git a/tap-afpstat.c b/tap-afpstat.c
index 003243b844..704b1716ab 100644
--- a/tap-afpstat.c
+++ b/tap-afpstat.c
@@ -79,11 +79,7 @@ afpstat_draw(void *pss)
{
afpstat_t *ss=(afpstat_t *)pss;
guint32 i;
-#ifdef G_HAVE_UINT64
guint64 td;
-#else
- guint32 td;
-#endif
printf("\n");
printf("===================================================================\n");
printf("AFP RTT Statistics:\n");
@@ -96,8 +92,7 @@ afpstat_draw(void *pss)
}
/* scale it to units of 10us.*/
- /* for long captures with a large tot time, this can overflow on 32bit */
- td=(int)ss->proc[i].tot.secs;
+ td=ss->proc[i].tot.secs;
td=td*100000+(int)ss->proc[i].tot.nsecs/10000;
if(ss->proc[i].num){
td/=ss->proc[i].num;
@@ -105,7 +100,7 @@ afpstat_draw(void *pss)
td=0;
}
- printf("%-25s %6d %3d.%05d %3d.%05d %3d.%05d\n",
+ printf("%-25s %6d %3d.%05d %3d.%05d %3" PRIu64 ".%05" PRIu64 "\n",
val_to_str(i, CommandCode_vals, "Unknown (%u)"),
ss->proc[i].num,
(int)ss->proc[i].min.secs,ss->proc[i].min.nsecs/10000,
diff --git a/tap-dcerpcstat.c b/tap-dcerpcstat.c
index 99767166c8..3fa638ea9e 100644
--- a/tap-dcerpcstat.c
+++ b/tap-dcerpcstat.c
@@ -147,11 +147,7 @@ dcerpcstat_draw(void *prs)
{
rpcstat_t *rs=prs;
guint32 i;
-#ifdef G_HAVE_UINT64
guint64 td;
-#else
- guint32 td;
-#endif
printf("\n");
printf("===================================================================\n");
printf("%s Major Version %u RTT Statistics:\n", rs->prog, rs->ver);
@@ -159,8 +155,7 @@ dcerpcstat_draw(void *prs)
printf("Procedure Calls Min RTT Max RTT Avg RTT\n");
for(i=0;i<rs->num_procedures;i++){
/* scale it to units of 10us.*/
- /* for long captures with a large tot time, this can overflow on 32bit */
- td=(int)rs->procedures[i].tot.secs;
+ td=rs->procedures[i].tot.secs;
td=td*100000+(int)rs->procedures[i].tot.nsecs/10000;
if(rs->procedures[i].num){
td/=rs->procedures[i].num;
@@ -168,7 +163,7 @@ dcerpcstat_draw(void *prs)
td=0;
}
- printf("%-25s %6d %3d.%05d %3d.%05d %3d.%05d\n",
+ printf("%-25s %6d %3d.%05d %3d.%05d %3" PRIu64 ".%05" PRIu64 "\n",
rs->procedures[i].proc,
rs->procedures[i].num,
(int)rs->procedures[i].min.secs,rs->procedures[i].min.nsecs/10000,
diff --git a/tap-rpcprogs.c b/tap-rpcprogs.c
index fcad0f54f9..b8f1110455 100644
--- a/tap-rpcprogs.c
+++ b/tap-rpcprogs.c
@@ -178,11 +178,7 @@ rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
static void
rpcprogs_draw(void *dummy _U_)
{
-#ifdef G_HAVE_UINT64
guint64 td;
-#else
- guint32 td;
-#endif
rpc_program_t *rp;
char str[64];
@@ -192,8 +188,7 @@ rpcprogs_draw(void *dummy _U_)
printf("Program Version Calls Min SRT Max SRT Avg SRT\n");
for(rp=prog_list;rp;rp=rp->next){
/* scale it to units of 10us.*/
- /* for long captures with a large tot time, this can overflow on 32bit */
- td=(int)rp->tot.secs;
+ td=rp->tot.secs;
td=td*100000+(int)rp->tot.nsecs/10000;
if(rp->num){
td/=rp->num;
@@ -202,7 +197,7 @@ rpcprogs_draw(void *dummy _U_)
}
g_snprintf(str, sizeof(str), "%s(%d)",rpc_prog_name(rp->program),rp->program);
- printf("%-15s %2d %6d %3d.%05d %3d.%05d %3d.%05d\n",
+ printf("%-15s %2d %6d %3d.%05d %3d.%05d %3" PRIu64 ".%05" PRIu64 "\n",
str,
rp->version,
rp->num,
diff --git a/tap-rpcstat.c b/tap-rpcstat.c
index 5ba75043a0..1a51d0e63b 100644
--- a/tap-rpcstat.c
+++ b/tap-rpcstat.c
@@ -202,11 +202,7 @@ rpcstat_draw(void *prs)
{
rpcstat_t *rs=prs;
guint32 i;
-#ifdef G_HAVE_UINT64
guint64 td;
-#else
- guint32 td;
-#endif
printf("\n");
printf("===================================================================\n");
printf("%s Version %d RTT Statistics:\n", rs->prog, rs->version);
@@ -214,8 +210,7 @@ rpcstat_draw(void *prs)
printf("Procedure Calls Min RTT Max RTT Avg RTT\n");
for(i=0;i<rs->num_procedures;i++){
/* scale it to units of 10us.*/
- /* for long captures with a large tot time, this can overflow on 32bit */
- td=(int)rs->procedures[i].tot.secs;
+ td=rs->procedures[i].tot.secs;
td=td*100000+(int)rs->procedures[i].tot.nsecs/10000;
if(rs->procedures[i].num){
td/=rs->procedures[i].num;
@@ -223,7 +218,7 @@ rpcstat_draw(void *prs)
td=0;
}
- printf("%-15s %6d %3d.%05d %3d.%05d %3d.%05d\n",
+ printf("%-15s %6d %3d.%05d %3d.%05d %3" PRIu64 ".%05" PRIu64 "\n",
rs->procedures[i].proc,
rs->procedures[i].num,
(int)rs->procedures[i].min.secs,rs->procedures[i].min.nsecs/10000,
diff --git a/tap-smbstat.c b/tap-smbstat.c
index 2ef3f4d996..94ead0f07b 100644
--- a/tap-smbstat.c
+++ b/tap-smbstat.c
@@ -103,11 +103,7 @@ smbstat_draw(void *pss)
{
smbstat_t *ss=(smbstat_t *)pss;
guint32 i;
-#ifdef G_HAVE_UINT64
guint64 td;
-#else
- guint32 td;
-#endif
printf("\n");
printf("===================================================================\n");
printf("SMB RTT Statistics:\n");
@@ -130,8 +126,7 @@ smbstat_draw(void *pss)
}
/* scale it to units of 10us.*/
- /* for long captures with a large tot time, this can overflow on 32bit */
- td=(int)ss->proc[i].tot.secs;
+ td=ss->proc[i].tot.secs;
td=td*100000+(int)ss->proc[i].tot.nsecs/10000;
if(ss->proc[i].num){
td/=ss->proc[i].num;
@@ -139,7 +134,7 @@ smbstat_draw(void *pss)
td=0;
}
- printf("%-25s %6d %3d.%05d %3d.%05d %3d.%05d\n",
+ printf("%-25s %6d %3d.%05d %3d.%05d %3" PRIu64 ".%05" PRIu64 "\n",
val_to_str(i, smb_cmd_vals, "Unknown (0x%02x)"),
ss->proc[i].num,
(int)ss->proc[i].min.secs,ss->proc[i].min.nsecs/10000,
@@ -157,8 +152,7 @@ smbstat_draw(void *pss)
}
/* scale it to units of 10us.*/
- /* for long captures with a large tot time, this can overflow on 32bit */
- td=(int)ss->trans2[i].tot.secs;
+ td=ss->trans2[i].tot.secs;
td=td*100000+(int)ss->trans2[i].tot.nsecs/10000;
if(ss->trans2[i].num){
td/=ss->trans2[i].num;
@@ -166,7 +160,7 @@ smbstat_draw(void *pss)
td=0;
}
- printf("%-25s %6d %3d.%05d %3d.%05d %3d.%05d\n",
+ printf("%-25s %6d %3d.%05d %3d.%05d %3" PRIu64 ".%05" PRIu64 "\n",
val_to_str(i, trans2_cmd_vals, "Unknown (0x%02x)"),
ss->trans2[i].num,
(int)ss->trans2[i].min.secs,ss->trans2[i].min.nsecs/10000,
@@ -184,8 +178,7 @@ smbstat_draw(void *pss)
}
/* scale it to units of 10us.*/
- /* for long captures with a large tot time, this can overflow on 32bit */
- td=(int)ss->nt_trans[i].tot.secs;
+ td=ss->nt_trans[i].tot.secs;
td=td*100000+(int)ss->nt_trans[i].tot.nsecs/10000;
if(ss->nt_trans[i].num){
td/=ss->nt_trans[i].num;
@@ -193,7 +186,7 @@ smbstat_draw(void *pss)
td=0;
}
- printf("%-25s %6d %3d.%05d %3d.%05d %3d.%05d\n",
+ printf("%-25s %6d %3d.%05d %3d.%05d %3" PRIu64 ".%05" PRIu64 "\n",
val_to_str(i, nt_cmd_vals, "Unknown (0x%02x)"),
ss->nt_trans[i].num,
(int)ss->nt_trans[i].min.secs,ss->nt_trans[i].min.nsecs/10000,