aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2020-09-04 15:15:05 -0700
committerAndersBroman <a.broman58@gmail.com>2020-09-05 07:41:29 +0000
commit7ab6440416622965513ee6e65f46ecdabefc6bdd (patch)
treef4286e9ca294cac1664e04ba9d6763b3e53a5b89
parenta46b62fcab53a42ce09764b03cccf4bd2136931d (diff)
Tools: Clean up checkAPI and add ui/qt.
Remove the --check-addtext and --build flags. They were used for checkAddTextCalls, which was removed in e2735ecfdd. Add the sources in ui/qt except for qcustomplot.{cpp,h}. Fix issues in main.cpp, rtp_audio_stream.cpp, and wireshark_zip_helper.cpp. Rename "index"es in packet-usb-hid.c.
-rw-r--r--CMakeLists.txt1
-rw-r--r--epan/CMakeLists.txt2
-rw-r--r--epan/crypt/CMakeLists.txt2
-rw-r--r--epan/dfilter/CMakeLists.txt2
-rw-r--r--epan/dissectors/CMakeLists.txt2
-rw-r--r--epan/dissectors/packet-usb-hid.c12
-rw-r--r--epan/ftypes/CMakeLists.txt2
-rw-r--r--epan/wmem/CMakeLists.txt1
-rw-r--r--epan/wslua/CMakeLists.txt2
-rw-r--r--plugins/codecs/G711/CMakeLists.txt2
-rw-r--r--plugins/codecs/G722/CMakeLists.txt2
-rw-r--r--plugins/codecs/G726/CMakeLists.txt2
-rw-r--r--plugins/codecs/G729/CMakeLists.txt2
-rw-r--r--plugins/codecs/iLBC/CMakeLists.txt2
-rw-r--r--plugins/codecs/l16_mono/CMakeLists.txt2
-rw-r--r--plugins/codecs/sbc/CMakeLists.txt2
-rw-r--r--plugins/epan/ethercat/CMakeLists.txt2
-rw-r--r--plugins/epan/gryphon/CMakeLists.txt2
-rw-r--r--plugins/epan/irda/CMakeLists.txt2
-rw-r--r--plugins/epan/mate/CMakeLists.txt1
-rw-r--r--plugins/epan/opcua/CMakeLists.txt2
-rw-r--r--plugins/epan/pluginifdemo/CMakeLists.txt2
-rw-r--r--plugins/epan/profinet/CMakeLists.txt2
-rw-r--r--plugins/epan/stats_tree/CMakeLists.txt2
-rw-r--r--plugins/epan/transum/CMakeLists.txt2
-rw-r--r--plugins/epan/unistim/CMakeLists.txt2
-rw-r--r--plugins/epan/wimax/CMakeLists.txt2
-rw-r--r--plugins/epan/wimaxasncp/CMakeLists.txt2
-rw-r--r--plugins/epan/wimaxmacphy/CMakeLists.txt2
-rw-r--r--plugins/wiretap/usbdump/CMakeLists.txt2
-rwxr-xr-xtools/checkAPIs.pl40
-rw-r--r--ui/qt/CMakeLists.txt34
-rw-r--r--ui/qt/main.cpp4
-rw-r--r--ui/qt/rtp_audio_stream.cpp2
-rw-r--r--ui/qt/utils/wireshark_zip_helper.cpp16
-rw-r--r--wiretap/CMakeLists.txt1
-rw-r--r--wsutil/CMakeLists.txt2
37 files changed, 98 insertions, 68 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 61e9d008fa..3f5d342f46 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3458,7 +3458,6 @@ CHECKAPI(
NAME
main
SWITCHES
- -build
SOURCES
${WIRESHARK_SRC}
${TSHARK_TAP_SRC}
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt
index 53c18ad8e3..0b85630d65 100644
--- a/epan/CMakeLists.txt
+++ b/epan/CMakeLists.txt
@@ -420,7 +420,7 @@ CHECKAPI(
NAME
epan
SWITCHES
- --group termoutput:10 --summary-group termoutput --build
+ --group termoutput:10 --summary-group termoutput
SOURCES
${LIBWIRESHARK_NONGENERATED_FILES}
)
diff --git a/epan/crypt/CMakeLists.txt b/epan/crypt/CMakeLists.txt
index 9cd87c8698..d350ee41c8 100644
--- a/epan/crypt/CMakeLists.txt
+++ b/epan/crypt/CMakeLists.txt
@@ -69,7 +69,7 @@ CHECKAPI(
NAME
crypt
SWITCHES
- -g termoutput -build
+ -g termoutput
SOURCES
${CRYPT_FILES}
)
diff --git a/epan/dfilter/CMakeLists.txt b/epan/dfilter/CMakeLists.txt
index 953001a64a..df3b10f715 100644
--- a/epan/dfilter/CMakeLists.txt
+++ b/epan/dfilter/CMakeLists.txt
@@ -96,7 +96,7 @@ CHECKAPI(
NAME
dfilter
SWITCHES
- -g termoutput -build
+ -g termoutput
SOURCES
${DFILTER_NONGENERATED_FILES}
# LEX files commented out due to use of malloc, free etc.
diff --git a/epan/dissectors/CMakeLists.txt b/epan/dissectors/CMakeLists.txt
index 49842389d8..604fa0a88f 100644
--- a/epan/dissectors/CMakeLists.txt
+++ b/epan/dissectors/CMakeLists.txt
@@ -2053,7 +2053,7 @@ CHECKAPI(
SWITCHES
--group abort
--group termoutput:5 --summary-group termoutput
- --build --file ${CHECKAPI_FILE_LIST}
+ --file ${CHECKAPI_FILE_LIST}
SOURCES
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_HEADERS}
diff --git a/epan/dissectors/packet-usb-hid.c b/epan/dissectors/packet-usb-hid.c
index 021efbbb81..f2403c73b5 100644
--- a/epan/dissectors/packet-usb-hid.c
+++ b/epan/dissectors/packet-usb-hid.c
@@ -3264,25 +3264,25 @@ static const value_string keycode_vals[] = {
value_string_ext keycode_vals_ext = VALUE_STRING_EXT_INIT(keycode_vals);
static guint32
-hid_unpack_value(guint8 *data, unsigned int index, unsigned int size)
+hid_unpack_value(guint8 *data, unsigned int idx, unsigned int size)
{
guint32 value = 0;
for(unsigned int i = 1; i <= size; i++)
- value |= data[index + i] << (8 * (i - 1));
+ value |= data[idx + i] << (8 * (i - 1));
return value;
}
static gboolean
-hid_unpack_signed(guint8 *data, unsigned int index, unsigned int size, gint32 *value)
+hid_unpack_signed(guint8 *data, unsigned int idx, unsigned int size, gint32 *value)
{
if (size == 1)
- *value = (gint8) hid_unpack_value(data, index, size);
+ *value = (gint8) hid_unpack_value(data, idx, size);
else if (size == 2)
- *value = (gint16) hid_unpack_value(data, index, size);
+ *value = (gint16) hid_unpack_value(data, idx, size);
else if (size == 4)
- *value = (gint32) hid_unpack_value(data, index, size);
+ *value = (gint32) hid_unpack_value(data, idx, size);
else
return TRUE;
diff --git a/epan/ftypes/CMakeLists.txt b/epan/ftypes/CMakeLists.txt
index 8d4194d984..4ed8355506 100644
--- a/epan/ftypes/CMakeLists.txt
+++ b/epan/ftypes/CMakeLists.txt
@@ -65,7 +65,7 @@ CHECKAPI(
NAME
ftypes
SWITCHES
- -g termoutput -build
+ -g termoutput
SOURCES
${FTYPE_FILES}
)
diff --git a/epan/wmem/CMakeLists.txt b/epan/wmem/CMakeLists.txt
index 77f222db79..7ac991eded 100644
--- a/epan/wmem/CMakeLists.txt
+++ b/epan/wmem/CMakeLists.txt
@@ -99,7 +99,6 @@ CHECKAPI(
wmem
SWITCHES
--group termoutput:1 --summary-group termoutput
- --build
SOURCES
${WMEM_FILES}
)
diff --git a/epan/wslua/CMakeLists.txt b/epan/wslua/CMakeLists.txt
index b6f69e0d1f..481f04cfe7 100644
--- a/epan/wslua/CMakeLists.txt
+++ b/epan/wslua/CMakeLists.txt
@@ -154,7 +154,7 @@ CHECKAPI(
NAME
wslua
SWITCHES
- --group termoutput:6 --summary-group termoutput --build
+ --group termoutput:6 --summary-group termoutput
SOURCES
${WSLUA_FILES}
)
diff --git a/plugins/codecs/G711/CMakeLists.txt b/plugins/codecs/G711/CMakeLists.txt
index b21aaf5eb3..440f7ff0d3 100644
--- a/plugins/codecs/G711/CMakeLists.txt
+++ b/plugins/codecs/G711/CMakeLists.txt
@@ -48,7 +48,7 @@ CHECKAPI(
NAME
g711
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${CODEC_SRC}
${CODEC_HEADERS}
diff --git a/plugins/codecs/G722/CMakeLists.txt b/plugins/codecs/G722/CMakeLists.txt
index c81877c20e..d69e35f14c 100644
--- a/plugins/codecs/G722/CMakeLists.txt
+++ b/plugins/codecs/G722/CMakeLists.txt
@@ -50,7 +50,7 @@ CHECKAPI(
NAME
g722
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${CODEC_SRC}
${CODEC_HEADERS}
diff --git a/plugins/codecs/G726/CMakeLists.txt b/plugins/codecs/G726/CMakeLists.txt
index 3e3964ffec..8cfbb6edd2 100644
--- a/plugins/codecs/G726/CMakeLists.txt
+++ b/plugins/codecs/G726/CMakeLists.txt
@@ -50,7 +50,7 @@ CHECKAPI(
NAME
g726
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${CODEC_SRC}
${CODEC_HEADERS}
diff --git a/plugins/codecs/G729/CMakeLists.txt b/plugins/codecs/G729/CMakeLists.txt
index b20fce09be..f6193c6938 100644
--- a/plugins/codecs/G729/CMakeLists.txt
+++ b/plugins/codecs/G729/CMakeLists.txt
@@ -50,7 +50,7 @@ CHECKAPI(
NAME
g729
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${CODEC_SRC}
${CODEC_HEADERS}
diff --git a/plugins/codecs/iLBC/CMakeLists.txt b/plugins/codecs/iLBC/CMakeLists.txt
index 4f960a34ce..e3ab0c7dd7 100644
--- a/plugins/codecs/iLBC/CMakeLists.txt
+++ b/plugins/codecs/iLBC/CMakeLists.txt
@@ -50,7 +50,7 @@ CHECKAPI(
NAME
ilbc
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${CODEC_SRC}
${CODEC_HEADERS}
diff --git a/plugins/codecs/l16_mono/CMakeLists.txt b/plugins/codecs/l16_mono/CMakeLists.txt
index 66e66c3944..a6b7e27955 100644
--- a/plugins/codecs/l16_mono/CMakeLists.txt
+++ b/plugins/codecs/l16_mono/CMakeLists.txt
@@ -48,7 +48,7 @@ CHECKAPI(
NAME
l16mono
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${CODEC_SRC}
${CODEC_HEADERS}
diff --git a/plugins/codecs/sbc/CMakeLists.txt b/plugins/codecs/sbc/CMakeLists.txt
index 8d86ac1536..d06eb21e83 100644
--- a/plugins/codecs/sbc/CMakeLists.txt
+++ b/plugins/codecs/sbc/CMakeLists.txt
@@ -50,7 +50,7 @@ CHECKAPI(
NAME
sbc
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${CODEC_SRC}
${CODEC_HEADERS}
diff --git a/plugins/epan/ethercat/CMakeLists.txt b/plugins/epan/ethercat/CMakeLists.txt
index 7f7a4ebd6a..64dd7c3906 100644
--- a/plugins/epan/ethercat/CMakeLists.txt
+++ b/plugins/epan/ethercat/CMakeLists.txt
@@ -51,7 +51,7 @@ CHECKAPI(
NAME
ethercat
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
diff --git a/plugins/epan/gryphon/CMakeLists.txt b/plugins/epan/gryphon/CMakeLists.txt
index 231cac4612..58101d23bb 100644
--- a/plugins/epan/gryphon/CMakeLists.txt
+++ b/plugins/epan/gryphon/CMakeLists.txt
@@ -45,7 +45,7 @@ CHECKAPI(
NAME
gryphon
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
diff --git a/plugins/epan/irda/CMakeLists.txt b/plugins/epan/irda/CMakeLists.txt
index 18434b47c2..30efc09160 100644
--- a/plugins/epan/irda/CMakeLists.txt
+++ b/plugins/epan/irda/CMakeLists.txt
@@ -47,7 +47,7 @@ CHECKAPI(
NAME
irda
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
diff --git a/plugins/epan/mate/CMakeLists.txt b/plugins/epan/mate/CMakeLists.txt
index 63c524657e..23e583cfbe 100644
--- a/plugins/epan/mate/CMakeLists.txt
+++ b/plugins/epan/mate/CMakeLists.txt
@@ -63,7 +63,6 @@ CHECKAPI(
SWITCHES
--group abort
--group termoutput:1 --summary-group termoutput
- --build
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
diff --git a/plugins/epan/opcua/CMakeLists.txt b/plugins/epan/opcua/CMakeLists.txt
index ee56a43769..42a550d496 100644
--- a/plugins/epan/opcua/CMakeLists.txt
+++ b/plugins/epan/opcua/CMakeLists.txt
@@ -61,7 +61,7 @@ CHECKAPI(
NAME
opcua
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
diff --git a/plugins/epan/pluginifdemo/CMakeLists.txt b/plugins/epan/pluginifdemo/CMakeLists.txt
index 059bece0e1..cd8a9e708c 100644
--- a/plugins/epan/pluginifdemo/CMakeLists.txt
+++ b/plugins/epan/pluginifdemo/CMakeLists.txt
@@ -58,7 +58,7 @@ CHECKAPI(
NAME
pluginifdemo
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
diff --git a/plugins/epan/profinet/CMakeLists.txt b/plugins/epan/profinet/CMakeLists.txt
index b8f6bdd66e..c7200bec80 100644
--- a/plugins/epan/profinet/CMakeLists.txt
+++ b/plugins/epan/profinet/CMakeLists.txt
@@ -59,7 +59,7 @@ CHECKAPI(
NAME
profinet
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
diff --git a/plugins/epan/stats_tree/CMakeLists.txt b/plugins/epan/stats_tree/CMakeLists.txt
index f7fc8e9300..9101efc311 100644
--- a/plugins/epan/stats_tree/CMakeLists.txt
+++ b/plugins/epan/stats_tree/CMakeLists.txt
@@ -34,7 +34,7 @@ CHECKAPI(
NAME
stats_tree
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${PLUGIN_FILES}
${PLUGIN_HEADERS}
diff --git a/plugins/epan/transum/CMakeLists.txt b/plugins/epan/transum/CMakeLists.txt
index 7e6ff02cec..9ae3ffe64b 100644
--- a/plugins/epan/transum/CMakeLists.txt
+++ b/plugins/epan/transum/CMakeLists.txt
@@ -53,7 +53,7 @@ CHECKAPI(
transum
SWITCHES
--group abort
- --group termoutput:1 --summary-group termoutput --build
+ --group termoutput:1 --summary-group termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
diff --git a/plugins/epan/unistim/CMakeLists.txt b/plugins/epan/unistim/CMakeLists.txt
index 19793da354..c0bdd9212b 100644
--- a/plugins/epan/unistim/CMakeLists.txt
+++ b/plugins/epan/unistim/CMakeLists.txt
@@ -45,7 +45,7 @@ CHECKAPI(
NAME
unistim
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
diff --git a/plugins/epan/wimax/CMakeLists.txt b/plugins/epan/wimax/CMakeLists.txt
index fb9dc0f497..a721f8a38c 100644
--- a/plugins/epan/wimax/CMakeLists.txt
+++ b/plugins/epan/wimax/CMakeLists.txt
@@ -92,7 +92,7 @@ CHECKAPI(
NAME
wimax
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
diff --git a/plugins/epan/wimaxasncp/CMakeLists.txt b/plugins/epan/wimaxasncp/CMakeLists.txt
index 71ec0c3ba7..b480d19859 100644
--- a/plugins/epan/wimaxasncp/CMakeLists.txt
+++ b/plugins/epan/wimaxasncp/CMakeLists.txt
@@ -49,7 +49,7 @@ CHECKAPI(
NAME
wimaxasncp
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
diff --git a/plugins/epan/wimaxmacphy/CMakeLists.txt b/plugins/epan/wimaxmacphy/CMakeLists.txt
index c50ed7593f..a993d63871 100644
--- a/plugins/epan/wimaxmacphy/CMakeLists.txt
+++ b/plugins/epan/wimaxmacphy/CMakeLists.txt
@@ -45,7 +45,7 @@ CHECKAPI(
NAME
wimaxmacphy
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
diff --git a/plugins/wiretap/usbdump/CMakeLists.txt b/plugins/wiretap/usbdump/CMakeLists.txt
index a1b7dd59f3..ddcf153172 100644
--- a/plugins/wiretap/usbdump/CMakeLists.txt
+++ b/plugins/wiretap/usbdump/CMakeLists.txt
@@ -48,7 +48,7 @@ CHECKAPI(
NAME
usbdump
SWITCHES
- -g abort -g termoutput -build
+ -g abort -g termoutput
SOURCES
${WIRETAP_SRC}
${WIRETAP_HEADERS}
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index 333d85940c..9e43fd401b 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -9,8 +9,11 @@
# Usage:
# checkAPIs.pl [-M] [-g group1] [-g group2] ...
# [-s summary-group1] [-s summary-group2] ...
+# [--nocheck-hf]
# [--nocheck-value-string-array]
-# [--nocheck-addtext] [--nocheck-hf] [--debug] file1 file2 ...
+# [--nocheck-shadow]
+# [--debug]
+# file1 file2 ...
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
@@ -367,7 +370,7 @@ my @ShadowVariable = (
'system'
);
-sub checkShadowVariable($$$)
+sub check_shadow_variable($$$)
{
my ($groupHashRef, $fileContentsRef, $foundAPIsRef) = @_;
@@ -921,10 +924,12 @@ sub check_try_catch($$)
sub print_usage
{
print "Usage: checkAPIs.pl [-M] [-h] [-g group1[:count]] [-g group2] ... \n";
- print " [--build] [-summary-group group1] [-summary-group group2] ... \n";
+ print " [-summary-group group1] [-summary-group group2] ... \n";
print " [--sourcedir=srcdir] \n";
+ print " [--nocheck-hf]\n";
print " [--nocheck-value-string-array] \n";
- print " [--nocheck-addtext] [--nocheck-hf] [--debug]\n";
+ print " [--nocheck-shadow]\n";
+ print " [--debug]\n";
print " [--file=/path/to/file_list]\n";
print " file1 file2 ...\n";
print "\n";
@@ -936,11 +941,10 @@ sub print_usage
print " Maximum uses can be specified with <group>:<count>\n";
print " -summary-group <group>: Output summary (count) for each API in <group>\n";
print " (-g <group> also req'd)\n";
- print " ---nocheck-value-string-array: UNDOCUMENTED\n";
- print " ---nocheck-addtext: UNDOCUMENTED\n";
- print " ---nocheck-hf: UNDOCUMENTED\n";
- print " ---debug: UNDOCUMENTED\n";
- print " ---build: UNDOCUMENTED\n";
+ print " --nocheck-hf: Skip header field definition checks\n";
+ print " --nocheck-value-string-array: Skip value string array checks\n";
+ print " --nocheck-shadow: Skip shadow variable checks\n";
+ print " --debug: UNDOCUMENTED\n";
print "\n";
print " Default Groups[-g]: ", join (", ", sort @apiGroups), "\n";
print " Available Groups: ", join (", ", sort keys %APIs), "\n";
@@ -1036,12 +1040,11 @@ my $errorCount = 0;
# The default list, which can be expanded.
my @apiSummaryGroups = ();
-my $check_value_string_array= 1; # default: enabled
my $machine_readable_output = 0; # default: disabled
my $check_hf = 1; # default: enabled
-my $check_addtext = 1; # default: enabled
+my $check_value_string_array= 1; # default: enabled
+my $check_shadow = 1; # default: enabled
my $debug_flag = 0; # default: disabled
-my $buildbot_flag = 0;
my $source_dir = "";
my $filenamelist = "";
my $help_flag = 0;
@@ -1050,11 +1053,10 @@ my $pre_commit = 0;
my $result = GetOptions(
'group=s' => \@apiGroups,
'summary-group=s' => \@apiSummaryGroups,
- 'check-value-string-array!' => \$check_value_string_array,
'Machine-readable' => \$machine_readable_output,
'check-hf!' => \$check_hf,
- 'check-addtext!' => \$check_addtext,
- 'build' => \$buildbot_flag,
+ 'check-value-string-array!' => \$check_value_string_array,
+ 'check-shadow!' => \$check_shadow,
'sourcedir=s' => \$source_dir,
'debug' => \$debug_flag,
'pre-commit' => \$pre_commit,
@@ -1221,9 +1223,11 @@ while ($_ = pop @filelist)
# print STDERR "Found APIs with embedded tvb_get_ptr() calls in ".$filename." : ".join(',', @foundAPIs)."\n"
#}
- checkShadowVariable(\@ShadowVariable, \$fileContents, \@foundAPIs);
- if (@foundAPIs) {
- print STDERR "Warning: Found shadow variable(s) in ".$filename." : ".join(',', @foundAPIs)."\n"
+ if ($check_shadow) {
+ check_shadow_variable(\@ShadowVariable, \$fileContents, \@foundAPIs);
+ if (@foundAPIs) {
+ print STDERR "Warning: Found shadow variable(s) in ".$filename." : ".join(',', @foundAPIs)."\n"
+ }
}
diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt
index a159e0afe9..ff0efeae16 100644
--- a/ui/qt/CMakeLists.txt
+++ b/ui/qt/CMakeLists.txt
@@ -40,7 +40,6 @@ set(WIRESHARK_WIDGET_HEADERS
widgets/pref_module_view.h
widgets/packet_list_header.h
widgets/profile_tree_view.h
- widgets/qcustomplot.h
widgets/range_syntax_lineedit.h
widgets/splash_overlay.h
widgets/stock_icon_tool_button.h
@@ -50,6 +49,10 @@ set(WIRESHARK_WIDGET_HEADERS
widgets/wireless_timeline.h
)
+set(WIRESHARK_3RD_PARTY_WIDGET_HEADERS
+ widgets/qcustomplot.h
+)
+
set(WIRESHARK_MANAGER_HEADERS
manager/preference_manager.h
manager/wireshark_preference.h
@@ -277,7 +280,6 @@ set(WIRESHARK_WIDGET_SRCS
widgets/packet_list_header.cpp
widgets/pref_module_view.cpp
widgets/profile_tree_view.cpp
- widgets/qcustomplot.cpp
widgets/range_syntax_lineedit.cpp
widgets/splash_overlay.cpp
widgets/stock_icon_tool_button.cpp
@@ -287,6 +289,10 @@ set(WIRESHARK_WIDGET_SRCS
widgets/wireshark_file_dialog.cpp
)
+set(WIRESHARK_3RD_PARTY_WIDGET_SRCS
+ widgets/qcustomplot.cpp
+)
+
set(WIRESHARK_MANAGER_SRCS
manager/preference_manager.cpp
manager/wireshark_preference.cpp
@@ -681,12 +687,14 @@ add_library(qtui OBJECT
#Included so that Visual Studio can properly put header files in solution
${WIRESHARK_QT_HEADERS}
${WIRESHARK_WIDGET_HEADERS}
+ ${WIRESHARK_3RD_PARTY_WIDGET_HEADERS}
${WIRESHARK_MANAGER_HEADERS}
${WIRESHARK_UTILS_HEADERS}
${WIRESHARK_MODEL_HEADERS}
${WIRESHARK_QT_SRC}
${WIRESHARK_WIDGET_SRCS}
+ ${WIRESHARK_3RD_PARTY_WIDGET_SRCS}
${WIRESHARK_MANAGER_SRCS}
${WIRESHARK_UTILS_SRCS}
${WIRESHARK_MODEL_SRCS}
@@ -722,6 +730,28 @@ set_target_properties(qtui PROPERTIES
AUTOGEN_TARGET_DEPENDS "${WIRESHARK_QT_QM}"
)
+CHECKAPI(
+ NAME
+ ui-qt
+ SWITCHES
+ --nocheck-shadow
+ SOURCES
+ # QCustomPlot (WIRESHARK_3RD_PARTY_WIDGET_{HEADERS,SRCS}) uses
+ # prohibited APIs.
+ ${WIRESHARK_QT_HEADERS}
+ ${WIRESHARK_WIDGET_HEADERS}
+ ${WIRESHARK_MANAGER_HEADERS}
+ ${WIRESHARK_UTILS_HEADERS}
+ ${WIRESHARK_MODEL_HEADERS}
+
+ ${WIRESHARK_QT_SRC}
+ ${WIRESHARK_WIDGET_SRCS}
+ ${WIRESHARK_MANAGER_SRCS}
+ ${WIRESHARK_UTILS_SRCS}
+ ${WIRESHARK_MODEL_SRCS}
+ ${WIRESHARK_QT_TAP_SRC}
+)
+
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp
index 6a275dcf61..489c1d3ccf 100644
--- a/ui/qt/main.cpp
+++ b/ui/qt/main.cpp
@@ -522,7 +522,7 @@ int main(int argc, char *qt_argv[])
if (create_profiles_dir(&rf_path) == -1) {
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
"Could not create profiles directory\n\"%s\": %s.",
- rf_path, strerror(errno));
+ rf_path, g_strerror(errno));
g_free (rf_path);
}
@@ -534,7 +534,7 @@ int main(int argc, char *qt_argv[])
if (!recent_read_static(&rf_path, &rf_open_errno)) {
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
"Could not open common recent file\n\"%s\": %s.",
- rf_path, strerror(rf_open_errno));
+ rf_path, g_strerror(rf_open_errno));
g_free(rf_path);
}
diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp
index 5f33b90d82..e362851e1d 100644
--- a/ui/qt/rtp_audio_stream.cpp
+++ b/ui/qt/rtp_audio_stream.cpp
@@ -662,7 +662,7 @@ void RtpAudioStream::writeSilence(qint64 samples)
qint64 silence_bytes = samples * sample_bytes_;
char *silence_buff = (char *) g_malloc0(silence_bytes);
- RTP_STREAM_DEBUG("Writing %llu silence samples", samples);
+ RTP_STREAM_DEBUG("Writing " G_GUINT64_FORMAT " silence samples", samples);
if (audio_stereo_) {
// Silence for left and right channel
tempfile_->write(silence_buff, silence_bytes);
diff --git a/ui/qt/utils/wireshark_zip_helper.cpp b/ui/qt/utils/wireshark_zip_helper.cpp
index 627aa9d82d..d146f1259c 100644
--- a/ui/qt/utils/wireshark_zip_helper.cpp
+++ b/ui/qt/utils/wireshark_zip_helper.cpp
@@ -127,16 +127,16 @@ bool WiresharkZipHelper::unzip(QString zipFile, QString directory, bool (*fileCh
err = unzOpenCurrentFile(uf);
if (err == UNZ_OK)
{
- char * buf = static_cast<char *>(malloc(IO_BUF_SIZE));
if (file.open(QIODevice::WriteOnly))
{
- while ((err = unzReadCurrentFile(uf, buf, IO_BUF_SIZE)) != UNZ_EOF)
- file.write(buf, err);
+ QByteArray buf;
+ buf.resize(IO_BUF_SIZE);
+ while ((err = unzReadCurrentFile(uf, buf.data(), buf.size())) != UNZ_EOF)
+ file.write(buf.constData(), err);
file.close();
}
unzCloseCurrentFile(uf);
- free(buf);
files++;
}
@@ -215,16 +215,16 @@ void WiresharkZipHelper::addFileToZip(zipFile zf, QString filepath, QString file
if (fh.open(QIODevice::ReadOnly))
{
- char * buf = static_cast<char *>(malloc(IO_BUF_SIZE));
+ QByteArray buf;
+ buf.resize(IO_BUF_SIZE);
while (! fh.atEnd() && err == ZIP_OK)
{
- qint64 bytesIn = fh.read(buf, IO_BUF_SIZE);
- if (bytesIn > 0 && bytesIn <= IO_BUF_SIZE)
+ qint64 bytesIn = fh.read(buf.data(), buf.size());
+ if (bytesIn > 0 && bytesIn <= buf.size())
{
err = zipWriteInFileInZip(zf, buf, (unsigned int) bytesIn);
}
}
- free(buf);
fh.close();
}
diff --git a/wiretap/CMakeLists.txt b/wiretap/CMakeLists.txt
index b32219c7c7..b9d8405a2d 100644
--- a/wiretap/CMakeLists.txt
+++ b/wiretap/CMakeLists.txt
@@ -158,7 +158,6 @@ CHECKAPI(
SWITCHES
--group abort:11 --summary-group abort
--group termoutput:1 --summary-group termoutput
- --build
SOURCES
${WIRETAP_NONGENERATED_FILES}
# LEX files commented out due to use of malloc, free etc.
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt
index 1e1e453e2b..62dd394833 100644
--- a/wsutil/CMakeLists.txt
+++ b/wsutil/CMakeLists.txt
@@ -289,7 +289,7 @@ CHECKAPI(
NAME
wsutil
SWITCHES
- --group termoutput:2 --summary-group termoutput --build
+ --group termoutput:2 --summary-group termoutput
SOURCES
${WSUTIL_COMMON_FILES}
)