aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-02-19 16:05:49 -0800
committerGerald Combs <gerald@wireshark.org>2015-02-20 04:04:15 +0000
commit95382c3afb9d50ffc7c0d178dbe9d76c763d687c (patch)
treeeee8a98844328b7ed7bc84b9156bcf3949d97903
parent9423a13b2db427d15f6b3d11b73624fffc02608f (diff)
Suppress a bunch of cast-qual warnings.
Squelch warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] similar to g630f54f. Change strtod to g_ascii_strtod to squelch a checkAPIs error. Change-Id: Ib2d26ef89f08827a5adc07e35eaf876cd7b8d14e Reviewed-on: https://code.wireshark.org/review/7269 Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--capinfos.c7
-rw-r--r--captype.c9
-rw-r--r--dumpcap.c5
-rw-r--r--editcap.c13
-rw-r--r--mergecap.c7
-rw-r--r--randpkt.c3
-rw-r--r--rawshark.c7
-rw-r--r--reordercap.c5
-rw-r--r--text2pcap.c3
-rw-r--r--tfshark.c7
-rw-r--r--tshark.c7
-rw-r--r--ui/gtk/main.c5
12 files changed, 58 insertions, 20 deletions
diff --git a/capinfos.c b/capinfos.c
index 555dfff312..31a6fb32ff 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -81,9 +81,10 @@
#include <zlib.h> /* to get the libz version number */
#endif
-#include <wsutil/privileges.h>
-#include <wsutil/filesystem.h>
#include <wsutil/crash_info.h>
+#include <wsutil/filesystem.h>
+#include <wsutil/privileges.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
#ifdef HAVE_PLUGINS
@@ -1118,11 +1119,13 @@ main(int argc, char *argv[])
gchar *err_info;
int opt;
int overall_error_status;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
int status = 0;
#ifdef HAVE_PLUGINS
diff --git a/captype.c b/captype.c
index 1dc853b445..2488ddda69 100644
--- a/captype.c
+++ b/captype.c
@@ -50,10 +50,11 @@
#include <glib.h>
-#include <wsutil/privileges.h>
-#include <wsutil/filesystem.h>
-#include <wsutil/file_util.h>
#include <wsutil/crash_info.h>
+#include <wsutil/file_util.h>
+#include <wsutil/filesystem.h>
+#include <wsutil/privileges.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
#ifdef HAVE_PLUGINS
@@ -129,11 +130,13 @@ main(int argc, char *argv[])
int i;
int opt;
int overall_error_status;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
#ifdef HAVE_PLUGINS
char *init_progfile_dir_error;
diff --git a/dumpcap.c b/dumpcap.c
index 7664a777b9..016a6760bd 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -72,6 +72,7 @@
#include <wsutil/cmdarg_err.h>
#include <wsutil/crash_info.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
#ifndef HAVE_GETOPT_LONG
@@ -888,8 +889,10 @@ compile_capture_filter(const char *iface, pcap_t *pcap_h,
* third argument to pcap_compile() as a const pointer. Cast
* away the warning.
*/
+DIAG_OFF(cast-qual)
if (pcap_compile(pcap_h, fcode, (char *)cfilter, 1, netmask) < 0)
return FALSE;
+DIAG_ON(cast-qual)
return TRUE;
}
@@ -4225,12 +4228,14 @@ main(int argc, char *argv[])
GString *comp_info_str;
GString *runtime_info_str;
int opt;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
LONGOPT_CAPTURE_COMMON
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
gboolean arg_error = FALSE;
diff --git a/editcap.c b/editcap.c
index bd7a71abe3..5fc83072bd 100644
--- a/editcap.c
+++ b/editcap.c
@@ -81,13 +81,14 @@
# include "wsutil/strptime.h"
#endif
-#include <wsutil/privileges.h>
+#include <wsutil/crash_info.h>
#include <wsutil/filesystem.h>
-#include <wsutil/report_err.h>
-#include <wsutil/strnatcmp.h>
#include <wsutil/md5.h>
#include <wsutil/plugins.h>
-#include <wsutil/crash_info.h>
+#include <wsutil/privileges.h>
+#include <wsutil/report_err.h>
+#include <wsutil/strnatcmp.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
#include "ringbuffer.h" /* For RINGBUFFER_MAX_NUM_FILES */
@@ -881,11 +882,13 @@ main(int argc, char *argv[])
int i, j, err;
gchar *err_info;
int opt;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'V'},
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
char *p;
guint32 snaplen = 0; /* No limit */
@@ -1074,7 +1077,7 @@ main(int argc, char *argv[])
break;
case 'E':
- err_prob = strtod(optarg, &p);
+ err_prob = g_ascii_strtod(optarg, &p);
if (p == optarg || err_prob < 0.0 || err_prob > 1.0) {
fprintf(stderr, "editcap: probability \"%s\" must be between 0.0 and 1.0\n",
optarg);
diff --git a/mergecap.c b/mergecap.c
index 3f345be9d4..5446fc6584 100644
--- a/mergecap.c
+++ b/mergecap.c
@@ -54,10 +54,11 @@
#endif
#include <wsutil/clopts_common.h>
-#include <wsutil/strnatcmp.h>
-#include <wsutil/file_util.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/crash_info.h>
+#include <wsutil/file_util.h>
+#include <wsutil/strnatcmp.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
#include <wiretap/merge.h>
@@ -215,11 +216,13 @@ main(int argc, char *argv[])
GString *comp_info_str;
GString *runtime_info_str;
int opt;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'V'},
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
gboolean do_append = FALSE;
gboolean verbose = FALSE;
int in_file_count = 0;
diff --git a/randpkt.c b/randpkt.c
index 9ddfd78e28..bf391be2bb 100644
--- a/randpkt.c
+++ b/randpkt.c
@@ -48,6 +48,7 @@
#include <glib.h>
#include "wiretap/wtap.h"
#include "wsutil/file_util.h"
+#include <wsutil/ws_diag_control.h>
#ifdef _WIN32
#include <wsutil/unicode-utils.h>
@@ -512,10 +513,12 @@ main(int argc, char **argv)
char *produce_filename = NULL;
int produce_max_bytes = 5000;
pkt_example *example;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
diff --git a/rawshark.c b/rawshark.c
index f75f9abb5b..6c901fcb57 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -68,11 +68,12 @@
#include <wsutil/cmdarg_err.h>
#include <wsutil/crash_info.h>
-#include <wsutil/privileges.h>
-#include <wsutil/file_util.h>
#include <wsutil/filesystem.h>
+#include <wsutil/file_util.h>
#include <wsutil/plugins.h>
+#include <wsutil/privileges.h>
#include <wsutil/report_err.h>
+#include <wsutil/ws_diag_control.h>
#include "globals.h"
#include <epan/packet.h>
@@ -440,11 +441,13 @@ main(int argc, char *argv[])
GPtrArray *disp_fields = g_ptr_array_new();
guint fc;
gboolean skip_pcap_header = FALSE;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
#define OPTSTRING_INIT "d:F:hlnN:o:pr:R:sS:t:v"
diff --git a/reordercap.c b/reordercap.c
index 1dcac3d4a6..4c64033926 100644
--- a/reordercap.c
+++ b/reordercap.c
@@ -46,8 +46,9 @@
#include "wsutil/wsgetopt.h"
#endif
-#include <wsutil/file_util.h>
#include <wsutil/crash_info.h>
+#include <wsutil/file_util.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
/* Show command-line usage */
@@ -197,11 +198,13 @@ main(int argc, char *argv[])
FrameRecord_t *prevFrame = NULL;
int opt;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
int file_count;
char *infile;
char *outfile;
diff --git a/text2pcap.c b/text2pcap.c
index 3f22c0c397..bd41e2acff 100644
--- a/text2pcap.c
+++ b/text2pcap.c
@@ -112,6 +112,7 @@
#include <string.h>
#include <wsutil/file_util.h>
#include <wsutil/crash_info.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
#include <time.h>
@@ -1534,11 +1535,13 @@ parse_options (int argc, char *argv[])
GString *runtime_info_str;
int c;
char *p;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
diff --git a/tfshark.c b/tfshark.c
index d87f6e3aba..ddf9e6695a 100644
--- a/tfshark.c
+++ b/tfshark.c
@@ -64,10 +64,11 @@
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/crash_info.h>
-#include <wsutil/privileges.h>
-#include <wsutil/file_util.h>
#include <wsutil/filesystem.h>
+#include <wsutil/file_util.h>
+#include <wsutil/privileges.h>
#include <wsutil/report_err.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
#include "globals.h"
@@ -772,11 +773,13 @@ main(int argc, char *argv[])
GString *runtime_info_str;
char *init_progfile_dir_error;
int opt;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
gboolean arg_error = FALSE;
char *gpf_path, *pf_path;
diff --git a/tshark.c b/tshark.c
index ffbb30343f..ff3235cffb 100644
--- a/tshark.c
+++ b/tshark.c
@@ -73,10 +73,11 @@
#include <wsutil/clopts_common.h>
#include <wsutil/cmdarg_err.h>
#include <wsutil/crash_info.h>
-#include <wsutil/privileges.h>
-#include <wsutil/file_util.h>
#include <wsutil/filesystem.h>
+#include <wsutil/file_util.h>
+#include <wsutil/privileges.h>
#include <wsutil/report_err.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
#include "globals.h"
@@ -948,12 +949,14 @@ main(int argc, char *argv[])
GString *runtime_info_str;
char *init_progfile_dir_error;
int opt;
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"version", no_argument, NULL, 'v'},
LONGOPT_CAPTURE_COMMON
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
gboolean arg_error = FALSE;
#ifdef _WIN32
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index f404c9d8d3..bfdee9669a 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -57,13 +57,14 @@
#endif /* HAVE_LIBPORTAUDIO */
#include <wsutil/clopts_common.h>
+#include <wsutil/copyright_info.h>
#include <wsutil/crash_info.h>
#include <wsutil/filesystem.h>
#include <wsutil/file_util.h>
#include <wsutil/privileges.h>
#include <wsutil/report_err.h>
#include <wsutil/u3.h>
-#include <wsutil/copyright_info.h>
+#include <wsutil/ws_diag_control.h>
#include <wsutil/ws_version_info.h>
#include <wiretap/merge.h>
@@ -2176,6 +2177,7 @@ main(int argc, char *argv[])
#endif
#define OPTSTRING OPTSTRING_CAPTURE_COMMON "C:g:Hh" "jJ:kK:lm:nN:o:P:r:R:St:u:vw:X:Y:z:"
+DIAG_OFF(cast-qual)
static const struct option long_options[] = {
{(char *)"help", no_argument, NULL, 'h'},
{(char *)"read-file", required_argument, NULL, 'r' },
@@ -2185,6 +2187,7 @@ main(int argc, char *argv[])
LONGOPT_CAPTURE_COMMON
{0, 0, 0, 0 }
};
+DIAG_ON(cast-qual)
static const char optstring[] = OPTSTRING;
cmdarg_err_init(wireshark_cmdarg_err, wireshark_cmdarg_err_cont);