Wireshark now requires support for 64-bit types so there's no need to #ifdef
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 16 Apr 2007 04:34:07 +0000 (04:34 +0000)
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 16 Apr 2007 04:34:07 +0000 (04:34 +0000)
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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21442 f5534014-38df-0310-8fa8-9805f1628bb7

epan/tap.h
tap-afpstat.c
tap-dcerpcstat.c
tap-rpcprogs.c
tap-rpcstat.c
tap-smbstat.c

index 9e50c65eefdcb7d629c64cccb64cad24b95cc0c1..30dfffb9f94035d063fc6232c93b9a7bdc1b2c6a 100644 (file)
 
 #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.
  */
index 003243b844606f5d9d5ef65d2436c250baccc3ab..704b1716ab7eaeb63f3c684c5f410a8cfb5082b5 100644 (file)
@@ -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,
index 99767166c8ddbf338e0c87194cd498a6e3006dc2..3fa638ea9ed1aa3fea7ca6d0399522e6defc62b7 100644 (file)
@@ -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,
index fcad0f54f9ccc807bda9319cbe298ee13cf2636d..b8f111045529058291fe79b557a4f16a2291848a 100644 (file)
@@ -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,
index 5ba75043a047db2a398e2d08a6a1cb9f638cf6d9..1a51d0e63bee8694501cb3ee26351edb66611ab1 100644 (file)
@@ -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,
index 2ef3f4d9962d93f2fdd01f74e749948204b28e12..94ead0f07b601e0e210d821e3fbf1b161085415a 100644 (file)
@@ -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,