Remove string constants from g_assert() calls, as per thread on wireshark-dev:
authorEvan Huus <eapache@gmail.com>
Wed, 5 Sep 2012 01:44:09 +0000 (01:44 -0000)
committerEvan Huus <eapache@gmail.com>
Wed, 5 Sep 2012 01:44:09 +0000 (01:44 -0000)
http://www.wireshark.org/lists/wireshark-dev/201209/msg00030.html

svn path=/trunk/; revision=44774

file.c
print.c
proto_hier_stats.c
ui/gtk/dcerpc_stat.c
ui/gtk/io_stat.c
ui/gtk/proto_tree_model.c
ui/gtk/rtp_analysis.c
ui/qt/proto_tree.cpp

diff --git a/file.c b/file.c
index ea05108b18e72c51b3af446fe0f80dc12cb894a5..f4f7e9c178747a4fbaa21c8c94294ad2e64943f8 100644 (file)
--- a/file.c
+++ b/file.c
@@ -3014,7 +3014,8 @@ match_subtree_text(proto_node *node, gpointer data)
   guint8        c_char;
   size_t        c_match    = 0;
 
   guint8        c_char;
   size_t        c_match    = 0;
 
-  g_assert(fi && "dissection with an invisible proto tree?");
+  /* dissection with an invisible proto tree? */
+  g_assert(fi);
 
   if (mdata->frame_matched) {
     /* We already had a match; don't bother doing any more work. */
 
   if (mdata->frame_matched) {
     /* We already had a match; don't bother doing any more work. */
diff --git a/print.c b/print.c
index b4bb51a6db1eeb3beefcaf07313eca64aaef4a8e..a3419c80656532856864fdb2de3d45a5bbfb08c8 100644 (file)
--- a/print.c
+++ b/print.c
@@ -167,7 +167,8 @@ void proto_tree_print_node(proto_node *node, gpointer data)
        gchar           label_str[ITEM_LABEL_LENGTH];
        gchar           *label_ptr;
 
        gchar           label_str[ITEM_LABEL_LENGTH];
        gchar           *label_ptr;
 
-       g_assert(fi && "dissection with an invisible proto tree?");
+       /* dissection with an invisible proto tree? */
+       g_assert(fi);
 
        /* Don't print invisible entries. */
        if (PROTO_ITEM_IS_HIDDEN(node))
 
        /* Don't print invisible entries. */
        if (PROTO_ITEM_IS_HIDDEN(node))
@@ -296,7 +297,8 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data)
        int             i;
        gboolean wrap_in_fake_protocol;
 
        int             i;
        gboolean wrap_in_fake_protocol;
 
-       g_assert(fi && "dissection with an invisible proto tree?");
+       /* dissection with an invisible proto tree? */
+       g_assert(fi);
 
        /* Will wrap up top-level field items inside a fake protocol wrapper to
           preserve the PDML schema */
 
        /* Will wrap up top-level field items inside a fake protocol wrapper to
           preserve the PDML schema */
@@ -1553,7 +1555,8 @@ static void proto_tree_get_node_field_values(proto_node *node, gpointer data)
     call_data = (write_field_data_t *)data;
     fi = PNODE_FINFO(node);
 
     call_data = (write_field_data_t *)data;
     fi = PNODE_FINFO(node);
 
-    g_assert(fi && "dissection with an invisible proto tree?");
+    /* dissection with an invisible proto tree? */
+    g_assert(fi);
 
     field_index = g_hash_table_lookup(call_data->fields->field_indicies, fi->hfinfo->abbrev);
     if(NULL != field_index) {
 
     field_index = g_hash_table_lookup(call_data->fields->field_indicies, fi->hfinfo->abbrev);
     if(NULL != field_index) {
index 5ba3f97064f026c6c3ddd34ff61e53ca0b115be6..e01b3893aa5ce84e277aec6c09890eb2c620c93c 100644 (file)
@@ -87,8 +87,9 @@ process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu
        GNode                   *stat_node;
 
        finfo = PNODE_FINFO(ptree_node);
        GNode                   *stat_node;
 
        finfo = PNODE_FINFO(ptree_node);
-       /* We don't fake protocol nodes we expect them to have a field_info */
-       g_assert(finfo && "dissection with faked proto tree?");
+       /* We don't fake protocol nodes we expect them to have a field_info.
+        * Dissection with faked proto tree? */
+       g_assert(finfo);
 
        /* If the field info isn't related to a protocol but to a field,
         * don't count them, as they don't belong to any protocol.
 
        /* If the field info isn't related to a protocol but to a field,
         * don't count them, as they don't belong to any protocol.
index 8f82c1d56edbf9ff8597fcda3ea43c1b8b3a8dbc..7588700567baf6ba373f5554575d982b593cc16a 100644 (file)
@@ -434,7 +434,8 @@ dcerpcstat_program_select(GtkWidget *prog_combo_box, gpointer user_data)
        g_signal_handlers_disconnect_by_func(vers_combo_box, G_CALLBACK(dcerpcstat_version_select), NULL );
        ws_combo_box_clear_text_and_pointer(GTK_COMBO_BOX(vers_combo_box));
 
        g_signal_handlers_disconnect_by_func(vers_combo_box, G_CALLBACK(dcerpcstat_version_select), NULL );
        ws_combo_box_clear_text_and_pointer(GTK_COMBO_BOX(vers_combo_box));
 
-       g_assert((k != NULL) && "dcerpc_stat: invalid selection"); /* Somehow selected top level ?? */
+       /* dcerpc_stat: invalid selection... somehow selected top level ?? */
+       g_assert(k != NULL);
        dcerpc_uuid_program = &(k->uuid);
 
        /* re-create version menu */
        dcerpc_uuid_program = &(k->uuid);
 
        /* re-create version menu */
index 1d579fd0aa2725c4388e93908e857e4beac29fdc..44954e80a837ad10b855cebaa4e6306f5e562611 100644 (file)
@@ -1457,7 +1457,8 @@ iostat_init(const char *optarg _U_, void* userdata _U_)
        io_stat_reset(io);
 
        error_string=enable_graph(&io->graphs[0], NULL, NULL);
        io_stat_reset(io);
 
        error_string=enable_graph(&io->graphs[0], NULL, NULL);
-       g_assert((error_string == NULL) && "Can't attach io_stat tap !");
+       /* Can't attach io_stat tap ! */
+       g_assert(error_string == NULL);
 #if 0
        if(error_string){
 
 #if 0
        if(error_string){
 
index 3bef61294609c8f2f3594c3cd4e34d12025f2a96..d6ed53d200a8952dec8244b3098b2e9696f31d3c 100644 (file)
@@ -195,7 +195,8 @@ proto_tree_model_get_value(GtkTreeModel *tree_model, GtkTreeIter *iter, gint col
        node = iter->user_data;
        fi = PNODE_FINFO(node);
 
        node = iter->user_data;
        fi = PNODE_FINFO(node);
 
-       g_assert(fi && "dissection with an invisible proto tree?");
+       /* dissection with an invisible proto tree? */
+       g_assert(fi);
 
        switch (column) {
                case 0:
 
        switch (column) {
                case 0:
index 43185ef389efe3715049ebd0b089ff434ee7b544..3071841df2643d36aa0c2d94f9c6385f31c7aa8b 100644 (file)
@@ -3588,7 +3588,8 @@ static gboolean process_node(proto_node *ptree_node, header_field_info *hfinform
 
        finfo = PNODE_FINFO(ptree_node);
 
 
        finfo = PNODE_FINFO(ptree_node);
 
-       g_assert(finfo && "Caller passed top of the protocol tree. Expected child node");
+       /* Caller passed top of the protocol tree. Expected child node */
+       g_assert(finfo);
 
        if (hfinformation==(finfo->hfinfo)) {
                hfssrc = proto_registrar_get_byname(proto_field);
 
        if (hfinformation==(finfo->hfinfo)) {
                hfssrc = proto_registrar_get_byname(proto_field);
index 2535f579d352cfbd2d48b248aef5690a8bae2096..09157d96c3a40aa1a7f9dc9d89135fff1cf7fff7 100644 (file)
@@ -51,7 +51,8 @@ proto_tree_draw_node(proto_node *node, gpointer data)
     gchar        *label_ptr;
     gboolean      is_leaf;
 
     gchar        *label_ptr;
     gboolean      is_leaf;
 
-    g_assert(fi && "dissection with an invisible proto tree?");
+    /* dissection with an invisible proto tree? */
+    g_assert(fi);
 
     if (PROTO_ITEM_IS_HIDDEN(node) && !prefs.display_hidden_proto_items)
         return;
 
     if (PROTO_ITEM_IS_HIDDEN(node) && !prefs.display_hidden_proto_items)
         return;