Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 15 Jul 2011 19:07:25 +0000 (19:07 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 15 Jul 2011 19:07:25 +0000 (19:07 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38049 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-ncp2222.inc
epan/dissectors/packet-netflow.c
epan/dissectors/packet-nfs.c
epan/dissectors/packet-opensafety.c

index 95bde58935c016691da9905b56e4ee983ca7f792..79f8fa4d65c85ade407656a2d7de5abd8c56c534 100644 (file)
@@ -2028,9 +2028,6 @@ padd_date(ptvcursor_t *ptvc, const ptvc_record *rec)
 {
     proto_item  *item;
     nw_date_t   nw_date;
-    gint        offset;
-
-    offset = ptvcursor_current_offset(ptvc);
 
     item = ptvcursor_add(ptvc, *rec->hf_ptr,
                          rec->length, rec->endianness);
@@ -2050,9 +2047,6 @@ padd_time(ptvcursor_t *ptvc, const ptvc_record *rec)
 {
     proto_item  *item;
     nw_time_t   nw_time;
-    gint        offset;
-
-    offset = ptvcursor_current_offset(ptvc);
 
     item = ptvcursor_add(ptvc, *rec->hf_ptr,
                          rec->length, rec->endianness);
@@ -2077,10 +2071,8 @@ padd_uni(ptvcursor_t *ptvc, const ptvc_record *rec)
 {
     proto_item      *item;
     /* nw_uni_t        nw_uni; */
-    guint            offset;
 
     /* nw_uni.buffer[0] = '\0'; */
-    offset = ptvcursor_current_offset(ptvc);
 
     item = ptvcursor_add(ptvc, *rec->hf_ptr,
                          rec->length, rec->endianness);
@@ -2513,12 +2505,10 @@ get_info_type(const gchar* check_string)
 {
     guint length;
     guint i;
-    char char_val;
 
     length =  (guint) strlen(check_string);
 
     for (i = 0 ; i < length-1 ; i++ ) {
-        char_val = check_string[i+1];
         if (check_string[i] == 0x25 && check_string[i+1] == 0x64) {   /* %d Digits*/
             return 0;
         }
@@ -8813,9 +8803,9 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
     const char          *error_string;
     guint32              nds_offset = 0;
     guint32              nds_error_code = 0;
-    guint32              nds_reply_buffer = 0;
+    /*guint32              nds_reply_buffer = 0;*/
     const char          *nds_error_string = NULL;
-    guint32              nds_frag=0;
+    /*guint32              nds_frag=0;*/
     proto_item          *expert_item;
     guint8               conn_stat;
 
@@ -8927,9 +8917,9 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
         ncp_rec->subfunc==0x02 && (tvb_reported_length_remaining(tvb, 8) >= 8))
     {
         nds_offset = 8;
-        nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
+        /*nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);*/
         nds_offset += 4;
-        nds_frag = tvb_get_letohl(tvb, nds_offset);
+        /*nds_frag = tvb_get_letohl(tvb, nds_offset);*/
         nds_offset += 4;
         /*
          * Is the possibly-reassembled reply large enough to have
index c651449af75e1d50cb3f59a4624f76a1f211b13d..23adb65dff1035d1898254f7fc5a9d1903227184 100644 (file)
@@ -2379,7 +2379,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
        int             i;
 
        address         local_addr, remote_addr;
-       guint16         local_port = 0, remote_port = 0, ipv4_id = 0, icmp_id = 0;
+       guint16         local_port = 0, remote_port = 0/*, ipv4_id = 0, icmp_id = 0*/;
        guint32         uid = 0, pid = 0;
        int             uname_len;
        gchar          *uname_str = NULL;
@@ -4470,15 +4470,15 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree,
                case VENDOR_CACE << 16 | 6: /* caceLocalIPv4id */
                        ti = proto_tree_add_item(pdutree, hf_pie_cace_local_ipv4_id,
                                            tvb, offset, length, ENC_BIG_ENDIAN);
-                       ipv4_id = tvb_get_ntohs(tvb, offset);
-                       got_flags |= GOT_IPv4_ID;
+                       /*ipv4_id = tvb_get_ntohs(tvb, offset);*/
+                       /*got_flags |= GOT_IPv4_ID;*/
                        break;
 
                case VENDOR_CACE << 16 | 7: /* caceLocalICMPid */
                        ti = proto_tree_add_item(pdutree, hf_pie_cace_local_icmp_id,
                                            tvb, offset, length, ENC_BIG_ENDIAN);
-                       icmp_id = tvb_get_ntohs(tvb, offset);
-                       got_flags |= GOT_ICMP_ID;
+                       /*icmp_id = tvb_get_ntohs(tvb, offset);*/
+                       /*got_flags |= GOT_ICMP_ID;*/
                        break;
 
                case VENDOR_CACE << 16 | 8: /* caceLocalProcessUserId */
index 4a605d07ff45254e6b8dd930c1ab3de5d15013fa..54fd7d01eadac58688bb98c770e94ce6df63b892 100644 (file)
@@ -3805,14 +3805,14 @@ dissect_nfs_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
 {
        guint fh3_len;
        guint fh3_len_full;
-       guint fh3_fill;
+       /*guint fh3_fill;*/
        proto_item* fitem = NULL;
        proto_tree* ftree = NULL;
        int fh_offset,fh_length;
 
        fh3_len = tvb_get_ntohl(tvb, offset+0);
        fh3_len_full = rpc_roundup(fh3_len);
-       fh3_fill = fh3_len_full - fh3_len;
+       /*fh3_fill = fh3_len_full - fh3_len;*/
 
        if (tree) {
                fitem = proto_tree_add_text(tree, tvb, offset, 4+fh3_len_full,
@@ -8928,7 +8928,7 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
 {
        guint32 ops, ops_counter, summary_counter;
        guint opcode;
-       guint name_offset=0;
+       /*guint name_offset=0;*/
        proto_item *fitem;
        proto_tree *ftree = NULL;
        proto_tree *newftree = NULL;
@@ -9154,7 +9154,7 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        break;
 
                case NFS4_OP_LOOKUP:
-                       name_offset=offset;
+                    /*name_offset=offset;*/
                        offset = dissect_nfs_utf8string(tvb, offset, newftree,
                                                                hf_nfs_component4, &name);
                        if (nfs_file_name_snooping){
@@ -9593,7 +9593,6 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_item *fitem;
        proto_tree *ftree = NULL;
        proto_tree *newftree = NULL;
-       guint32 string_length;
        guint32 status;
        const char *opname=NULL;
        guint32 last_fh_hash=0;
@@ -9751,7 +9750,6 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
                case NFS4_OP_READ:
                        offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_eof, offset);
-                       string_length = tvb_get_ntohl(tvb,offset+0);
                        dissect_rpc_uint32(tvb, newftree, hf_read_data_length, offset); /* don't change offset */
                        offset = dissect_nfsdata(tvb, offset, newftree, hf_nfs_data);
                        break;
index 5d2cd1690e929fd017fc7fdb7831d76ecf88c593..34eacec63b0ea47843fbdea9ef3edcf0c30f87dc 100644 (file)
@@ -1304,7 +1304,7 @@ dissect_opensafety_epl(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree *
     guint8 *bytes;
     gboolean handled, dissectorCalled;
     guint8 firstByte, found;
-    gint len, reported_len;
+    gint reported_len;
     dissector_handle_t epl_handle;
     guint8 packageCounter;
     handled = FALSE;
@@ -1322,7 +1322,6 @@ dissect_opensafety_epl(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree *
         return TRUE;
     }
 
-    len = tvb_length_remaining(message_tvb, 0);
     reported_len = tvb_reported_length_remaining(message_tvb, 0);
     length = tvb_length(message_tvb);
     bytes = (guint8 *) ep_tvb_memdup(message_tvb, 0, length);
@@ -1409,7 +1408,7 @@ dissect_opensafety_siii(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree
     guint8 *bytes;
     gboolean handled, dissectorCalled, udpDissectorCalled;
     guint8 firstByte, found;
-    gint len, reported_len;
+    gint reported_len;
     dissector_handle_t siii_handle;
     guint8 packageCounter = 0;
     gboolean internSIIIHandling;
@@ -1444,7 +1443,6 @@ dissect_opensafety_siii(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree
         return TRUE;
     }
 
-    len = tvb_length_remaining(message_tvb, 0);
     reported_len = tvb_reported_length_remaining(message_tvb, 0);
     length = tvb_length(message_tvb);
     bytes = (guint8 *) ep_tvb_memdup(message_tvb, 0, length);
@@ -1617,9 +1615,9 @@ dissect_opensafety_mbtcp(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree
             /* Only engage, if we are not called strictly for the overview */
             if ( tree )
             {
-               /* When Modbus/TCP get's dissected, openSAFETY would be sorted as a child protocol. Although,
-                * this behaviour is technically correct, it differs from other implemented IEM protocol handlers.
-                * Therefore, the openSAFETY frame get's put one up, if the parent is not NULL */
+                /* When Modbus/TCP get's dissected, openSAFETY would be sorted as a child protocol. Although,
+                 * this behaviour is technically correct, it differs from other implemented IEM protocol handlers.
+                 * Therefore, the openSAFETY frame get's put one up, if the parent is not NULL */
                 if ( dissect_opensafety_frame(next_tvb, pinfo, ( tree->parent != NULL ? tree->parent : tree ), FALSE, found ) == TRUE )
                     packageCounter++;
             }
@@ -1645,7 +1643,7 @@ dissect_opensafety_pn_io(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree
     guint8 *bytes;
     gboolean handled, dissectorCalled;
     guint8 found;
-    gint len, reported_len;
+    gint reported_len;
     dissector_handle_t pn_io_handle;
     guint8 packageCounter;
     handled = FALSE;
@@ -1653,9 +1651,8 @@ dissect_opensafety_pn_io(tvbuff_t *message_tvb , packet_info *pinfo , proto_tree
 
     pn_io_handle = find_dissector("pn_io");
     if ( pn_io_handle == NULL )
-       pn_io_handle = find_dissector("data");
+        pn_io_handle = find_dissector("data");
 
-    len = tvb_length_remaining(message_tvb, 0);
     reported_len = tvb_reported_length_remaining(message_tvb, 0);
     length = tvb_length(message_tvb);
     bytes = (guint8 *) ep_tvb_memdup(message_tvb, 0, length);
@@ -1727,7 +1724,7 @@ dissect_heur_opensafety_pn_io(tvbuff_t *message_tvb , packet_info *pinfo , proto
     if ( calledOnce == FALSE )
     {
         calledOnce = TRUE;
-       result = dissect_opensafety_pn_io(message_tvb, pinfo, tree );
+        result = dissect_opensafety_pn_io(message_tvb, pinfo, tree );
         calledOnce = FALSE;
         return result;
     }
@@ -1884,7 +1881,7 @@ proto_reg_handoff_opensafety(void)
 
     if ( !opensafety_inited )
     {
-       /* EPL & SercosIII dissector registration */
+        /* EPL & SercosIII dissector registration */
         heur_dissector_add("epl", dissect_heur_opensafety_epl, proto_opensafety);
         heur_dissector_add("sercosiii", dissect_heur_opensafety_siii, proto_opensafety);
 
@@ -1905,7 +1902,7 @@ proto_reg_handoff_opensafety(void)
              * the ethernet subdissector list. No PNIO specific data will be dissected
              * and a warning will be displayed, recognizing the missing dissector plugin.
              */
-                       g_warning ( "openSAFETY - Profinet IO heuristic dissector cannot be registered, openSAFETY/PNIO native dissection." );
+            g_warning ( "openSAFETY - Profinet IO heuristic dissector cannot be registered, openSAFETY/PNIO native dissection." );
             dissector_add_uint("ethertype", ETHERTYPE_PROFINET, find_dissector("opensafety_pnio"));
         }
     }