Wireshark-bugs: [Wireshark-bugs] [Bug 7826] New: Explicitly declare/cast 'unsigned <variable>' a

Date: Tue, 9 Oct 2012 11:54:24 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7826

           Summary: Explicitly declare/cast 'unsigned <variable>' as
                    'unsigned int <variable>'
           Product: Wireshark
           Version: 1.8.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Low
         Component: Common utilities (libwsutil)
        AssignedTo: bugzilla-admin@xxxxxxxxxxxxx
        ReportedBy: wp02855@xxxxxxxxx


Created attachment 9328
  --> https://bugs.wireshark.org/bugzilla/attachment.cgi?id=9328
contains all the patch files (diff -u format) listed in the description section

Build Information:
Build Information via wireshark -v:

odie:/usr/local/src/wireshark-1.8.2 # ./wireshark -v
wireshark 1.8.2 (SVN Rev Unknown from unknown)

Copyright 1998-2012 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (64-bit) with GTK+ 2.22.1, with Cairo 1.10.2, with Pango 1.28.3, with
GLib 2.28.0, with libpcap, with libz 1.2.5, without POSIX capabilities, without
SMI, without c-ares, without ADNS, without Lua, without Python, with GnuTLS
2.8.6, with Gcrypt 1.4.6, with MIT Kerberos, without GeoIP, without PortAudio,
with AirPcap.

Running on Linux 2.6.37.6-0.7-desktop, with locale POSIX, with libpcap version
1.1.1, with libz 1.2.5, GnuTLS 2.8.6, Gcrypt 1.4.6, without AirPcap.

Built using gcc 4.5.1 20101208 [gcc-4_5-branch revision 167585].

--
In reviewing variable declarations and casts used in Wireshark 1.8.2,
I found some instances where the declaration of 'unsigned <foo>' was
used, and in some places 'unsigned int <foo>' is used.  The patches
below are designed to explicitly define 'unsigned <foo>' as 
'unsigned int <foo>' so that consistency is maintained.

I know that in C the definition of 'unsigned <foo>' is the same
as 'unsigned int <foo>', but in the code, the bulk of the variable
declarations and casts are of the form 'unsigned int <foo>'.

In Wireshark 1.8.2/1.8.3 modifications are needed in files:

--- mpeg-audio.c.orig   2012-10-08 16:51:27.840613577 -0700
+++ mpeg-audio.c        2012-10-08 16:52:18.416956938 -0700
@@ -27,13 +27,13 @@
 static const int mpa_versions[4] = { 2, -1, 1, 0 };
 static const int mpa_layers[4] = { -1, 2, 1, 0 };

