Remove some unneeded 'if(pinfo)' tests;
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 12 Nov 2011 20:17:43 +0000 (20:17 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 12 Nov 2011 20:17:43 +0000 (20:17 +0000)
Remove some unneeded forward refs.

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

epan/dissectors/packet-componentstatus.c
epan/dissectors/packet-fractalgeneratorprotocol.c
epan/dissectors/packet-netperfmeter.c
epan/dissectors/packet-pingpongprotocol.c
epan/dissectors/packet-scriptingservice.c

index 94482a35f1cbb7782cc9bb429e9d969f5b6e66d7..8ad89b492627176b620be3436eb1ee82ef4240b5 100644 (file)
@@ -232,10 +232,8 @@ dissect_componentstatusprotocol(tvbuff_t *message_tvb, packet_info *pinfo, proto
     return(0);
   }
 
-  /* pinfo is NULL only if dissect_componentstatusprotocol_message is called from dissect_error cause */
-  if (pinfo) {
-    col_set_str(pinfo->cinfo, COL_PROTOCOL, "ComponentStatusProtocol");
-  }
+  col_set_str(pinfo->cinfo, COL_PROTOCOL, "ComponentStatusProtocol");
+
   /* In the interest of speed, if "tree" is NULL, don't do any work not
      necessary to generate protocol tree items. */
   if (tree) {
index fba74b334a3c4fc346d8527cd2d2950d55e2df25..b01bb3e7bcc3119213a14b2acf9b0e47a2544dec 100644 (file)
@@ -61,10 +61,6 @@ static int hf_buffer                      = -1;
 /* Initialize the subtree pointers */
 static gint ett_fractalgeneratorprotocol = -1;
 
-static void
-dissect_fractalgeneratorprotocol_message(tvbuff_t *, packet_info *, proto_tree *);
-
-
 /* Dissectors for messages. This is specific to FractalGeneratorProtocol */
 #define MESSAGE_TYPE_LENGTH    1
 #define MESSAGE_FLAGS_LENGTH   1
@@ -155,7 +151,7 @@ dissect_fractalgeneratorprotocol_message(tvbuff_t *message_tvb, packet_info *pin
   guint8 type;
 
   type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
-  if (pinfo && (check_col(pinfo->cinfo, COL_INFO))) {
+  if (check_col(pinfo->cinfo, COL_INFO)) {
     col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown FractalGeneratorProtocol type"));
   }
   proto_tree_add_item(fractalgeneratorprotocol_tree, hf_message_type,   message_tvb, MESSAGE_TYPE_OFFSET,   MESSAGE_TYPE_LENGTH,   ENC_BIG_ENDIAN);
@@ -177,9 +173,7 @@ dissect_fractalgeneratorprotocol(tvbuff_t *message_tvb, packet_info *pinfo, prot
   proto_item *fractalgeneratorprotocol_item;
   proto_tree *fractalgeneratorprotocol_tree;
 
-  /* pinfo is NULL only if dissect_fractalgeneratorprotocol_message is called from dissect_error cause */
-  if (pinfo)
-    col_set_str(pinfo->cinfo, COL_PROTOCOL, "FractalGeneratorProtocol");
+  col_set_str(pinfo->cinfo, COL_PROTOCOL, "FractalGeneratorProtocol");
 
   /* In the interest of speed, if "tree" is NULL, don't do any work not
      necessary to generate protocol tree items. */
index d1a50e9f05e304fb8679bc98e5c620f4ddf48811..5ccbb8db212e36dce8bd9f8ab91db20ed1e3bcff 100644 (file)
@@ -374,7 +374,7 @@ dissect_npmp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *npmp
   guint8 type;
 
   type = tvb_get_guint8(message_tvb, offset_message_type);
-  if (pinfo && (check_col(pinfo->cinfo, COL_INFO))) {
+  if (check_col(pinfo->cinfo, COL_INFO)) {
     col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown NetPerfMeterProtocol type"));
   }
 
@@ -417,9 +417,7 @@ dissect_npmp(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
   proto_item *npmp_item;
   proto_tree *npmp_tree;
 
-  /* pinfo is NULL only if dissect_npmp_message is called from dissect_error cause */
-  if (pinfo)
-    col_set_str(pinfo->cinfo, COL_PROTOCOL, "NetPerfMeterProtocol");
+  col_set_str(pinfo->cinfo, COL_PROTOCOL, "NetPerfMeterProtocol");
 
   /* In the interest of speed, if "tree" is NULL, don't do any work not
      necessary to generate protocol tree items. */
index 8623f2289bf9f195d1345b7b5ca0a0441aafccaf..becec467c38cb7e4fc8865ca3ae6baaca5ccf03e 100644 (file)
@@ -54,10 +54,6 @@ static int hf_pong_data                   = -1;
 /* Initialize the subtree pointers */
 static gint ett_pingpongprotocol = -1;
 
-static void
-dissect_pingpongprotocol_message(tvbuff_t *, packet_info *, proto_tree *);
-
-
 /* Dissectors for messages. This is specific to PingPongProtocol */
 #define MESSAGE_TYPE_LENGTH    1
 #define MESSAGE_FLAGS_LENGTH   1
@@ -127,7 +123,7 @@ dissect_pingpongprotocol_message(tvbuff_t *message_tvb, packet_info *pinfo, prot
   guint8 type;
 
   type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
-  if (pinfo && (check_col(pinfo->cinfo, COL_INFO))) {
+  if (check_col(pinfo->cinfo, COL_INFO)) {
     col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown PingPongProtocol type"));
   }
   proto_tree_add_item(pingpongprotocol_tree, hf_message_type,   message_tvb, MESSAGE_TYPE_OFFSET,   MESSAGE_TYPE_LENGTH,   ENC_BIG_ENDIAN);
@@ -149,9 +145,7 @@ dissect_pingpongprotocol(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *
   proto_item *pingpongprotocol_item;
   proto_tree *pingpongprotocol_tree;
 
-  /* pinfo is NULL only if dissect_pingpongprotocol_message is called from dissect_error cause */
-  if (pinfo)
-    col_set_str(pinfo->cinfo, COL_PROTOCOL, "PingPongProtocol");
+  col_set_str(pinfo->cinfo, COL_PROTOCOL, "PingPongProtocol");
 
   /* In the interest of speed, if "tree" is NULL, don't do any work not
      necessary to generate protocol tree items. */
index 8d72f901f32f9d14aef398ce738c540a574b0bd9..40a150a5efabd3d671d6a26aebd125cb506bbfdc 100644 (file)
@@ -53,10 +53,6 @@ static int hf_environment_u_bit = -1;
 static gint ett_ssprotocol        = -1;
 static gint ett_environment_flags = -1;
 
-static guint
-dissect_ssprotocol_message(tvbuff_t *, packet_info *, proto_tree *);
-
-
 /* Dissectors for messages. This is specific to ScriptingServiceProtocol */
 #define MESSAGE_TYPE_LENGTH          1
 #define MESSAGE_FLAGS_LENGTH         1
@@ -124,7 +120,7 @@ dissect_ssprotocol_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree
   guint       total_length;
 
   type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET);
-  if (pinfo && (check_col(pinfo->cinfo, COL_INFO))) {
+  if (check_col(pinfo->cinfo, COL_INFO)) {
     col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(type, message_type_values, "Unknown SSP type: %u"));
   }
   proto_tree_add_item(ssprotocol_tree, hf_message_type,   message_tvb, MESSAGE_TYPE_OFFSET,   MESSAGE_TYPE_LENGTH,   ENC_BIG_ENDIAN);
@@ -182,9 +178,7 @@ dissect_ssprotocol(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
   proto_item *ssprotocol_item;
   proto_tree *ssprotocol_tree;
 
-  /* pinfo is NULL only if dissect_ssprotocol_message is called from dissect_error cause */
-  if (pinfo)
-    col_set_str(pinfo->cinfo, COL_PROTOCOL, "SSP");
+  col_set_str(pinfo->cinfo, COL_PROTOCOL, "SSP");
 
   /* In the interest of speed, if "tree" is NULL, don't do any work not
      necessary to generate protocol tree items. */