aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dfilter/dfilter-macro.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dfilter/dfilter-macro.c')
-rw-r--r--epan/dfilter/dfilter-macro.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c
index b3f04df317..3c43191515 100644
--- a/epan/dfilter/dfilter-macro.c
+++ b/epan/dfilter/dfilter-macro.c
@@ -149,14 +149,14 @@ void dfilter_macro_dump(void) {
#endif
}
-static gchar* dfilter_macro_resolve(gchar* name, gchar** args, const gchar** error) {
+static const gchar* dfilter_macro_resolve(gchar* name, gchar** args, const gchar** error) {
GString* text;
int argc = 0;
dfilter_macro_t* m = NULL;
fvt_cache_entry_t* e;
int* arg_pos_p;
gchar** parts;
- gchar* ret;
+ const gchar* ret;
guint i;
for (i = 0; i < num_macros; i++) {
@@ -215,7 +215,7 @@ static gchar* dfilter_macro_resolve(gchar* name, gchar** args, const gchar** err
}
-static gchar* dfilter_macro_apply_recurse(const gchar* text, guint depth, const gchar** error) {
+static const gchar* dfilter_macro_apply_recurse(const gchar* text, guint depth, const gchar** error) {
enum { OUTSIDE, STARTING, NAME, ARGS } state = OUTSIDE;
GString* out;
GString* name = NULL;
@@ -293,7 +293,7 @@ static gchar* dfilter_macro_apply_recurse(const gchar* text, guint depth, const
} else if ( c == ':') {
state = ARGS;
} else if ( c == '}') {
- gchar* resolved;
+ const gchar* resolved;
g_ptr_array_add(args,NULL);
@@ -339,7 +339,7 @@ static gchar* dfilter_macro_apply_recurse(const gchar* text, guint depth, const
g_string_append_c(arg,c);
break;
} case '}': {
- gchar* resolved;
+ const gchar* resolved;
g_ptr_array_add(args,arg->str);
g_ptr_array_add(args,NULL);
@@ -369,11 +369,11 @@ finish:
FREE_ALL();
if (changed) {
- gchar* resolved = dfilter_macro_apply_recurse(out->str, depth + 1, error);
+ const gchar* resolved = dfilter_macro_apply_recurse(out->str, depth + 1, error);
g_string_free(out,TRUE);
return (*error) ? NULL : resolved;
} else {
- gchar* out_str = ep_strdup(out->str);
+ const gchar* out_str = ep_strdup(out->str);
g_string_free(out,TRUE);
return out_str;
}
@@ -387,7 +387,7 @@ on_error:
}
}
-gchar* dfilter_macro_apply(const gchar* text, const gchar** error) {
+const gchar* dfilter_macro_apply(const gchar* text, const gchar** error) {
return dfilter_macro_apply_recurse(text, 0, error);
}