diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-20 17:11:39 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-20 17:11:39 +0300 |
commit | ea1da6a43cf4f6bfcc23722a05baaae203a00db4 (patch) | |
tree | 1bbc911a153e4968d9e14f98f74f1de195c2bc49 /src/cfg_xml.c | |
parent | 9e611e033cfc40aab58805d8e485f892352750c6 (diff) | |
download | rspamd-ea1da6a43cf4f6bfcc23722a05baaae203a00db4.tar.gz rspamd-ea1da6a43cf4f6bfcc23722a05baaae203a00db4.zip |
Make compiler happy in several cases, remove warnings.
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r-- | src/cfg_xml.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c index 4b3a7970d..87929f510 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -2097,6 +2097,11 @@ check_module_option (const gchar *mname, const gchar *optname, const gchar *data GHashTable *module; gchar *err_str; struct option_callback_data cd; + union { + gint i; + gdouble d; + guint ui; + } t; if (module_options == NULL) { msg_warn ("no module options registered while checking option %s for module %s", mname, optname); @@ -2128,39 +2133,44 @@ check_module_option (const gchar *mname, const gchar *optname, const gchar *data /* Allways OK */ return TRUE; case MODULE_OPT_TYPE_INT: - (void)strtol (data, &err_str, 10); + t.i = strtol (data, &err_str, 10); if (*err_str != '\0') { msg_warn ("non-numeric data for option: '%s' for module: '%s' at position: '%s'", optname, mname, err_str); return FALSE; } + (void)t.i; break; case MODULE_OPT_TYPE_UINT: - (void)strtoul (data, &err_str, 10); + t.ui = strtoul (data, &err_str, 10); if (*err_str != '\0') { msg_warn ("non-numeric data for option: '%s' for module: '%s' at position: '%s'", optname, mname, err_str); return FALSE; } + (void)t.ui; break; case MODULE_OPT_TYPE_DOUBLE: - (void)strtod (data, &err_str); + t.d = strtod (data, &err_str); if (*err_str != '\0') { msg_warn ("non-numeric data for option: '%s' for module: '%s' at position: '%s'", optname, mname, err_str); return FALSE; } + (void)t.d; break; case MODULE_OPT_TYPE_TIME: - (void)cfg_parse_time (data, TIME_SECONDS); + t.ui = cfg_parse_time (data, TIME_SECONDS); if (errno != 0) { msg_warn ("non-numeric data for option: '%s' for module: '%s': %s", optname, mname, strerror (errno)); return FALSE; } + (void)t.ui; break; case MODULE_OPT_TYPE_SIZE: - (void)parse_limit (data, -1); + t.ui = parse_limit (data, -1); if (errno != 0) { msg_warn ("non-numeric data for option: '%s' for module: '%s': %s", optname, mname, strerror (errno)); return FALSE; } + (void)t.ui; break; case MODULE_OPT_TYPE_MAP: if (!check_map_proto (data, NULL, NULL)) { |