aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dfilter
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-04-23 10:59:26 +0000
committerGuy Harris <guy@alum.mit.edu>2007-04-23 10:59:26 +0000
commit1bc049906a35c3490532ab68fcbf90750c225f77 (patch)
treef690697725617a640820ade652da4cf766bdc863 /epan/dfilter
parent7dc9df5f26ed136405fd1e99d62ebc3a6bf92dd5 (diff)
Add some GCC warnings to the standard set, and add some others to the
--enable-extra-gcc-checks set. If we turn on -pedantic, try turning on -Wno-long-long as well, so that it's not *so* pedantic that it rejects the 64-bit integral data types that we explicitly require. Constify a bunch of stuff, and make some other changes, to get rid of warnings. Clean up some indentation. svn path=/trunk/; revision=21526
Diffstat (limited to 'epan/dfilter')
-rw-r--r--epan/dfilter/dfilter-macro.c8
-rw-r--r--epan/dfilter/dfilter-macro.h5
-rw-r--r--epan/dfilter/dfilter.c2
-rw-r--r--epan/dfilter/dfilter.h2
-rw-r--r--epan/dfilter/dfunctions.h2
5 files changed, 11 insertions, 8 deletions
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c
index c260a6b1d3..21d50b8916 100644
--- a/epan/dfilter/dfilter-macro.c
+++ b/epan/dfilter/dfilter-macro.c
@@ -97,7 +97,7 @@ void dfilter_macro_dump(void) {
#endif
}
-static gchar* dfilter_macro_resolve(gchar* name, gchar** args, gchar** error) {
+static gchar* dfilter_macro_resolve(gchar* name, gchar** args, const gchar** error) {
GString* text;
int argc = 0;
dfilter_macro_t* m = NULL;
@@ -148,7 +148,7 @@ static gchar* dfilter_macro_resolve(gchar* name, gchar** args, gchar** error) {
}
-gchar* dfilter_macro_apply(const gchar* text, guint depth, gchar** error) {
+gchar* dfilter_macro_apply(const gchar* text, guint depth, const gchar** error) {
enum { OUTSIDE, STARTING, NAME, ARGS } state = OUTSIDE;
GString* out;
GString* name = NULL;
@@ -318,7 +318,7 @@ on_error:
}
}
-static void macro_update(void* mp, gchar** error) {
+static void macro_update(void* mp, const gchar** error) {
dfilter_macro_t* m = mp;
GPtrArray* parts;
GArray* args_pos;
@@ -445,7 +445,7 @@ static void* macro_copy(void* dest, const void* orig, unsigned len _U_) {
}
-gboolean macro_name_chk(void* r _U_, const char* in_name, unsigned name_len, void* u1 _U_, void* u2 _U_, char** error) {
+static gboolean macro_name_chk(void* r _U_, const char* in_name, unsigned name_len, void* u1 _U_, void* u2 _U_, const char** error) {
guint i;
for (i=0; i < name_len; i++) {
diff --git a/epan/dfilter/dfilter-macro.h b/epan/dfilter/dfilter-macro.h
index bf30cbc53e..50c1cec04c 100644
--- a/epan/dfilter/dfilter-macro.h
+++ b/epan/dfilter/dfilter-macro.h
@@ -41,11 +41,14 @@ typedef struct _dfilter_macro_t {
typedef void (*dfilter_macro_cb_t)(dfilter_macro_t*, void*);
void dfilter_macro_foreach(dfilter_macro_cb_t, void*);
+/* save dfilter macros to a file */
+void dfilter_macro_save(const gchar*, gchar**);
+
/* dumps the macros in the list (debug info, not formated as in the macros file) */
void dfilter_macro_dump(void);
/* applies all macros to the given text and returns the resulting string or NULL on failure */
-gchar* dfilter_macro_apply(const gchar* text, guint depth, gchar** error);
+gchar* dfilter_macro_apply(const gchar* text, guint depth, const gchar** error);
void dfilter_macro_init(void);
diff --git a/epan/dfilter/dfilter.c b/epan/dfilter/dfilter.c
index 775321076f..e0ac2a194f 100644
--- a/epan/dfilter/dfilter.c
+++ b/epan/dfilter/dfilter.c
@@ -41,7 +41,7 @@
/* Global error message space for dfilter_compile errors */
static gchar dfilter_error_msg_buf[1024];
-gchar *dfilter_error_msg; /* NULL when no error resulted */
+const gchar *dfilter_error_msg; /* NULL when no error resulted */
/* From scanner.c */
void df_scanner_text(const char *text);
diff --git a/epan/dfilter/dfilter.h b/epan/dfilter/dfilter.h
index 401cd75812..7be98cae20 100644
--- a/epan/dfilter/dfilter.h
+++ b/epan/dfilter/dfilter.h
@@ -69,7 +69,7 @@ dfilter_free(dfilter_t *df);
* libwireshark.dll, we need a special declaration.
*/
-WS_VAR_IMPORT gchar *dfilter_error_msg;
+WS_VAR_IMPORT const gchar *dfilter_error_msg;
/* Apply compiled dfilter */
diff --git a/epan/dfilter/dfunctions.h b/epan/dfilter/dfunctions.h
index 8abf520ecc..f324e159c4 100644
--- a/epan/dfilter/dfunctions.h
+++ b/epan/dfilter/dfunctions.h
@@ -42,7 +42,7 @@ typedef void (*DFSemCheckType)(int param_num, stnode_t *st_node);
/* This is a "function definition" record, holding everything
* we need to know about a function */
typedef struct {
- char *name;
+ const char *name;
DFFuncType function;
ftenum_t retval_ftype;
guint min_nargs;