From Yaniv Kaul: some 'set but not used' compilation fixes.
authorBill Meier <wmeier@newsguy.com>
Wed, 27 Apr 2011 05:02:47 +0000 (05:02 -0000)
committerBill Meier <wmeier@newsguy.com>
Wed, 27 Apr 2011 05:02:47 +0000 (05:02 -0000)
svn path=/trunk/; revision=36889

epan/dissectors/packet-9p.c
epan/dissectors/packet-aarp.c
epan/dissectors/packet-acn.c

index 53e2b6fbf0f4899e81bf3cb9daf5a6649b256887..9221d8d90d72117c64a45e9d8e96cea8326488ad 100644 (file)
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -29,7 +29,6 @@
 # include "config.h"
 #endif
 
-#include <stdlib.h>
 #include <string.h>
 
 #include <glib.h>
@@ -74,13 +73,13 @@ enum {
        RWSTAT
 };
 /* File open modes */
-#define P9_OREAD          0x0 
-#define P9_OWRITE         0x1 
-#define P9_ORDWR          0x2 
+#define P9_OREAD          0x0
+#define P9_OWRITE         0x1
+#define P9_ORDWR          0x2
 #define P9_OEXEC          0x3
-#define P9_MODEMASK       0x3 
-#define P9_OTRUNC        0x10 
-#define P9_ORCLOSE       0x40 
+#define P9_MODEMASK       0x3
+#define P9_OTRUNC        0x10
+#define P9_ORCLOSE       0x40
 
 /* stat mode flags */
 #define DMDIR          0x80000000 /* Directory */
@@ -160,7 +159,7 @@ static gint ett_9P_qid = -1;
 static gint ett_9P_qidtype = -1;
 
 /*9P Msg types to name mapping */
-static const value_string ninep_msg_type[] = 
+static const value_string ninep_msg_type[] =
 {      {TVERSION,      "Tversion"},
        {RVERSION,      "Rversion"},
        {TAUTH,         "Tauth"},
@@ -191,7 +190,7 @@ static const value_string ninep_msg_type[] =
        {0,             NULL},
 };
 /* Open/Create modes */
