aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-05 16:56:14 +0100
committerPierre Ossman <ossman@cendio.se>2023-01-05 16:56:14 +0100
commit27262aeabf3e4d8e29d8f64dbbe48441b80ce387 (patch)
tree67c0e1be485483604ffbcd1fca97e425a9f34886 /vncviewer
parent4701b05b7829f355c7dd4a78f0e194f232872f76 (diff)
parent7a36fb8ca702fdf6548d3a791896a161c94af5b4 (diff)
downloadtigervnc-27262aeabf3e4d8e29d8f64dbbe48441b80ce387.tar.gz
tigervnc-27262aeabf3e4d8e29d8f64dbbe48441b80ce387.zip
Merge branch 'wextra' of https://github.com/CendioOssman/tigervnc
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/CConn.cxx3
-rw-r--r--vncviewer/CMakeLists.txt4
-rw-r--r--vncviewer/DesktopWindow.cxx10
-rw-r--r--vncviewer/DesktopWindow.h9
-rw-r--r--vncviewer/MonitorIndicesParameter.cxx5
-rw-r--r--vncviewer/OptionsDialog.cxx20
-rw-r--r--vncviewer/PlatformPixelBuffer.cxx3
-rw-r--r--vncviewer/ServerDialog.cxx12
-rw-r--r--vncviewer/Surface_Win32.cxx4
-rw-r--r--vncviewer/Viewport.cxx2
-rw-r--r--vncviewer/Win32TouchHandler.cxx5
-rw-r--r--vncviewer/fltk/Fl_Monitor_Arrangement.cxx6
-rw-r--r--vncviewer/parameters.cxx6
-rw-r--r--vncviewer/touch.cxx12
-rw-r--r--vncviewer/vncviewer.cxx6
-rw-r--r--vncviewer/vncviewer.h12
-rw-r--r--vncviewer/win32.c10
17 files changed, 67 insertions, 62 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx
index 045d8f67..da27b848 100644
--- a/vncviewer/CConn.cxx
+++ b/vncviewer/CConn.cxx
@@ -399,7 +399,8 @@ void CConn::framebufferUpdateEnd()
// The rest of the callbacks are fairly self-explanatory...
-void CConn::setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs)
+void CConn::setColourMapEntries(int /*firstColour*/, int /*nColours*/,
+ rdr::U16* /*rgbs*/)
{
vlog.error(_("Invalid SetColourMapEntries from server!"));
}
diff --git a/vncviewer/CMakeLists.txt b/vncviewer/CMakeLists.txt
index 87ab5f47..01b3a89c 100644
--- a/vncviewer/CMakeLists.txt
+++ b/vncviewer/CMakeLists.txt
@@ -1,5 +1,5 @@
-include_directories(${FLTK_INCLUDE_DIR})
-include_directories(${GETTEXT_INCLUDE_DIR})
+include_directories(SYSTEM ${FLTK_INCLUDE_DIR})
+include_directories(SYSTEM ${GETTEXT_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/common)
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index 9b086f4f..70573a28 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -840,6 +840,7 @@ int DesktopWindow::handle(int event)
case FL_ENTER:
if (keyboardGrabbed)
grabPointer();
+ /* fall through */
case FL_LEAVE:
case FL_DRAG:
case FL_MOVE:
@@ -1031,7 +1032,8 @@ void DesktopWindow::fullscreen_on()
}
#if !defined(WIN32) && !defined(__APPLE__)
-Bool eventIsFocusWithSerial(Display *display, XEvent *event, XPointer arg)
+Bool eventIsFocusWithSerial(Display* /*display*/, XEvent *event,
+ XPointer arg)
{
unsigned long serial;
@@ -1270,7 +1272,7 @@ void DesktopWindow::handleResizeTimeout(void *data)
}
-void DesktopWindow::reconfigureFullscreen(void *data)
+void DesktopWindow::reconfigureFullscreen(void* /*data*/)
{
std::set<DesktopWindow *>::iterator iter;
@@ -1495,7 +1497,7 @@ void DesktopWindow::repositionWidgets()
vscroll->value(vscroll->clamp(vscroll->value()));
}
-void DesktopWindow::handleClose(Fl_Widget *wnd, void *data)
+void DesktopWindow::handleClose(Fl_Widget* /*wnd*/, void* /*data*/)
{
disconnect();
}
@@ -1552,7 +1554,7 @@ void DesktopWindow::scrollTo(int x, int y)
damage(FL_DAMAGE_SCROLL);
}
-void DesktopWindow::handleScroll(Fl_Widget *widget, void *data)
+void DesktopWindow::handleScroll(Fl_Widget* /*widget*/, void *data)
{
DesktopWindow *self = (DesktopWindow *)data;
diff --git a/vncviewer/DesktopWindow.h b/vncviewer/DesktopWindow.h
index a654b126..f7721f2e 100644
--- a/vncviewer/DesktopWindow.h
+++ b/vncviewer/DesktopWindow.h
@@ -37,12 +37,6 @@ class Viewport;
class Fl_Scrollbar;
-#ifdef __GNUC__
-# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b)))
-#else
-# define __printf_attr(a, b)
-#endif // __GNUC__
-
class DesktopWindow : public Fl_Window {
public:
@@ -89,7 +83,8 @@ public:
private:
static void menuOverlay(void *data);
- void setOverlay(const char *text, ...) __printf_attr(2, 3);
+ void setOverlay(const char *text, ...)
+ __attribute__((__format__ (__printf__, 2, 3)));
static void updateOverlay(void *data);
static int fltkDispatch(int event, Fl_Window *win);
diff --git a/vncviewer/MonitorIndicesParameter.cxx b/vncviewer/MonitorIndicesParameter.cxx
index 7fabf85b..691a8470 100644
--- a/vncviewer/MonitorIndicesParameter.cxx
+++ b/vncviewer/MonitorIndicesParameter.cxx
@@ -76,9 +76,6 @@ bool MonitorIndicesParameter::setParam(const char* value)
int index;
std::set<int> indices;
- if (strlen(value) < 0)
- return false;
-
if (!parseIndices(value, &indices, true)) {
vlog.error(_("Invalid configuration specified for %s"), name);
return false;
@@ -200,7 +197,7 @@ std::vector<MonitorIndicesParameter::Monitor> MonitorIndicesParameter::fetchMoni
// Start by creating a struct for every monitor.
for (int i = 0; i < Fl::screen_count(); i++) {
- Monitor monitor = {0};
+ Monitor monitor;
bool match;
// Get the properties of the monitor at the current index;
diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx
index f4736a64..d0481708 100644
--- a/vncviewer/OptionsDialog.cxx
+++ b/vncviewer/OptionsDialog.cxx
@@ -295,6 +295,7 @@ void OptionsDialog::loadOptions(void)
case secTypeRA2ne:
case secTypeRAne256:
authVncCheckbox->value(true);
+ /* fall through */
case secTypeDH:
case secTypeMSLogonII:
encNoneCheckbox->value(true);
@@ -1050,7 +1051,7 @@ void OptionsDialog::createMiscPage(int tx, int ty, int tw, int th)
}
-void OptionsDialog::handleAutoselect(Fl_Widget *widget, void *data)
+void OptionsDialog::handleAutoselect(Fl_Widget* /*widget*/, void *data)
{
OptionsDialog *dialog = (OptionsDialog*)data;
@@ -1067,7 +1068,7 @@ void OptionsDialog::handleAutoselect(Fl_Widget *widget, void *data)
}
-void OptionsDialog::handleCompression(Fl_Widget *widget, void *data)
+void OptionsDialog::handleCompression(Fl_Widget* /*widget*/, void *data)
{
OptionsDialog *dialog = (OptionsDialog*)data;
@@ -1078,7 +1079,7 @@ void OptionsDialog::handleCompression(Fl_Widget *widget, void *data)
}
-void OptionsDialog::handleJpeg(Fl_Widget *widget, void *data)
+void OptionsDialog::handleJpeg(Fl_Widget* /*widget*/, void *data)
{
OptionsDialog *dialog = (OptionsDialog*)data;
@@ -1090,7 +1091,7 @@ void OptionsDialog::handleJpeg(Fl_Widget *widget, void *data)
}
-void OptionsDialog::handleX509(Fl_Widget *widget, void *data)
+void OptionsDialog::handleX509(Fl_Widget* /*widget*/, void *data)
{
OptionsDialog *dialog = (OptionsDialog*)data;
@@ -1104,7 +1105,7 @@ void OptionsDialog::handleX509(Fl_Widget *widget, void *data)
}
-void OptionsDialog::handleRSAAES(Fl_Widget *widget, void *data)
+void OptionsDialog::handleRSAAES(Fl_Widget* /*widget*/, void *data)
{
OptionsDialog *dialog = (OptionsDialog*)data;
@@ -1115,8 +1116,9 @@ void OptionsDialog::handleRSAAES(Fl_Widget *widget, void *data)
}
-void OptionsDialog::handleClipboard(Fl_Widget *widget, void *data)
+void OptionsDialog::handleClipboard(Fl_Widget* /*widget*/, void *data)
{
+ (void)data;
#if !defined(WIN32) && !defined(__APPLE__)
OptionsDialog *dialog = (OptionsDialog*)data;
@@ -1131,7 +1133,7 @@ void OptionsDialog::handleClipboard(Fl_Widget *widget, void *data)
#endif
}
-void OptionsDialog::handleFullScreenMode(Fl_Widget *widget, void *data)
+void OptionsDialog::handleFullScreenMode(Fl_Widget* /*widget*/, void *data)
{
OptionsDialog *dialog = (OptionsDialog*)data;
@@ -1142,7 +1144,7 @@ void OptionsDialog::handleFullScreenMode(Fl_Widget *widget, void *data)
}
}
-void OptionsDialog::handleCancel(Fl_Widget *widget, void *data)
+void OptionsDialog::handleCancel(Fl_Widget* /*widget*/, void *data)
{
OptionsDialog *dialog = (OptionsDialog*)data;
@@ -1150,7 +1152,7 @@ void OptionsDialog::handleCancel(Fl_Widget *widget, void *data)
}
-void OptionsDialog::handleOK(Fl_Widget *widget, void *data)
+void OptionsDialog::handleOK(Fl_Widget* /*widget*/, void *data)
{
OptionsDialog *dialog = (OptionsDialog*)data;
diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx
index e551651d..b37e47a5 100644
--- a/vncviewer/PlatformPixelBuffer.cxx
+++ b/vncviewer/PlatformPixelBuffer.cxx
@@ -135,7 +135,8 @@ rfb::Rect PlatformPixelBuffer::getDamage(void)
static bool caughtError;
-static int XShmAttachErrorHandler(Display *dpy, XErrorEvent *error)
+static int XShmAttachErrorHandler(Display* /*dpy*/,
+ XErrorEvent* /*error*/)
{
caughtError = true;
return 0;
diff --git a/vncviewer/ServerDialog.cxx b/vncviewer/ServerDialog.cxx
index 54c34b4f..6a4dcfc9 100644
--- a/vncviewer/ServerDialog.cxx
+++ b/vncviewer/ServerDialog.cxx
@@ -157,13 +157,13 @@ void ServerDialog::run(const char* servername, char *newservername)
newservername[VNCSERVERNAMELEN - 1] = '\0';
}
-void ServerDialog::handleOptions(Fl_Widget *widget, void *data)
+void ServerDialog::handleOptions(Fl_Widget* /*widget*/, void* /*data*/)
{
OptionsDialog::showDialog();
}
-void ServerDialog::handleLoad(Fl_Widget *widget, void *data)
+void ServerDialog::handleLoad(Fl_Widget* /*widget*/, void* data)
{
ServerDialog *dialog = (ServerDialog*)data;
@@ -201,7 +201,7 @@ void ServerDialog::handleLoad(Fl_Widget *widget, void *data)
}
-void ServerDialog::handleSaveAs(Fl_Widget *widget, void *data)
+void ServerDialog::handleSaveAs(Fl_Widget* /*widget*/, void* data)
{
ServerDialog *dialog = (ServerDialog*)data;
const char* servername = dialog->serverName->value();
@@ -261,13 +261,13 @@ void ServerDialog::handleSaveAs(Fl_Widget *widget, void *data)
}
-void ServerDialog::handleAbout(Fl_Widget *widget, void *data)
+void ServerDialog::handleAbout(Fl_Widget* /*widget*/, void* /*data*/)
{
about_vncviewer();
}
-void ServerDialog::handleCancel(Fl_Widget *widget, void *data)
+void ServerDialog::handleCancel(Fl_Widget* /*widget*/, void* data)
{
ServerDialog *dialog = (ServerDialog*)data;
@@ -276,7 +276,7 @@ void ServerDialog::handleCancel(Fl_Widget *widget, void *data)
}
-void ServerDialog::handleConnect(Fl_Widget *widget, void *data)
+void ServerDialog::handleConnect(Fl_Widget* /*widget*/, void *data)
{
ServerDialog *dialog = (ServerDialog*)data;
const char* servername = dialog->serverName->value();
diff --git a/vncviewer/Surface_Win32.cxx b/vncviewer/Surface_Win32.cxx
index 39692452..d438fa12 100644
--- a/vncviewer/Surface_Win32.cxx
+++ b/vncviewer/Surface_Win32.cxx
@@ -93,7 +93,9 @@ void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int
DeleteDC(dstdc);
}
-void Surface::blend(int src_x, int src_y, int x, int y, int w, int h, int a)
+void Surface::blend(int /*src_x*/, int /*src_y*/,
+ int /*x*/, int /*y*/, int /*w*/, int /*h*/,
+ int /*a*/)
{
// Compositing doesn't work properly for window DC:s
assert(false);
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index 6d970f12..89d1a097 100644
--- a/vncviewer/Viewport.cxx
+++ b/vncviewer/Viewport.cxx
@@ -114,7 +114,7 @@ enum { ID_DISCONNECT, ID_FULLSCREEN, ID_MINIMIZE, ID_RESIZE,
static const WORD SCAN_FAKE = 0xaa;
#endif
-Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_)
+Viewport::Viewport(int w, int h, const rfb::PixelFormat& /*serverPF*/, CConn* cc_)
: Fl_Widget(0, 0, w, h), cc(cc_), frameBuffer(NULL),
lastPointerPos(0, 0), lastButtonMask(0),
#ifdef WIN32
diff --git a/vncviewer/Win32TouchHandler.cxx b/vncviewer/Win32TouchHandler.cxx
index dccf10a8..d6dc7aa4 100644
--- a/vncviewer/Win32TouchHandler.cxx
+++ b/vncviewer/Win32TouchHandler.cxx
@@ -59,7 +59,8 @@ Win32TouchHandler::Win32TouchHandler(HWND hWnd) :
supportedTouches);
}
-bool Win32TouchHandler::processEvent(UINT Msg, WPARAM wParam, LPARAM lParam)
+bool Win32TouchHandler::processEvent(UINT Msg, WPARAM /*wParam*/,
+ LPARAM lParam)
{
GESTUREINFO gi;
@@ -386,7 +387,7 @@ void Win32TouchHandler::fakeButtonEvent(bool press, int button,
}
void Win32TouchHandler::fakeKeyEvent(bool press, int keysym,
- const GestureEvent origEvent)
+ const GestureEvent /*origEvent*/)
{
UINT Msg = press ? WM_KEYDOWN : WM_KEYUP;
WPARAM wParam;
diff --git a/vncviewer/fltk/Fl_Monitor_Arrangement.cxx b/vncviewer/fltk/Fl_Monitor_Arrangement.cxx
index ce61b1e7..3dddd801 100644
--- a/vncviewer/fltk/Fl_Monitor_Arrangement.cxx
+++ b/vncviewer/fltk/Fl_Monitor_Arrangement.cxx
@@ -362,7 +362,8 @@ std::string Fl_Monitor_Arrangement::description(int m)
#if defined(WIN32)
static BOOL CALLBACK EnumDisplayMonitorsCallback(
- HMONITOR monitor, HDC deviceContext, LPRECT rect, LPARAM userData)
+ HMONITOR monitor, HDC /*deviceContext*/, LPRECT /*rect*/,
+ LPARAM userData)
{
std::set<HMONITOR>* sys_monitors = (std::set<HMONITOR>*)userData;
sys_monitors->insert(monitor);
@@ -549,7 +550,8 @@ int Fl_Monitor_Arrangement::fltk_event_handler(int event)
return 0;
}
-void Fl_Monitor_Arrangement::monitor_pressed(Fl_Widget *widget, void *user_data)
+void Fl_Monitor_Arrangement::monitor_pressed(Fl_Widget* /*widget*/,
+ void *user_data)
{
Fl_Monitor_Arrangement *self = (Fl_Monitor_Arrangement *) user_data;
diff --git a/vncviewer/parameters.cxx b/vncviewer/parameters.cxx
index 0912b461..173406d5 100644
--- a/vncviewer/parameters.cxx
+++ b/vncviewer/parameters.cxx
@@ -682,7 +682,7 @@ void saveViewerParameters(const char *filename, const char *servername) {
static bool findAndSetViewerParameterFromValue(
VoidParameter* parameters[], size_t parameters_len,
- char* value, char* line, char* filepath)
+ char* value, char* line)
{
const size_t buffersize = 256;
char decodingBuffer[buffersize];
@@ -821,11 +821,11 @@ char* loadViewerParameters(const char *filename) {
} else {
invalidParameterName = findAndSetViewerParameterFromValue(parameterArray, sizeof(parameterArray),
- value, line, filepath);
+ value, line);
if (invalidParameterName) {
invalidParameterName = findAndSetViewerParameterFromValue(readOnlyParameterArray, sizeof(readOnlyParameterArray),
- value, line, filepath);
+ value, line);
}
}
} catch(Exception& e) {
diff --git a/vncviewer/touch.cxx b/vncviewer/touch.cxx
index 5ba9d108..d4f4098a 100644
--- a/vncviewer/touch.cxx
+++ b/vncviewer/touch.cxx
@@ -61,8 +61,9 @@ static HandlerMap handlers;
#if defined(WIN32)
LRESULT CALLBACK win32WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam,
- LPARAM lParam, UINT_PTR uIdSubclass,
- DWORD_PTR dwRefData)
+ LPARAM lParam,
+ UINT_PTR /*uIdSubclass*/,
+ DWORD_PTR /*dwRefData*/)
{
bool handled = false;
@@ -168,7 +169,7 @@ void x11_ungrab_pointer(Window window)
}
#endif
-static int handleTouchEvent(void *event, void *data)
+static int handleTouchEvent(void *event, void* /*data*/)
{
#if defined(WIN32)
MSG *msg = (MSG*)event;
@@ -189,7 +190,10 @@ static int handleTouchEvent(void *event, void *data)
(int)GetLastError());
}
}
-#elif !defined(__APPLE__)
+#elif defined(__APPLE__)
+ // No touch support on macOS
+ (void)event;
+#else
XEvent *xevent = (XEvent*)event;
if (xevent->type == MapNotify) {
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx
index a7e99ffb..529f2f30 100644
--- a/vncviewer/vncviewer.cxx
+++ b/vncviewer/vncviewer.cxx
@@ -184,7 +184,7 @@ static void mainloop(const char* vncserver, network::Socket* sock)
exitMainloop = false;
- cc = new CConn(vncServerName, sock);
+ cc = new CConn(vncserver, sock);
while (!exitMainloop) {
int next_timer;
@@ -232,12 +232,12 @@ static void mainloop(const char* vncserver, network::Socket* sock)
}
#ifdef __APPLE__
-static void about_callback(Fl_Widget *widget, void *data)
+static void about_callback(Fl_Widget* /*widget*/, void* /*data*/)
{
about_vncviewer();
}
-static void new_connection_cb(Fl_Widget *widget, void *data)
+static void new_connection_cb(Fl_Widget* /*widget*/, void* /*data*/)
{
const char *argv[2];
pid_t pid;
diff --git a/vncviewer/vncviewer.h b/vncviewer/vncviewer.h
index 199e2e2c..f39a5776 100644
--- a/vncviewer/vncviewer.h
+++ b/vncviewer/vncviewer.h
@@ -21,18 +21,14 @@
#define VNCSERVERNAMELEN 256
-#ifdef __GNUC__
-# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b)))
-#else
-# define __printf_attr(a, b)
-#endif // __GNUC__
-
namespace rdr {
struct Exception;
};
-void abort_vncviewer(const char *error, ...) __printf_attr(1, 2);
-void abort_connection(const char *error, ...) __printf_attr(1, 2);
+void abort_vncviewer(const char *error, ...)
+ __attribute__((__format__ (__printf__, 1, 2)));
+void abort_connection(const char *error, ...)
+ __attribute__((__format__ (__printf__, 1, 2)));
void abort_connection_with_unexpected_error(const rdr::Exception &);
void disconnect();
diff --git a/vncviewer/win32.c b/vncviewer/win32.c
index c4a68b67..77366f96 100644
--- a/vncviewer/win32.c
+++ b/vncviewer/win32.c
@@ -59,11 +59,13 @@ static int is_system_hotkey(int vkCode) {
case VK_TAB:
if (GetAsyncKeyState(VK_MENU) & 0x8000)
return 1;
+ break;
case VK_ESCAPE:
if (GetAsyncKeyState(VK_MENU) & 0x8000)
return 1;
if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
return 1;
+ break;
}
return 0;
}
@@ -140,7 +142,7 @@ void win32_disable_lowlevel_keyboard(HWND hwnd)
}
// Layout independent keys
-static const int vkey_map[][3] = {
+static const UINT vkey_map[][3] = {
{ VK_CANCEL, NoSymbol, XK_Break },
{ VK_BACK, XK_BackSpace, NoSymbol },
{ VK_TAB, XK_Tab, NoSymbol },
@@ -231,7 +233,7 @@ static const int vkey_map[][3] = {
// Layout dependent keys, but without useful symbols
// Japanese
-static const int vkey_map_jp[][3] = {
+static const UINT vkey_map_jp[][3] = {
{ VK_KANA, XK_Hiragana_Katakana, NoSymbol },
{ VK_KANJI, XK_Kanji, NoSymbol },
{ VK_OEM_ATTN, XK_Eisu_toggle, NoSymbol },
@@ -246,12 +248,12 @@ static const int vkey_map_jp[][3] = {
};
// Korean
-static const int vkey_map_ko[][3] = {
+static const UINT vkey_map_ko[][3] = {
{ VK_HANGUL, XK_Hangul, NoSymbol },
{ VK_HANJA, XK_Hangul_Hanja, NoSymbol },
};
-static int lookup_vkey_map(UINT vkey, int extended, const int map[][3], size_t size)
+static int lookup_vkey_map(UINT vkey, int extended, const UINT map[][3], size_t size)
{
size_t i;