aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-07-25 22:58:09 -0400
committerAnders Broman <a.broman58@gmail.com>2016-07-26 04:08:50 +0000
commit907d49483d24698013fcdaec15b78a149751eecb (patch)
tree001c978c947dd64932fd2d9749cfc46756ac30dc /epan/prefs.c
parent6fbaf9be34e8745b2781294afdcf2822528a6349 (diff)
Fix some of the checkAPIs.pl warnings for g_warning.
1. Create ws_g_warning for legitimate uses of g_warning 2. Use proto_tree_add_debug_text 3. Comment some out Change-Id: Ida044bf40286b955fdd529c4f9907c8e09b3d7c5 Reviewed-on: https://code.wireshark.org/review/16678 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/prefs.c')
-rw-r--r--epan/prefs.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 21496ae10b..69b649e36e 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -43,6 +43,7 @@
#include <epan/column.h>
#include "print.h"
#include <wsutil/file_util.h>
+#include <wsutil/ws_printf.h> /* ws_g_warning */
#include <epan/prefs-int.h>
#include <epan/uat-int.h>
@@ -3494,7 +3495,7 @@ read_prefs_file(const char *pf_path, FILE *pf,
* If the pref has a trailing comma, eliminate it.
*/
cur_val->str[cur_val->len-1] = '\0';
- g_warning ("%s line %d: trailing comma in \"%s\" %s", pf_path, pline, cur_var->str, hint);
+ ws_g_warning ("%s line %d: trailing comma in \"%s\" %s", pf_path, pline, cur_var->str, hint);
}
}
/* Call the routine to set the preference; it will parse
@@ -3510,7 +3511,7 @@ read_prefs_file(const char *pf_path, FILE *pf,
break;
case PREFS_SET_SYNTAX_ERR:
- g_warning ("Syntax error in preference \"%s\" at line %d of\n%s %s",
+ ws_g_warning ("Syntax error in preference \"%s\" at line %d of\n%s %s",
cur_var->str, pline, pf_path, hint);
break;
@@ -3520,7 +3521,7 @@ read_prefs_file(const char *pf_path, FILE *pf,
* on non-Win32 platforms.
*/
if (strcmp(cur_var->str, "print.command") != 0)
- g_warning ("No such preference \"%s\" at line %d of\n%s %s",
+ ws_g_warning ("No such preference \"%s\" at line %d of\n%s %s",
cur_var->str, pline, pf_path, hint);
prefs.unknown_prefs = TRUE;
break;
@@ -3533,13 +3534,13 @@ read_prefs_file(const char *pf_path, FILE *pf,
The prefs in question need to be listed in the console window so that the
user can make an informed choice.
*/
- g_warning ("Obsolete preference \"%s\" at line %d of\n%s %s",
+ ws_g_warning ("Obsolete preference \"%s\" at line %d of\n%s %s",
cur_var->str, pline, pf_path, hint);
prefs.unknown_prefs = TRUE;
break;
}
} else {
- g_warning ("Incomplete preference at line %d: of\n%s %s", pline, pf_path, hint);
+ ws_g_warning ("Incomplete preference at line %d: of\n%s %s", pline, pf_path, hint);
}
}
state = IN_VAR;
@@ -3552,7 +3553,7 @@ read_prefs_file(const char *pf_path, FILE *pf,
} else if (got_c == '#') {
state = IN_SKIP;
} else {
- g_warning ("Malformed preference at line %d of\n%s %s", fline, pf_path, hint);
+ ws_g_warning ("Malformed preference at line %d of\n%s %s", fline, pf_path, hint);
}
break;
case IN_VAR:
@@ -3597,12 +3598,12 @@ read_prefs_file(const char *pf_path, FILE *pf,
break;
case PREFS_SET_SYNTAX_ERR:
- g_warning ("Syntax error in preference %s at line %d of\n%s %s",
+ ws_g_warning ("Syntax error in preference %s at line %d of\n%s %s",
cur_var->str, pline, pf_path, hint);
break;
case PREFS_SET_NO_SUCH_PREF:
- g_warning ("No such preference \"%s\" at line %d of\n%s %s",
+ ws_g_warning ("No such preference \"%s\" at line %d of\n%s %s",
cur_var->str, pline, pf_path, hint);
prefs.unknown_prefs = TRUE;
break;
@@ -3612,7 +3613,7 @@ read_prefs_file(const char *pf_path, FILE *pf,
break;
}
} else {
- g_warning ("Incomplete preference at line %d of\n%s %s",
+ ws_g_warning("Incomplete preference at line %d of\n%s %s",
pline, pf_path, hint);
}
}
@@ -4148,7 +4149,7 @@ set_pref(gchar *pref_name, const gchar *value, void *private_data _U_,
return PREFS_SET_OBSOLETE;
}
if (module) {
- g_warning ("Preference \"%s.%s\" has been converted to \"%s.%s.%s\"\n"
+ ws_g_warning ("Preference \"%s.%s\" has been converted to \"%s.%s.%s\"\n"
"Save your preferences to make this change permanent.",
pref_name, dotp+1, module->parent->name, pref_name, dotp+1);
prefs.unknown_prefs = TRUE;