Remove unneeded variable initializers.
authorEvan Huus <eapache@gmail.com>
Sun, 2 Dec 2012 15:21:53 +0000 (15:21 -0000)
committerEvan Huus <eapache@gmail.com>
Sun, 2 Dec 2012 15:21:53 +0000 (15:21 -0000)
svn path=/trunk/; revision=46328

epan/dissectors/packet-bacapp.c
epan/dissectors/packet-beep.c
epan/dissectors/packet-bssap.c
epan/dissectors/packet-btavdtp.c
epan/dissectors/packet-btavrcp.c
epan/dissectors/packet-bthci_cmd.c
epan/dissectors/packet-bthci_evt.c
epan/dissectors/packet-btobex.c
epan/dissectors/packet-btrfcomm.c

index b70a0424bdc53a132c00d4a616faf7d6ded41b4c..6a9c7e2fed4faf870bf6e3fad3c7bc17e6576ae7 100644 (file)
@@ -5491,7 +5491,7 @@ fMacAddress (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset,
     guint start = offset;
     guint8 tag_no, tag_info;
     proto_tree* subtree = tree;
-    proto_item* ti = 0;
+    proto_item* ti;
 
     offset += fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
 
@@ -5992,7 +5992,7 @@ fBitStringTagVS (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offs
     guint32     lvt, i, numberOfBytes;
     guint8      bf_arr[256];
     proto_tree* subtree = tree;
-    proto_item* ti = 0;
+    proto_item* ti;
 
     offs = fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
     numberOfBytes = lvt-1; /* Ignore byte for unused bit count */
@@ -6990,7 +6990,7 @@ fUnconfirmedTextMessageRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
 static guint
 fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
 {
-    guint       lastoffset = 0, len;
+    guint       lastoffset, len;
     guint8      tag_no, tag_info;
     guint32     lvt;
     proto_tree *subtree = tree;
@@ -7160,7 +7160,7 @@ fBACnetPropertyStates(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, g
 {
     guint8       tag_no, tag_info;
     guint32      lvt;
-    const gchar* label = NULL;
+    const gchar* label;
 
     fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
     label = ep_strdup_printf( "%s: ", val_to_str_const( tag_no, VALS(BACnetPropertyStates), "Unknown State" ));
@@ -10419,9 +10419,8 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             /* not resetting the offset so the remaining can be done */
 
     if (fragment) { /* fragmented */
-        fragment_data *frag_msg = NULL;
+        fragment_data *frag_msg;
 
-        new_tvb = NULL;
         pinfo->fragmented = TRUE;
 
         frag_msg = fragment_add_seq_check(tvb, data_offset, pinfo,
@@ -10498,7 +10497,7 @@ uni_to_string(char * data, gsize str_length, char *dest_buf)
 {
     gint    i;
     guint16 c_char;
-    gsize   length_remaining = 0;
+    gsize   length_remaining;
 
     length_remaining = str_length;
     dest_buf[0] = '\0';
index f07dac3a1bfffe7f9dc4f40f70baa0735ff70ba2..9b8d73c4de99157bc4084f979091a4ed354108b5 100644 (file)
@@ -825,7 +825,7 @@ static void
 dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
   int offset;
-  struct beep_proto_data  *beep_frame_data = NULL;
+  struct beep_proto_data  *beep_frame_data;
   proto_tree              *beep_tree = NULL, *ti = NULL;
   conversation_t          *conversation = NULL;
   struct beep_request_key request_key, *new_request_key;
index cfdf6461b13f566d7acdea7334449c337ea8c375..4bd49d84e76fcb5c89504d6e11fd48f563c3c0cf 100644 (file)
@@ -525,7 +525,7 @@ static int
 dissect_bssap_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bssap_tree,
              proto_tree *tree)
 {
-    gint offset = 0;
+    gint offset;
 
     /*
      * Extract the PDU type
index 67eaa6332788094b179baa37de3d71af1329b5e2..c757ed0eed0a19555e62af562726f26e385d7bb0 100644 (file)
@@ -688,8 +688,8 @@ dissect_capabilities(tvbuff_t *tvb, packet_info *pinfo,
 {
     proto_item  *pitem                                        = NULL;
     proto_item  *ptree                                        = NULL;
-    proto_tree  *capabilities_tree                            = NULL;
-    proto_item  *capabilities_item                            = NULL;
+    proto_tree  *capabilities_tree;
+    proto_item  *capabilities_item;
     proto_tree  *service_tree                                 = NULL;
     proto_item  *service_item                                 = NULL;
     gint        service_category                              = 0;
@@ -875,7 +875,7 @@ static gint
 dissect_seid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
              gint seid_side, gint i_item, guint32 *sep_seid)
 {
-    guint32     seid           = 0;
+    guint32     seid;
     proto_tree  *seid_tree     = NULL;
     proto_item  *seid_item     = NULL;
 
index ccd368f93161f3387a460e65f50ee2a62b4bdb19..2cea756b95796007c180d31e786ac70a3538b89d 100644 (file)
@@ -580,8 +580,8 @@ dissect_attribute_id_list(tvbuff_t *tvb, proto_tree *tree, gint offset,
                           guint count)
 {
     guint       i_attribute;
-    proto_item *pitem = NULL;
-    proto_tree *ptree = NULL;
+    proto_item *pitem;
+    proto_tree *ptree;
 
     pitem = proto_tree_add_text(tree, tvb, offset, count * 4, "Attribute List");
     ptree = proto_item_add_subtree(pitem, ett_btavrcp_attribute_list);
@@ -649,12 +649,12 @@ dissect_item_mediaplayer(tvbuff_t *tvb, proto_tree *tree, gint offset)
     guint       feature_octet;
     guint       i_feature;
     guint8     *displayable_name;
-    proto_item *pitem                 = NULL;
-    proto_tree *ptree                 = NULL;
-    proto_item *features_item         = NULL;
-    proto_tree *features_tree         = NULL;
-    proto_item *features_not_set_item = NULL;
-    proto_tree *features_not_set_tree = NULL;
+    proto_item *pitem;
+    proto_tree *ptree;
+    proto_item *features_item;
+    proto_tree *features_tree;
+    proto_item *features_not_set_item;
+    proto_tree *features_not_set_tree;
 
     item_length = tvb_get_ntohs(tvb, offset + 1);
     displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 1 + 1 + 4 + 16 + 1 + 2);
@@ -814,8 +814,8 @@ dissect_item_media_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     guint       displayable_name_length;
     guint       item_length;
     guint8     *displayable_name;
-    proto_item *pitem = NULL;
-    proto_tree *ptree = NULL;
+    proto_item *pitem;
+    proto_tree *ptree;
     gint        offset_in;
 
     item_length = tvb_get_ntohs(tvb, offset + 1);
@@ -868,8 +868,8 @@ dissect_item_folder(tvbuff_t *tvb, proto_tree *tree, gint offset)
     guint       displayable_name_length;
     guint       item_length;
     guint8     *displayable_name;
-    proto_item *pitem = NULL;
-    proto_tree *ptree = NULL;
+    proto_item *pitem;
+    proto_tree *ptree;
 
     item_length = tvb_get_ntohs(tvb, offset + 1);
     displayable_name_length = tvb_get_ntohs(tvb, offset + 1 + 2 + 8 + 1 + 1 + 2);
@@ -1664,7 +1664,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
             if (is_command)  {
                 guint       volume;
                 guint       volume_percent;
-                proto_item  *pitem = NULL;
+                proto_item  *pitem;
 
                 proto_tree_add_item(tree, hf_btavrcp_absolute_volume_rfa, tvb, offset, 1, ENC_BIG_ENDIAN);
                 pitem = proto_tree_add_item(tree, hf_btavrcp_absolute_volume, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1677,7 +1677,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
             } else {
                 guint  volume;
                 guint  volume_percent;
-                proto_item    *pitem = NULL;
+                proto_item    *pitem;
 
                 proto_tree_add_item(tree, hf_btavrcp_absolute_volume_rfa, tvb, offset, 1, ENC_BIG_ENDIAN);
                 pitem = proto_tree_add_item(tree, hf_btavrcp_absolute_volume, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1814,8 +1814,8 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                 guint         i_folder;
                 guint         folder_depth;
                 guint         folder_name_length;
-                proto_item    *pitem = NULL;
-                proto_tree    *ptree = NULL;
+                proto_item    *pitem;
+                proto_tree    *ptree;
                 guint8        *folder_name;
 
                 proto_tree_add_item(tree, hf_btavrcp_uid_counter, tvb, offset, 2, ENC_BIG_ENDIAN);
index 129a21fdc9d12d7bd216b7231f23f07b02cf2d62..1862f2d66bd8dc9dfedfb8c2929b68408fd6dc4b 100644 (file)
@@ -1190,8 +1190,8 @@ dissect_bthci_eir_ad_data(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, pro
         length = tvb_get_guint8(tvb, offset+i);
         if (length != 0) {
 
-            proto_item *ti_data_struct=NULL;
-            proto_tree *ti_data_struct_subtree=NULL;
+            proto_item *ti_data_struct;
+            proto_tree *ti_data_struct_subtree;
 
             ti_data_struct = proto_tree_add_text(ti_data_subtree, tvb, offset+i, length+1, "%s", "");
             ti_data_struct_subtree = proto_item_add_subtree(ti_data_struct, ett_eir_struct_subtree);
@@ -1311,8 +1311,8 @@ dissect_bthci_eir_ad_data(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, pro
 static int
 dissect_bthci_cmd_flow_spec(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, gboolean tx)
 {
-    proto_item *ti_flow_spec=NULL;
-    proto_tree *ti_flow_spec_subtree=NULL;
+    proto_item *ti_flow_spec;
+    proto_tree *ti_flow_spec_subtree;
 
     ti_flow_spec = proto_tree_add_none_format(tree, hf_bthci_cmd_flow_spec, tvb, offset, 16, tx?"Tx Flow Spec ":"Rx Flow Spec");
     ti_flow_spec_subtree = proto_item_add_subtree(ti_flow_spec, ett_flow_spec_subtree);
index fd66f52de4e91baed6914209ea86914e2d4cedac..6a492c931f1bdf32dbbed60b746f0c5e4c4b1120 100644 (file)
@@ -1386,8 +1386,8 @@ static int
 dissect_bthci_evt_conn_packet_type_changed(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
 {
     guint16 flags;
-    proto_tree *handle_tree=NULL;
-    proto_item *ti_ptype_subtree=NULL;
+    proto_tree *handle_tree;
+    proto_item *ti_ptype_subtree;
 
     proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
     offset++;
@@ -1557,8 +1557,8 @@ dissect_bthci_evt_eir_ad_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
         length = tvb_get_guint8(tvb, offset+i);
         if( length != 0 ){
 
-            proto_item *ti_eir_struct=NULL;
-            proto_tree *ti_eir_struct_subtree=NULL;
+            proto_item *ti_eir_struct;
+            proto_tree *ti_eir_struct_subtree;
 
             ti_eir_struct = proto_tree_add_text(ti_eir_subtree, tvb, offset+i, length+1, "%s", "");
             ti_eir_struct_subtree = proto_item_add_subtree(ti_eir_struct, ett_eir_struct_subtree);
@@ -2059,8 +2059,8 @@ dissect_bthci_evt_amp_status_change(tvbuff_t *tvb, int offset, packet_info *pinf
 static int
 dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
 {
-    proto_item *ti_opcode=NULL;
-    proto_tree *opcode_tree=NULL;
+    proto_item *ti_opcode;
+    proto_tree *opcode_tree;
     proto_item *item;
     gint16 timeout;
     guint8 num8, i;
@@ -2970,8 +2970,8 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, packet_info *pinfo
 
         case 0x201c: /* LE Read Supported States */
         {
-            proto_item *ti_le_states=NULL;
-            proto_item *ti_le_states_subtree=NULL;
+            proto_item *ti_le_states;
+            proto_item *ti_le_states_subtree;
 
             proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN);
             offset++;
index 298f28d0b2dd78c627be748259e9b9226de0c2e6..e698776666f739ae330797ab1b784c89c1de8f01 100644 (file)
@@ -427,7 +427,6 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     save_fragmented = pinfo->fragmented;
 
-    frag_msg = NULL;
     complete = FALSE;
 
     if (fragment_get(pinfo, pinfo->p2p_dir, fragment_table)) {
index c9fa6f25f298691f953cf71b61dbe0d92326a2c1..84629e714121dd4a00efeb25e6353d69772a021e 100644 (file)
@@ -275,8 +275,8 @@ dissect_ctrl_pn(packet_info *pinfo, proto_tree *t, tvbuff_t *tvb, int offset, in
 {
     proto_tree   *st;
     proto_item   *ti;
-    proto_tree   *dlci_tree = NULL;
-    proto_item   *dlci_item = NULL;
+    proto_tree   *dlci_tree;
+    proto_item   *dlci_item;
     int           mcc_dlci;
     int           cl;
     dlci_state_t *dlci_state;
@@ -362,8 +362,8 @@ dissect_ctrl_msc(proto_tree *t, tvbuff_t *tvb, int offset, int length, guint8 *m
 
     proto_tree *st;
     proto_item *it;
-    proto_tree *dlci_tree = NULL;
-    proto_item *dlci_item = NULL;
+    proto_tree *dlci_tree;
+    proto_item *dlci_item;
     guint8      mcc_dlci;
     guint8      status;
     int         start_offset;