-static const unsigned mpa_samples_data[3][3] = {
+static const unsigned int mpa_samples_data[3][3] = {
        { 384, 1152, 1152 },
        { 384, 1152, 576 },
        { 384, 1152, 576 },
 };

-static const unsigned mpa_bitrates[3][3][16] = { /* kb/s */
+static const unsigned int mpa_bitrates[3][3][16] = { /* kb/s */
   {
        { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448
},
        { 0, 32, 48, 56,  64,  80,  96, 112, 128, 160, 192, 224, 256, 320, 384
},
@@ -51,13 +51,13 @@
   },
 };

-static const unsigned mpa_frequencies[3][4] = {
+static const unsigned int mpa_frequencies[3][4] = {
        { 44100, 48000, 32000 },
        { 22050, 24000, 16000 },
        { 11025, 12000, 8000 },
 };

-static const unsigned mpa_padding_data[3] = { 4, 1, 1 };
+static const unsigned int mpa_padding_data[3] = { 4, 1, 1 };

 int
 mpa_version(const struct mpa *mpa)
@@ -71,25 +71,25 @@
        return mpa_layers[mpa->layer];
 }

-unsigned
+unsigned int
 mpa_samples(const struct mpa *mpa)
 {
        return mpa_samples_data[mpa_versions[mpa->version]][mpa_layer(mpa)];
 }

-unsigned
+unsigned int
 mpa_bitrate(const struct mpa *mpa)
 {
        return (1000 *
(mpa_bitrates[mpa_versions[mpa->version]][mpa_layers[mpa->layer]][mpa->bitrate]));
 }

-unsigned
+unsigned int
 mpa_frequency(const struct mpa *mpa)
 {
        return(mpa_frequencies[mpa_versions[mpa->version]][mpa->frequency]);
 }

-unsigned
+unsigned int
 mpa_padding(const struct mpa *mpa)
 {
        return(mpa->padding ? mpa_padding_data[mpa_layers[mpa->layer]] : 0);

--- mpeg-audio.h.orig   2012-10-08 16:52:51.212425601 -0700
+++ mpeg-audio.h        2012-10-08 16:54:07.126447993 -0700
@@ -26,19 +26,19 @@
 #define MPA_H 1

 struct mpa {
-       unsigned emphasis   :2;
-       unsigned original   :1;
-       unsigned copyright  :1;
-       unsigned modeext    :2;
-       unsigned mode       :2;
-       unsigned private    :1;
-       unsigned padding    :1;
-       unsigned frequency  :2;
-       unsigned bitrate    :4;
-       unsigned protection :1;
-       unsigned layer      :2;
-       unsigned version    :2;
-       unsigned sync       :11;
+       unsigned int emphasis   :2;
+       unsigned int original   :1;
+       unsigned int copyright  :1;
+       unsigned int modeext    :2;
+       unsigned int mode       :2;
+       unsigned int private    :1;
+       unsigned int padding    :1;
+       unsigned int frequency  :2;
+       unsigned int bitrate    :4;
+       unsigned int protection :1;
+       unsigned int layer      :2;
+       unsigned int version    :2;
+       unsigned int sync       :11;
 };

 #define MPA_UNMARSHAL_SYNC(n)       ((n) >> 21 & 0x7ff)
@@ -73,10 +73,10 @@

 int mpa_version(const struct mpa *);
 int mpa_layer(const struct mpa *);
-unsigned mpa_samples(const struct mpa *);
-unsigned mpa_bitrate(const struct mpa *);
-unsigned mpa_frequency(const struct mpa *);
-unsigned mpa_padding(const struct mpa *);
+unsigned int mpa_samples(const struct mpa *);
+unsigned int mpa_bitrate(const struct mpa *);
+unsigned int mpa_frequency(const struct mpa *);
+unsigned int mpa_padding(const struct mpa *);

 #define MPA_DATA_BYTES(mpa) (mpa_bitrate(mpa) * mpa_samples(mpa) \
                / mpa_frequency(mpa) / 8)

--- netmon.c.orig       2012-10-08 16:46:39.807177257 -0700
+++ netmon.c    2012-10-08 16:47:16.839089994 -0700
@@ -949,7 +949,7 @@
         * Per-packet encapsulations are *not* supported in NetMon 1.x
         * format.
         */
-       if (encap < 0 || (unsigned) encap >= NUM_WTAP_ENCAPS ||
wtap_encap[encap] == -1)
+       if (encap < 0 || (unsigned int) encap >= NUM_WTAP_ENCAPS ||
wtap_encap[encap] == -1)
                return WTAP_ERR_UNSUPPORTED_ENCAP;

        return 0;
@@ -964,7 +964,7 @@
        if (encap == WTAP_ENCAP_PER_PACKET)
                return 0;

-       if (encap < 0 || (unsigned) encap >= NUM_WTAP_ENCAPS ||
wtap_encap[encap] == -1)
+       if (encap < 0 || (unsigned int) encap >= NUM_WTAP_ENCAPS ||
wtap_encap[encap] == -1)
                return WTAP_ERR_UNSUPPORTED_ENCAP;

        return 0;
@@ -1022,7 +1022,7 @@
                 * Is this network type supported?
                 */
                if (phdr->pkt_encap < 0 ||
-                   (unsigned) phdr->pkt_encap >= NUM_WTAP_ENCAPS ||
+                   (unsigned int) phdr->pkt_encap >= NUM_WTAP_ENCAPS ||
                    wtap_encap[phdr->pkt_encap] == -1) {
                        /*
                         * No.  Fail.

--- ngsniffer.c.orig    2012-10-08 16:47:43.983961857 -0700
+++ ngsniffer.c 2012-10-08 16:49:51.532438025 -0700
@@ -2056,7 +2056,7 @@
        if (encap == WTAP_ENCAP_PER_PACKET)
                return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;

-       if (encap < 0 || (unsigned)encap >= NUM_WTAP_ENCAPS ||
wtap_encap[encap] == -1)
+       if (encap < 0 || (unsigned int)encap >= NUM_WTAP_ENCAPS ||
wtap_encap[encap] == -1)
                return WTAP_ERR_UNSUPPORTED_ENCAP;

        return 0;

--- packet-babel.c.orig 2012-10-08 15:56:52.104453232 -0700
+++ packet-babel.c      2012-10-08 15:57:54.737069189 -0700
@@ -126,7 +126,7 @@
                const unsigned char *p, const unsigned char *dp,
                unsigned int len, unsigned char *p_r)
 {
-    unsigned pb;
+    unsigned int pb;
     unsigned char prefix[16];

     if(plen >= 0)

--- packet-ltp.c.orig   2012-10-08 16:01:36.402488316 -0700
+++ packet-ltp.c        2012-10-08 16:03:22.812739008 -0700
@@ -240,14 +240,14 @@
        client_id = evaluate_sdnv_64(tvb,frame_offset +
segment_offset,&client_id_size);
        segment_offset+= client_id_size;

-       if((unsigned)(frame_offset + segment_offset) >= tvb_length(tvb)){
+       if((unsigned int)(frame_offset + segment_offset) >= tvb_length(tvb)){
        /* This would mean the data segment is incomplete */
                return 0;
        }
        offset = evaluate_sdnv_64(tvb,frame_offset +
segment_offset,&offset_size);
        segment_offset+= offset_size;

-       if((unsigned)(frame_offset + segment_offset) >= tvb_length(tvb)){
+       if((unsigned int)(frame_offset + segment_offset) >= tvb_length(tvb)){
        /* This would mean the data segment is incomplete */
                return 0;
        }
@@ -255,7 +255,7 @@
        length = evaluate_sdnv_64(tvb,frame_offset +
segment_offset,&length_size);
        segment_offset+= length_size;

-       if((unsigned)(frame_offset + segment_offset) >= tvb_length(tvb)){
+       if((unsigned int)(frame_offset + segment_offset) >= tvb_length(tvb)){
        /* This would mean the data segment is incomplete */
                return 0;
        }
@@ -265,7 +265,7 @@
                chkp_sno = evaluate_sdnv_64(tvb,frame_offset +
segment_offset,&chkp_sno_size);
                segment_offset+= chkp_sno_size;

-               if((unsigned)(frame_offset + segment_offset) >=
tvb_length(tvb)){
+               if((unsigned int)(frame_offset + segment_offset) >=
tvb_length(tvb)){
                /* This would mean the data segment is incomplete */
                        return 0;
                }
@@ -273,7 +273,7 @@
                rpt_sno = evaluate_sdnv_64(tvb,frame_offset +
segment_offset,&rpt_sno_size);
                segment_offset+= rpt_sno_size;

-               if((unsigned)(frame_offset + segment_offset) >=
tvb_length(tvb)){
+               if((unsigned int)(frame_offset + segment_offset) >=
tvb_length(tvb)){
                /* This would mean the data segment is incomplete */
                        return 0;
                }
@@ -289,7 +289,7 @@
        /* Addition result has wrapped */
                return 0;
        }
-       if((unsigned)(frame_offset + segment_offset) > tvb_length(tvb)){
+       if((unsigned int)(frame_offset + segment_offset) > tvb_length(tvb)){
        /* This would mean the data segment is incomplete */
                return 0;
        }
@@ -486,7 +486,7 @@
        rpt_sno = evaluate_sdnv_64(tvb,frame_offset, &rpt_sno_size);
        segment_offset += rpt_sno_size;

-       if((unsigned)(frame_offset + segment_offset) > tvb_length(tvb)){
+       if((unsigned int)(frame_offset + segment_offset) > tvb_length(tvb)){
                return 0;
        }

@@ -538,17 +538,17 @@
                extn_type[i] = tvb_get_guint8(tvb,frame_offset);
                extn_offset++;

-               if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+               if((unsigned int)(frame_offset + extn_offset) >=
tvb_length(tvb)){
                        return 0;
                }
                length[i] = evaluate_sdnv_64(tvb,frame_offset,&length_size[i]);
                extn_offset += length_size[i];
-               if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+               if((unsigned int)(frame_offset + extn_offset) >=
tvb_length(tvb)){
                        return 0;
                }
                value[i] = evaluate_sdnv_64(tvb,frame_offset,&value_size[i]);
                extn_offset += value_size[i];
-               if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+               if((unsigned int)(frame_offset + extn_offset) >=
tvb_length(tvb)){
                        return 0;
                }
        }
@@ -588,21 +588,21 @@
                extn_type[i] = tvb_get_guint8(tvb,frame_offset);
                extn_offset++;

-               if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+               if((unsigned int)(frame_offset + extn_offset) >=
tvb_length(tvb)){
                        return 0;
                }

                length[i] = evaluate_sdnv_64(tvb,frame_offset,&length_size[i]);
                extn_offset += length_size[i];

-               if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+               if((unsigned int)(frame_offset + extn_offset) >=
tvb_length(tvb)){
                        return 0;
                }

                value[i] = evaluate_sdnv_64(tvb,frame_offset,&value_size[i]);
                extn_offset += value_size[i];

-               if((unsigned)(frame_offset + extn_offset) >= tvb_length(tvb)){
+               if((unsigned int)(frame_offset + extn_offset) >=
tvb_length(tvb)){
                        return 0;
                }
        }
@@ -665,14 +665,14 @@

        engine_id = evaluate_sdnv_64(tvb,frame_offset +
header_offset,&engine_id_size);
        header_offset += engine_id_size;
-       if((unsigned)header_offset >= tvb_length(tvb)){
+       if((unsigned int)header_offset >= tvb_length(tvb)){
                col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
                return 0;
        }

        session_num = evaluate_sdnv_64(tvb,frame_offset +
header_offset,&session_num_size);
        header_offset += session_num_size;
-       if((unsigned)header_offset >= tvb_length(tvb)){
+       if((unsigned int)header_offset >= tvb_length(tvb)){
                col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
                return 0;
        }
@@ -709,7 +709,7 @@

        col_add_str(pinfo->cinfo, COL_INFO,
val_to_str_const(ltp_type,ltp_type_col_info,"Protocol Error"));

-       if((unsigned)frame_offset >= tvb_length(tvb)){
+       if((unsigned int)frame_offset >= tvb_length(tvb)){
                col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
                return 0;
        }
@@ -724,7 +724,7 @@
                frame_offset += hdr_extn_offset;
        }

-       if((unsigned)frame_offset >= tvb_length(tvb)){
+       if((unsigned int)frame_offset >= tvb_length(tvb)){
                col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
                return 0;
        }
@@ -761,7 +761,7 @@
        frame_offset += segment_offset;
        /* Check to see if there are any trailer extensions */
        if(trl_extn_cnt > 0){
-               if((unsigned)frame_offset >= tvb_length(tvb)){
+               if((unsigned int)frame_offset >= tvb_length(tvb)){
                    col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
                    return 0;
                }

--- packet-dmx-sip.c.orig       2012-10-08 15:58:44.973374983 -0700
+++ packet-dmx-sip.c    2012-10-08 15:59:21.316215731 -0700
@@ -78,10 +78,10 @@
 static int ett_dmx_sip = -1;

 static guint8
-dmx_sip_checksum(tvbuff_t *tvb, unsigned length)
+dmx_sip_checksum(tvbuff_t *tvb, unsigned int length)
 {
        guint8 sum = DMX_SC_SIP;
-       unsigned i;
+       unsigned int i;
        for (i = 0; i < length; i++)
                sum += tvb_get_guint8(tvb, i);
        return sum;
@@ -94,9 +94,9 @@
        col_clear(pinfo->cinfo, COL_INFO);

        if (tree != NULL) {
-               unsigned offset = 0;
-               unsigned byte_count;
-               unsigned checksum, checksum_shouldbe;
+               unsigned int offset = 0;
+               unsigned int byte_count;
+               unsigned int checksum, checksum_shouldbe;
                proto_item *item;
                proto_tree *checksum_tree;

--- packet-dmx-test.c.orig      2012-10-08 16:00:19.071317318 -0700
+++ packet-dmx-test.c   2012-10-08 16:00:38.608386229 -0700
@@ -69,8 +69,8 @@
        col_clear(pinfo->cinfo, COL_INFO);

        if (tree != NULL) {
-               unsigned offset = 0;
-               unsigned size, i, test_data_is_ok;
+               unsigned int offset = 0;
+               unsigned int size, i, test_data_is_ok;
                proto_tree* test_data_tree;
                proto_item *item;

--- packet-ircomm.c.orig        2012-10-08 16:28:29.629971932 -0700
+++ packet-ircomm.c     2012-10-08 16:30:16.737290762 -0700
@@ -137,12 +137,12 @@
 static int hf_control = -1;
 static int hf_control_len = -1;

-static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, unsigned offset,
packet_info* pinfo,
-                                          proto_tree* tree, unsigned
list_index, guint8 attr_type);
-static gboolean dissect_ircomm_ttp_lsap(tvbuff_t* tvb, unsigned offset,
packet_info* pinfo,
-                                        proto_tree* tree, unsigned list_index,
guint8 attr_type);
-static gboolean dissect_ircomm_lmp_lsap(tvbuff_t* tvb, unsigned offset,
packet_info* pinfo,
-                                        proto_tree* tree, unsigned list_index,
guint8 attr_type);
+static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, unsigned int offset,
packet_info* pinfo,
+                                          proto_tree* tree, unsigned int
list_index, guint8 attr_type);
+static gboolean dissect_ircomm_ttp_lsap(tvbuff_t* tvb, unsigned int offset,
packet_info* pinfo,
+                                        proto_tree* tree, unsigned int
list_index, guint8 attr_type);
+static gboolean dissect_ircomm_lmp_lsap(tvbuff_t* tvb, unsigned int offset,
packet_info* pinfo,
+                                        proto_tree* tree, unsigned int
list_index, guint8 attr_type);

 ias_attr_dissector_t ircomm_attr_dissector[] = {
 /* IrDA:IrCOMM attribute dissectors */
@@ -164,10 +164,10 @@
  */
 static void dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo,
proto_tree* root)
 {
-    unsigned offset = 0;
-    unsigned clen;
+    unsigned int offset = 0;
+    unsigned int clen;
     char        buf[128];
-    unsigned    len;
+    unsigned int len;


     if (tvb_length(tvb) == 0)
@@ -217,7 +217,7 @@
  */
 static void dissect_raw_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree*
root)
 {
-    unsigned len = tvb_length(tvb);
+    unsigned int len = tvb_length(tvb);
        char    buf[128];

     if (len == 0)
@@ -243,11 +243,11 @@
 /*
  * Dissect IrCOMM IAS "Parameters" attribute
  */
-static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, unsigned offset,
packet_info* pinfo _U_,
-                                          proto_tree* tree, unsigned
list_index, guint8 attr_type)
+static gboolean dissect_ircomm_parameters(tvbuff_t* tvb, unsigned int offset,
packet_info* pinfo _U_,
+                                          proto_tree* tree, unsigned int
list_index, guint8 attr_type)
 {
-    unsigned    len;
-    unsigned    n = 0;
+    unsigned int len;
+    unsigned int n = 0;
     proto_item* ti;
     proto_tree* p_tree;
     char        buf[256];
@@ -333,8 +333,8 @@
 /*
  * Dissect IrCOMM IAS "IrDA:TinyTP:LsapSel" attribute
  */
-static gboolean dissect_ircomm_ttp_lsap(tvbuff_t* tvb, unsigned offset,
packet_info* pinfo,
-                                        proto_tree* tree, unsigned list_index
_U_, guint8 attr_type)
+static gboolean dissect_ircomm_ttp_lsap(tvbuff_t* tvb, unsigned int offset,
packet_info* pinfo,
+                                        proto_tree* tree, unsigned int
list_index _U_, guint8 attr_type)
 {
     guint8 dlsap;

@@ -351,8 +351,8 @@
 /*
  * Dissect IrCOMM/IrLPT IAS "IrDA:IrLMP:LsapSel" attribute
  */
-static gboolean dissect_ircomm_lmp_lsap(tvbuff_t* tvb, unsigned offset,
packet_info* pinfo,
-                                        proto_tree* tree, unsigned list_index
_U_, guint8 attr_type)
+static gboolean dissect_ircomm_lmp_lsap(tvbuff_t* tvb, unsigned int offset,
packet_info* pinfo,
+                                        proto_tree* tree, unsigned int
list_index _U_, guint8 attr_type)
 {
     guint8 dlsap;

@@ -371,7 +371,7 @@
  */
 void proto_register_ircomm(void)
 {
-    unsigned i;
+    unsigned int i;

     /* Setup list of header fields */
     static hf_register_info hf_ircomm[] = {

--- packet-irda.c.orig  2012-10-08 16:31:06.445546241 -0700
+++ packet-irda.c       2012-10-08 16:33:09.918592967 -0700
@@ -429,7 +429,7 @@
 /*
  * Dissect parameter tuple
  */
-unsigned dissect_param_tuple(tvbuff_t* tvb, proto_tree* tree, unsigned offset)
+unsigned int dissect_param_tuple(tvbuff_t* tvb, proto_tree* tree, unsigned int
offset)
 {
     guint8  len = tvb_get_guint8(tvb, offset + 1);

@@ -455,9 +455,9 @@
 /*
  * Dissect TTP
  */
-static unsigned dissect_ttp(tvbuff_t* tvb, packet_info* pinfo, proto_tree*
root, gboolean data)
+static unsigned int dissect_ttp(tvbuff_t* tvb, packet_info* pinfo, proto_tree*
root, gboolean data)
 {
-    unsigned    offset = 0;
+    unsigned int offset = 0;
     guint8      head;
        char            buf[128];

@@ -504,7 +504,7 @@
  */
 static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree*
root)
 {
-    unsigned            offset = 0;
+    unsigned int        offset = 0;
     guint8              op;
     guint8              clen = 0;
     guint8              alen = 0;
@@ -656,10 +656,10 @@
  */
 static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree*
root)
 {
-    unsigned            offset = 0;
-    unsigned            len    = tvb_length(tvb);
-    unsigned            n      = 0;
-    unsigned            list_len;
+    unsigned int        offset = 0;
+    unsigned int        len    = tvb_length(tvb);
+    unsigned int        n      = 0;
+    unsigned int        list_len;
     guint8              op;
     guint8              retcode;
     guint8              type;
@@ -909,7 +909,7 @@
 /*
  * Check if IAP result is octet sequence
  */
-gboolean check_iap_octet_result(tvbuff_t* tvb, proto_tree* tree, unsigned
offset,
+gboolean check_iap_octet_result(tvbuff_t* tvb, proto_tree* tree, unsigned int
offset,
                                 const char* attr_name, guint8 attr_type)
 {
     if (attr_type != IAS_OCT_SEQ)
@@ -931,7 +931,7 @@
 /*
  * Check if IAP result is correct LsapSel
  */
-guint8 check_iap_lsap_result(tvbuff_t* tvb, proto_tree* tree, unsigned offset,
+guint8 check_iap_lsap_result(tvbuff_t* tvb, proto_tree* tree, unsigned int
offset,
                              const char* attr_name, guint8 attr_type)
 {
     guint32 lsap;
@@ -959,7 +959,7 @@
  */
 static void dissect_appl_proto(tvbuff_t* tvb, packet_info* pinfo, proto_tree*
root, pdu_type_t pdu_type)
 {
-    unsigned            offset = 0;
+    unsigned int        offset = 0;
     guint8              src;
     address             srcaddr;
     address             destaddr;
@@ -1029,7 +1029,7 @@
  */
 static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root)
 {
-    unsigned    offset = 0;
+    unsigned int offset = 0;
     guint8      dlsap;
     guint8      slsap;
     guint8      cbit;
@@ -1252,9 +1252,9 @@
 /*
  * Dissect Negotiation Parameters
  */
-static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned
offset)
+static unsigned dissect_negotiation(tvbuff_t* tvb, proto_tree* tree, unsigned
int offset)
 {
-    unsigned    n   = 0;
+    unsigned int  n   = 0;
     proto_item* ti;
     proto_tree* p_tree;
     char        buf[256];
@@ -1529,7 +1529,7 @@

     if (tvb_reported_length_remaining(tvb, offset) > 0)
     {
-        unsigned    hints_len;
+        unsigned int hints_len;
         guint8      hint1 = 0;
         guint8      hint2 = 0;
         char buf[23];
@@ -1881,7 +1881,7 @@
  */
 void proto_register_irda(void)
 {
-    unsigned i;
+    unsigned int i;

     /* Setup list of header fields */
     static hf_register_info hf_lap[] = {

--- packet-pdcp-lte.c.orig      2012-10-08 16:06:24.595946908 -0700
+++ packet-pdcp-lte.c   2012-10-08 16:07:14.958269515 -0700
@@ -370,10 +370,10 @@

 typedef struct {
     guint32            frameNumber;
-    unsigned           SN :       12;
-    unsigned           plane :    2;
-    unsigned           channelId: 5;
-    unsigned           direction: 1;
+    unsigned int       SN :       12;
+    unsigned int       plane :    2;
+    unsigned int       channelId: 5;
+    unsigned int       direction: 1;
 } pdcp_result_hash_key;

 static gint pdcp_result_hash_equal(gconstpointer v, gconstpointer v2)

All of the above code compiles cleanly under wireshark-1.8.2 via 'make'

Here is a listing of the files in the attachment:

bill@melmac:~/unsigned> tar tvf unsigned-morefiles.tar.gz 
-rw-r--r-- bill/users     1720 2012-10-08 16:52 mpeg-audio.c.patch
-rw-r--r-- bill/users     1516 2012-10-08 16:54 mpeg-audio.h.patch
-rw-r--r-- bill/users     1006 2012-10-08 16:47 netmon.c.patch
-rw-r--r-- bill/users      440 2012-10-08 16:50 ngsniffer.c.patch
-rw-r--r-- bill/users      349 2012-10-08 15:58 packet-babel.c.patch
-rw-r--r-- bill/users      753 2012-10-08 16:00 packet-dmx-sip.c.patch
-rw-r--r-- bill/users      386 2012-10-08 16:01 packet-dmx-test.c.patch
-rw-r--r-- bill/users     3892 2012-10-08 16:30 packet-ircomm.c.patch
-rw-r--r-- bill/users     3585 2012-10-08 16:33 packet-irda.c.patch
-rw-r--r-- bill/users     5420 2012-10-08 16:03 packet-ltp.c.patch
-rw-r--r-- bill/users      604 2012-10-08 16:07 packet-pdcp-lte.c.patch

Bill Parker

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.