forked from osmocom/wireshark
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>daniel/osmux
parent
9423a13b2d
commit
95382c3afb
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
13
editcap.c
13
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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
7
tshark.c
7
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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue