summaryrefslogtreecommitdiff
path: root/epan/dfilter/dfilter-macro.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-12-05 12:40:58 -0800
committerGuy Harris <guy@alum.mit.edu>2015-12-05 20:41:32 +0000
commit4348d4dd34d0efaa5eb9e42969243a309b7115de (patch)
treed9ea2411124fdf6855446cfb36463638bf6ad6bc /epan/dfilter/dfilter-macro.c
parentb3fa4f34f401a4d675c8fb936b1547b0a8fda5c2 (diff)
downloadwireshark-4348d4dd34d0efaa5eb9e42969243a309b7115de.tar.gz
Type cleanups.
dfilter_macro_apply_recurse() returns either NULL or a pointer to freshly-allocated memory, so it doesn't return a const pointer. dfilter_macro_apply() calls dfilter_macro_apply_recurse(), so it doesn't return a const pointer, either. In dfilter_compile(), have separate variables for the filter handed in and the macro-expanded filter, the former being const gchar * and the latter being gchar *. Change-Id: I191549bf0ff6c09c1278a98432a907c93d5e0e74 Reviewed-on: https://code.wireshark.org/review/12446 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dfilter/dfilter-macro.c')
-rw-r--r--epan/dfilter/dfilter-macro.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c
index 56f84ee317..a971633dbb 100644
--- a/epan/dfilter/dfilter-macro.c
+++ b/epan/dfilter/dfilter-macro.c
@@ -160,7 +160,7 @@ static gchar* dfilter_macro_resolve(gchar* name, gchar** args, gchar** error) {
}
-static const gchar* dfilter_macro_apply_recurse(const gchar* text, guint depth, gchar** error) {
+static gchar* dfilter_macro_apply_recurse(const gchar* text, guint depth, gchar** error) {
enum { OUTSIDE, STARTING, NAME, ARGS } state = OUTSIDE;
GString* out;
GString* name = NULL;
@@ -322,11 +322,11 @@ finish:
FREE_ALL();
if (changed) {
- const gchar* resolved = dfilter_macro_apply_recurse(out->str, depth + 1, error);
+ gchar* resolved = dfilter_macro_apply_recurse(out->str, depth + 1, error);
g_string_free(out,TRUE);
return resolved;
} else {
- const gchar* out_str = wmem_strdup(NULL, out->str);
+ gchar* out_str = wmem_strdup(NULL, out->str);
g_string_free(out,TRUE);
return out_str;
}
@@ -343,7 +343,7 @@ on_error:
}
}
-const gchar* dfilter_macro_apply(const gchar* text, gchar** error) {
+gchar* dfilter_macro_apply(const gchar* text, gchar** error) {
return dfilter_macro_apply_recurse(text, 0, error);
}