-static const value_string ninep_mode_vals[] = 
+static const value_string ninep_mode_vals[] =
 {
        {P9_OREAD,      "Read Access"},
        {P9_OWRITE,     "Write Access"},
@@ -207,7 +206,7 @@ static void dissect_9P_qid(tvbuff_t * tvb,  proto_tree * tree,int offset);
 /* Dissect 9P messages*/
 static void dissect_9P(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
-       guint32 ninesz,tmp,i;
+       guint32 /*ninesz,*/tmp,i;
        guint16 tmp16;
        guint8 ninemsg;
        guint offset = 0;
@@ -221,11 +220,11 @@ static void dissect_9P(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "9P");
        col_clear(pinfo->cinfo, COL_INFO);
 
-       ninesz = tvb_get_letohl(tvb, offset);
+       /*ninesz = tvb_get_letohl(tvb, offset);*/
        ninemsg = tvb_get_guint8(tvb, offset + 4);
 
-       mname = val_to_str(ninemsg, ninep_msg_type,"Unknown");
-       
+       mname = val_to_str(ninemsg, ninep_msg_type, "Unknown");
+
        if(strcmp(mname,"Unknown") == 0) {
                col_add_fstr(pinfo->cinfo, COL_INFO, "9P Data Continuation(?) (Tag %u)",(guint)ninemsg);
 
@@ -255,7 +254,7 @@ static void dissect_9P(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 
                tmp16 = tvb_get_letohs(tvb,offset);
                ti = proto_tree_add_item(ninep_tree, hf_9P_version, tvb, offset+2, tmp16, TRUE);
-               tmp_tree = proto_item_add_subtree(ti,ett_9P_version);   
+               tmp_tree = proto_item_add_subtree(ti,ett_9P_version);
                proto_tree_add_item(tmp_tree, hf_9P_parmsz, tvb, offset, 2, TRUE);
                offset += 2;
                break;
@@ -321,7 +320,7 @@ static void dissect_9P(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 
                proto_tree_add_item(ninep_tree, hf_9P_newfid, tvb, offset, 4, TRUE);
                offset +=4;
-               
+
                tmp16 = tvb_get_letohs(tvb,offset);
                proto_tree_add_item(ninep_tree, hf_9P_nwalk, tvb, offset, 2, TRUE);
                offset +=2;
@@ -330,14 +329,14 @@ static void dissect_9P(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
                if(tmp16 > 250) {
                        tmp16 = 250;
                        tmp_tree = proto_tree_add_text(ninep_tree, tvb, 0, 0, "Only first 250 items shown");
-                       PROTO_ITEM_SET_GENERATED(tmp_tree);
+                       PROTO_ITEM_SET_GENERATED(tmp_tree);
                }
 
                for(i = 0 ; i < tmp16; i++) {
                        guint16 tmplen;
                        proto_item *wname;
                        proto_tree *wname_tree;
-                       
+
                        tmplen = tvb_get_letohs(tvb,offset);
                        wname = proto_tree_add_item(ninep_tree, hf_9P_wname, tvb, offset+2, tmplen, TRUE);
                        wname_tree = proto_item_add_subtree(wname,ett_9P_wname);
@@ -356,14 +355,14 @@ static void dissect_9P(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
                if(tmp16 > 250) {
                        tmp16 = 250;
                        tmp_tree = proto_tree_add_text(ninep_tree, tvb, 0, 0, "Only first 250 items shown");
-                       PROTO_ITEM_SET_GENERATED(tmp_tree);
+                       PROTO_ITEM_SET_GENERATED(tmp_tree);
                }
 
                for(i = 0; i < tmp16; i++) {
                        dissect_9P_qid(tvb,ninep_tree,offset);
                        offset += 13;
-               }       
-               break;  
+               }
+               break;
        case TOPEN:
                proto_tree_add_item(ninep_tree, hf_9P_fid, tvb, offset, 4, TRUE);
                offset +=4;
@@ -406,7 +405,7 @@ static void dissect_9P(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
                offset +=8;
 
                proto_tree_add_item(ninep_tree, hf_9P_count, tvb, offset, 4, TRUE);
-               break;  
+               break;
        case RREAD:
                tmp = tvb_get_letohl(tvb,offset);
                proto_tree_add_item(ninep_tree, hf_9P_count, tvb, offset, 4, TRUE);
@@ -595,7 +594,7 @@ static void dissect_9P_qid(tvbuff_t * tvb,  proto_tree * tree,int offset)
 
        if(!tree)
                return;
-       
+
        type = tvb_get_guint8(tvb,offset);
        vers = tvb_get_letohs(tvb,offset+1);
        path = tvb_get_letoh64(tvb,offset+1+4);
index 48f0191e8069f2715eb8b86c7ed43dd678b5528d..6649ca15a96eca4d7dfc2587fcf6dbc4caa5e423 100644 (file)
@@ -153,7 +153,7 @@ dissect_aarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
   proto_item  *ti;
   const gchar *op_str;
   int         sha_offset, spa_offset, tha_offset, tpa_offset;
-  gchar       *sha_str, *spa_str, *tha_str, *tpa_str;
+  gchar       *sha_str, *spa_str, /* *tha_str, */ *tpa_str;
 
   col_set_str(pinfo->cinfo, COL_PROTOCOL, "AARP");
   col_clear(pinfo->cinfo, COL_INFO);
@@ -173,7 +173,10 @@ dissect_aarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
   /* Extract the addresses.  */
   sha_str = tvb_aarphrdaddr_to_str(tvb, sha_offset, ar_hln, ar_hrd);
   spa_str = tvb_aarpproaddr_to_str(tvb, spa_offset, ar_pln, ar_pro);
+#if 0
+  /* TODO: tha_str is currently not shown nor parsed */
   tha_str = tvb_aarphrdaddr_to_str(tvb, tha_offset, ar_hln, ar_hrd);
+#endif
   tpa_str = tvb_aarpproaddr_to_str(tvb, tpa_offset, ar_pln, ar_pro);
 
   switch (ar_op) {
index e5ccdf9e0c50ccfe6e23f16d5dbfa018a3e7a00e..8107154ae11f32bcc0bf869fe8e7dc2a46565c53 100644 (file)
@@ -737,7 +737,6 @@ static guint32
 acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, acn_dmp_adt_type *adt)
 {
   guint8 D, A;
-  guint32 start_offset;
   guint32 data_size;
   guint32 data_value;
   guint32 data_address;
@@ -746,7 +745,6 @@ acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int of
   proto_item *ti;
   guint32 ok_to_process = FALSE;
 
-  start_offset = offset;
   buffer[0] = 0;
 
   /* We would like to rip through Property Address-Data pairs                 */
@@ -974,7 +972,6 @@ static guint32
 acn_add_dmp_reason_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, acn_dmp_adt_type *adt)
 {
   guint8 D, A;
-  guint32 start_offset;
   guint32 data_value;
   guint32 data_address;
   guint32 x;
@@ -982,7 +979,6 @@ acn_add_dmp_reason_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
   gchar buffer[BUFFER_SIZE];
   const gchar *name;
 
-  start_offset = offset;
   buffer[0] = 0;
 
   D = ACN_DMP_ADT_EXTRACT_D(adt->flags);
@@ -1084,7 +1080,6 @@ dissect_acn_dmp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off
   guint32 pdu_start;
   guint32 pdu_length;
   guint32 pdu_flvh_length; /* flags, length, vector, header */
-  acn_pdu_offsets pdu_offsets = {0,0,0,0,0};
   guint8 D;
   guint8 octet;
   guint32 length1;
@@ -1110,7 +1105,6 @@ dissect_acn_dmp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off
 
   /* save start of pdu block */
   pdu_start = offset;
-  pdu_offsets.start = pdu_start;
 
   /* get PDU flags and length flag first */
   octet = tvb_get_guint8(tvb, offset++);
@@ -1398,14 +1392,12 @@ dissect_acn_sdt_wrapped_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
   guint32 pdu_start;
   guint32 pdu_length;
   guint32 pdu_flvh_length; /* flags, length, vector, header */
-  acn_pdu_offsets pdu_offsets = {0,0,0,0,0};
   guint8 octet;
   guint32 length1;
   guint32 length2;
   guint32 length3;
   guint32 vector_offset;
   guint32 data_offset;
-  guint32 end_offset;
   guint32 data_length;
 
   proto_item *ti, *pi;
@@ -1418,7 +1410,6 @@ dissect_acn_sdt_wrapped_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
 
   /* save start of pdu block */
   pdu_start = offset;
-  pdu_offsets.start = pdu_start;
 
   /* get PDU flags and length flag first */
   octet = tvb_get_guint8(tvb, offset++);
@@ -1490,7 +1481,6 @@ dissect_acn_sdt_wrapped_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
     data_offset = last_pdu_offsets->data;
     data_length = last_pdu_offsets->data_length;
   }
-  end_offset = data_offset + data_length;
 
   switch (vector) {
     case ACN_SDT_VECTOR_ACK:
@@ -1754,7 +1744,6 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo,
   guint32 pdu_start;
   guint32 pdu_length;
   guint32 pdu_flvh_length; /* flags, length, vector, header */
-  acn_pdu_offsets pdu_offsets = {0,0,0,0,0};
   guint8 octet;
   guint32 length1;
   guint32 length2;
@@ -1793,7 +1782,6 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo,
 
   /* save start of pdu block */
   pdu_start = offset;
-  pdu_offsets.start = pdu_start;
 
   /* get PDU flags and length flag first */
   octet = tvb_get_guint8(tvb, offset++);
@@ -2027,7 +2015,6 @@ dissect_acn_dmx_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo, prot
   guint32 length3;
   guint32 vector_offset;
   guint32 data_offset;
-  guint32 end_offset;
   guint32 data_length;
 
   proto_item *ti, *pi;
@@ -2118,7 +2105,6 @@ dissect_acn_dmx_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo, prot
     data_offset = last_pdu_offsets->data;
     data_length = last_pdu_offsets->data_length;
   }
-  end_offset = data_offset + data_length;
 
   /* process based on vector */
   switch (vector) {