summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Bloice <graham.bloice@trihedral.com>2014-08-20 13:31:19 +0100
committerEvan Huus <eapache@gmail.com>2014-08-20 19:25:28 +0000
commit4ac0438e46f80fb70f4be05e0a45dd08fe74fe8d (patch)
tree4e05d5d6accb8d0173c6bc3de19128e21537a710
parent8fc0ee4c899e5eee8d84cafdd31c58c94eec6a8f (diff)
downloadwireshark-4ac0438e46f80fb70f4be05e0a45dd08fe74fe8d.tar.gz
In Visual Studio builds, enable the L4 warning
4189: Local variable is initialized but not referenced Fix some variables found by this Change-Id: Icc13def5413f1fe885ec25e659462c8906a6cfa0 Reviewed-on: https://code.wireshark.org/review/3748 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
-rw-r--r--CMakeLists.txt3
-rw-r--r--config.nmake3
-rw-r--r--ui/win32/file_dlg_win32.c2
-rw-r--r--ui/win32/print_win32.c2
4 files changed, 4 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2fa57e095c..a928f69f91 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -181,7 +181,8 @@ if( CMAKE_C_COMPILER_ID MATCHES "MSVC")
# Additional compiler warnings to be treated as "Level 3"
# when compiling Wireshark sources. (Selected from "level 4" warnings).
## 4295: array is too small to include a terminating null character
- set(WARNINGS_CFLAGS "/w34295")
+ ## 4189: local variable is initialized but not referenced
+ set(WARNINGS_CFLAGS "/w34295 /w34189")
# FIXME: WINPCAP_VERSION cannot be determined from source or executable.
set(WINPCAP_VERSION "unknown")
diff --git a/config.nmake b/config.nmake
index 8626bbde83..f9968168e4 100644
--- a/config.nmake
+++ b/config.nmake
@@ -1031,7 +1031,8 @@ LOCAL_CFLAGS=$(LOCAL_CFLAGS) /D_BIND_TO_CURRENT_CRT_VERSION=1
# Additional compiler warnings to be treated as "Level 3"
# when compiling Wireshark sources. (Selected from "level 4" warnings).
## 4295: array is too small to include a terminating null character
-WARNINGS_CFLAGS=/w34295
+## 4189: local variable is initialized but not referenced
+WARNINGS_CFLAGS=/w34295 /w34189
!ELSE
!ERROR MSVC_VARIANT unknown
diff --git a/ui/win32/file_dlg_win32.c b/ui/win32/file_dlg_win32.c
index a65aaf4d0f..c66b0f4537 100644
--- a/ui/win32/file_dlg_win32.c
+++ b/ui/win32/file_dlg_win32.c
@@ -355,7 +355,6 @@ win32_save_as_file(HWND h_wnd, capture_file *cf, GString *file_name, int *file_t
TCHAR file_name16[MAX_PATH] = _T("");
int ofnsize;
gboolean gsfn_ok;
- gboolean discard_comments = FALSE;
if (!file_name || !file_type || !compressed)
return FALSE;
@@ -1113,7 +1112,6 @@ static gboolean
preview_set_file_info(HWND of_hwnd, gchar *preview_file) {
HWND cur_ctrl;
int i;
- gboolean enable = FALSE;
wtap *wth;
const struct wtap_pkthdr *phdr;
int err = 0;
diff --git a/ui/win32/print_win32.c b/ui/win32/print_win32.c
index a8f5b7d989..aeb4de0fae 100644
--- a/ui/win32/print_win32.c
+++ b/ui/win32/print_win32.c
@@ -62,8 +62,6 @@ void print_mswin(const char *file_name)
DOCINFO di;
short int width, height;
- HWND hWndParent = HWND_DESKTOP; /* would be better to be a real window */
-
/* Need a printer DC to print to. */
hDC = get_printer_dc(&width, &height);