@@ -73,12 +73,12 @@ ENDIF() | |||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") | |||
# Tell the compiler to be stringent | |||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat=2") | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wformat=2") | |||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wvla") | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat=2 -Wvla") | |||
# Make sure we catch these issues whilst developing | |||
IF(CMAKE_BUILD_TYPE MATCHES Debug) | |||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=vla") | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Werror=vla") | |||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") | |||
ENDIF() | |||
# clang doesn't support format_arg, which breaks this warning | |||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
@@ -3,7 +3,6 @@ include_directories(${CMAKE_SOURCE_DIR}/common) | |||
add_library(os STATIC | |||
Mutex.cxx | |||
Thread.cxx | |||
w32tiger.c | |||
os.cxx) | |||
if(UNIX) |
@@ -19,8 +19,6 @@ | |||
#ifndef OS_OS_H | |||
#define OS_OS_H | |||
#include <os/w32tiger.h> | |||
/* | |||
* Get VNC home directory ($HOME/.vnc or %APPDATA%/vnc/). | |||
* If HOME environment variable is set then it is used. |
@@ -1,33 +0,0 @@ | |||
/* Copyright (C) 2011 TigerVNC Team. All Rights Reserved. | |||
* | |||
* This is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This software is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this software; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |||
* USA. | |||
*/ | |||
#ifdef HAVE_CONFIG_H | |||
#include <config.h> | |||
#endif | |||
#ifdef WIN32 | |||
#define INITGUID | |||
#include <basetyps.h> | |||
#ifndef HAVE_ACTIVE_DESKTOP_L | |||
DEFINE_GUID(CLSID_ActiveDesktop,0x75048700L,0xEF1F,0x11D0,0x98,0x88,0x00,0x60,0x97,0xDE,0xAC,0xF9); | |||
DEFINE_GUID(IID_IActiveDesktop,0xF490EB00L,0x1240,0x11D1,0x98,0x88,0x00,0x60,0x97,0xDE,0xAC,0xF9); | |||
#endif | |||
#endif /* WIN32 */ |
@@ -1,187 +0,0 @@ | |||
/* Copyright (C) 2011 TigerVNC Team. All Rights Reserved. | |||
* | |||
* This is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This software is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this software; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |||
* USA. | |||
*/ | |||
#ifndef OS_W32TIGER_H | |||
#define OS_W32TIGER_H | |||
#ifdef WIN32 | |||
#include <windows.h> | |||
#include <wininet.h> | |||
#include <shlobj.h> | |||
#include <shlguid.h> | |||
#include <wininet.h> | |||
/* Windows has different names for these */ | |||
#define strcasecmp _stricmp | |||
#define strncasecmp _strnicmp | |||
/* MSLLHOOKSTRUCT structure*/ | |||
#ifndef LLMHF_INJECTED | |||
#define LLMHF_INJECTED 0x00000001 | |||
#endif | |||
/* IActiveDesktop. As of 2011-10-12, MinGW does not define | |||
IActiveDesktop in any way (see tracker 2877129), while MinGW64 is | |||
broken: has the headers but not the lib symbols. */ | |||
#ifndef HAVE_ACTIVE_DESKTOP_H | |||
extern const GUID CLSID_ActiveDesktop; | |||
extern const GUID IID_IActiveDesktop; | |||
/* IActiveDesktop::AddUrl */ | |||
#define ADDURL_SILENT 0x0001 | |||
/* IActiveDesktop::AddDesktopItemWithUI */ | |||
#define DTI_ADDUI_DEFAULT 0x00000000 | |||
#define DTI_ADDUI_DISPSUBWIZARD 0x00000001 | |||
#define DTI_ADDUI_POSITIONITEM 0x00000002 | |||
/* IActiveDesktop::ModifyDesktopItem */ | |||
#define COMP_ELEM_TYPE 0x00000001 | |||
#define COMP_ELEM_CHECKED 0x00000002 | |||
#define COMP_ELEM_DIRTY 0x00000004 | |||
#define COMP_ELEM_NOSCROLL 0x00000008 | |||
#define COMP_ELEM_POS_LEFT 0x00000010 | |||
#define COMP_ELEM_POS_TOP 0x00000020 | |||
#define COMP_ELEM_SIZE_WIDTH 0x00000040 | |||
#define COMP_ELEM_SIZE_HEIGHT 0x00000080 | |||
#define COMP_ELEM_POS_ZINDEX 0x00000100 | |||
#define COMP_ELEM_SOURCE 0x00000200 | |||
#define COMP_ELEM_FRIENDLYNAME 0x00000400 | |||
#define COMP_ELEM_SUBSCRIBEDURL 0x00000800 | |||
#define COMP_ELEM_ORIGINAL_CSI 0x00001000 | |||
#define COMP_ELEM_RESTORED_CSI 0x00002000 | |||
#define COMP_ELEM_CURITEMSTATE 0x00004000 | |||
#define COMP_ELEM_ALL 0x00007FFF /* OR-ed all COMP_ELEM_ */ | |||
/* IActiveDesktop::GetWallpaper */ | |||
#define AD_GETWP_BMP 0x00000000 | |||
#define AD_GETWP_IMAGE 0x00000001 | |||
#define AD_GETWP_LAST_APPLIED 0x00000002 | |||
/* IActiveDesktop::ApplyChanges */ | |||
#define AD_APPLY_SAVE 0x00000001 | |||
#define AD_APPLY_HTMLGEN 0x00000002 | |||
#define AD_APPLY_REFRESH 0x00000004 | |||
#define AD_APPLY_ALL 0x00000007 /* OR-ed three AD_APPLY_ above */ | |||
#define AD_APPLY_FORCE 0x00000008 | |||
#define AD_APPLY_BUFFERED_REFRESH 0x00000010 | |||
#define AD_APPLY_DYNAMICREFRESH 0x00000020 | |||
/* Structures for IActiveDesktop */ | |||
typedef struct { | |||
DWORD dwSize; | |||
int iLeft; | |||
int iTop; | |||
DWORD dwWidth; | |||
DWORD dwHeight; | |||
DWORD dwItemState; | |||
} COMPSTATEINFO, *LPCOMPSTATEINFO; | |||
typedef const COMPSTATEINFO *LPCCOMPSTATEINFO; | |||
typedef struct { | |||
DWORD dwSize; | |||
int iLeft; | |||
int iTop; | |||
DWORD dwWidth; | |||
DWORD dwHeight; | |||
int izIndex; | |||
BOOL fCanResize; | |||
BOOL fCanResizeX; | |||
BOOL fCanResizeY; | |||
int iPreferredLeftPercent; | |||
int iPreferredTopPercent; | |||
} COMPPOS, *LPCOMPPOS; | |||
typedef const COMPPOS *LPCCOMPPOS; | |||
typedef struct { | |||
DWORD dwSize; | |||
DWORD dwID; | |||
int iComponentType; | |||
BOOL fChecked; | |||
BOOL fDirty; | |||
BOOL fNoScroll; | |||
COMPPOS cpPos; | |||
WCHAR wszFriendlyName[MAX_PATH]; | |||
WCHAR wszSource[INTERNET_MAX_URL_LENGTH]; | |||
WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; | |||
DWORD dwCurItemState; | |||
COMPSTATEINFO csiOriginal; | |||
COMPSTATEINFO csiRestored; | |||
} COMPONENT, *LPCOMPONENT; | |||
typedef const COMPONENT *LPCCOMPONENT; | |||
typedef struct { | |||
DWORD dwSize; | |||
BOOL fEnableComponents; | |||
BOOL fActiveDesktop; | |||
} COMPONENTSOPT, *LPCOMPONENTSOPT; | |||
typedef const COMPONENTSOPT *LPCCOMPONENTSOPT; | |||
typedef struct { | |||
DWORD dwSize; | |||
DWORD dwStyle; | |||
} WALLPAPEROPT, *LPWALLPAPEROPT; | |||
typedef const WALLPAPEROPT *LPCWALLPAPEROPT; | |||
/* WALLPAPEROPT styles */ | |||
#define WPSTYLE_CENTER 0x0 | |||
#define WPSTYLE_TILE 0x1 | |||
#define WPSTYLE_STRETCH 0x2 | |||
#define WPSTYLE_MAX 0x3 | |||
/* Those two are defined in Windows 7 and newer, we don't need them now */ | |||
#if 0 | |||
#define WPSTYLE_KEEPASPECT 0x3 | |||
#define WPSTYLE_CROPTOFIT 0x4 | |||
#endif | |||
#define INTERFACE IActiveDesktop | |||
DECLARE_INTERFACE_(IActiveDesktop, IUnknown) | |||
{ | |||
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; | |||
STDMETHOD_(ULONG,AddRef)(THIS) PURE; | |||
STDMETHOD_(ULONG,Release)(THIS) PURE; | |||
STDMETHOD(AddDesktopItem)(THIS_ LPCOMPONENT,DWORD) PURE; | |||
STDMETHOD(AddDesktopItemWithUI)(THIS_ HWND,LPCOMPONENT,DWORD) PURE; | |||
STDMETHOD(AddUrl)(THIS_ HWND,LPCWSTR,LPCOMPONENT,DWORD) PURE; | |||
STDMETHOD(ApplyChanges)(THIS_ DWORD) PURE; | |||
STDMETHOD(GenerateDesktopItemHtml)(THIS_ LPCWSTR,LPCOMPONENT,DWORD) PURE; | |||
STDMETHOD(GetDesktopItem)(THIS_ int,LPCOMPONENT,DWORD) PURE; | |||
STDMETHOD(GetDesktopItemByID)(THIS_ DWORD,LPCOMPONENT,DWORD) PURE; | |||
STDMETHOD(GetDesktopItemBySource)(THIS_ LPCWSTR,LPCOMPONENT,DWORD) PURE; | |||
STDMETHOD(GetDesktopItemCount)(THIS_ LPINT,DWORD) PURE; | |||
STDMETHOD(GetDesktopItemOptions)(THIS_ LPCOMPONENTSOPT,DWORD) PURE; | |||
STDMETHOD(GetPattern)(THIS_ LPWSTR,UINT,DWORD) PURE; | |||
STDMETHOD(GetWallpaper)(THIS_ LPWSTR,UINT,DWORD) PURE; | |||
STDMETHOD(GetWallpaperOptions)(THIS_ LPWALLPAPEROPT,DWORD) PURE; | |||
STDMETHOD(ModifyDesktopItem)(THIS_ LPCCOMPONENT,DWORD) PURE; | |||
STDMETHOD(RemoveDesktopItem)(THIS_ LPCCOMPONENT,DWORD) PURE; | |||
STDMETHOD(SetDesktopItemOptions)(THIS_ LPCCOMPONENTSOPT,DWORD) PURE; | |||
STDMETHOD(SetPattern)(THIS_ LPCWSTR,DWORD) PURE; | |||
STDMETHOD(SetWallpaper)(THIS_ LPCWSTR,DWORD) PURE; | |||
STDMETHOD(SetWallpaperOptions)(THIS_ LPCWALLPAPEROPT,DWORD) PURE; | |||
}; | |||
#undef INTERFACE | |||
#endif /* HAVE_ACTIVE_DESKTOP_H */ | |||
#endif /* WIN32 */ | |||
#endif /* OS_W32TIGER_H */ |
@@ -1,5 +1,5 @@ | |||
include_directories(${CMAKE_SOURCE_DIR}/common) | |||
include_directories(${ZLIB_INCLUDE_DIRS}) | |||
include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS}) | |||
add_library(rdr STATIC | |||
AESInStream.cxx | |||
@@ -22,11 +22,11 @@ add_library(rdr STATIC | |||
target_link_libraries(rdr ${ZLIB_LIBRARIES} os) | |||
if(GNUTLS_FOUND) | |||
include_directories(${GNUTLS_INCLUDE_DIR}) | |||
include_directories(SYSTEM ${GNUTLS_INCLUDE_DIR}) | |||
target_link_libraries(rdr ${GNUTLS_LIBRARIES}) | |||
endif() | |||
if (NETTLE_FOUND) | |||
include_directories(${NETTLE_INCLUDE_DIRS}) | |||
include_directories(SYSTEM ${NETTLE_INCLUDE_DIRS}) | |||
target_link_libraries(rdr ${NETTLE_LIBRARIES}) | |||
target_link_directories(rdr PUBLIC ${NETTLE_LIBRARY_DIRS}) | |||
endif() |
@@ -21,18 +21,13 @@ | |||
#ifndef __RDR_EXCEPTION_H__ | |||
#define __RDR_EXCEPTION_H__ | |||
#ifdef __GNUC__ | |||
# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b))) | |||
#else | |||
# define __printf_attr(a, b) | |||
#endif // __GNUC__ | |||
namespace rdr { | |||
struct Exception { | |||
enum { len = 256 }; | |||
char str_[len]; | |||
Exception(const char *format = 0, ...) __printf_attr(2, 3); | |||
Exception(const char *format = 0, ...) | |||
__attribute__((__format__ (__printf__, 2, 3))); | |||
virtual ~Exception() {} | |||
virtual const char* str() const { return str_; } | |||
}; |
@@ -59,7 +59,7 @@ namespace rdr { | |||
private: | |||
bool overrun(size_t needed) { throw EndOfStream(); } | |||
bool overrun(size_t /*needed*/) { throw EndOfStream(); } | |||
const U8* start; | |||
bool deleteWhenDone; | |||
}; |
@@ -581,7 +581,7 @@ void CConnection::handleClipboardRequest(rdr::U32 flags) | |||
handleClipboardRequest(); | |||
} | |||
void CConnection::handleClipboardPeek(rdr::U32 flags) | |||
void CConnection::handleClipboardPeek() | |||
{ | |||
if (server.clipboardFlags() & rfb::clipboardNotify) | |||
writer()->writeClipboardNotify(hasLocalClipboard ? rfb::clipboardUTF8 : 0); | |||
@@ -635,11 +635,11 @@ void CConnection::handleClipboardRequest() | |||
{ | |||
} | |||
void CConnection::handleClipboardAnnounce(bool available) | |||
void CConnection::handleClipboardAnnounce(bool /*available*/) | |||
{ | |||
} | |||
void CConnection::handleClipboardData(const char* data) | |||
void CConnection::handleClipboardData(const char* /*data*/) | |||
{ | |||
} | |||
@@ -119,7 +119,7 @@ namespace rfb { | |||
virtual void handleClipboardCaps(rdr::U32 flags, | |||
const rdr::U32* lengths); | |||
virtual void handleClipboardRequest(rdr::U32 flags); | |||
virtual void handleClipboardPeek(rdr::U32 flags); | |||
virtual void handleClipboardPeek(); | |||
virtual void handleClipboardNotify(rdr::U32 flags); | |||
virtual void handleClipboardProvide(rdr::U32 flags, | |||
const size_t* lengths, |
@@ -1,6 +1,6 @@ | |||
include_directories(${CMAKE_SOURCE_DIR}/common) | |||
include_directories(${JPEG_INCLUDE_DIR}) | |||
include_directories(${PIXMAN_INCLUDE_DIRS}) | |||
include_directories(SYSTEM ${JPEG_INCLUDE_DIR}) | |||
include_directories(SYSTEM ${PIXMAN_INCLUDE_DIRS}) | |||
add_library(rfb STATIC | |||
Blacklist.cxx | |||
@@ -77,7 +77,7 @@ if(ENABLE_H264 AND NOT H264_LIBS STREQUAL "NONE") | |||
elseif(H264_LIBS STREQUAL "WIN") | |||
target_sources(rfb PRIVATE H264WinDecoderContext.cxx) | |||
endif() | |||
include_directories(${H264_INCLUDE_DIRS}) | |||
include_directories(SYSTEM ${H264_INCLUDE_DIRS}) | |||
target_link_libraries(rfb ${H264_LIBRARIES}) | |||
target_link_directories(rfb PUBLIC ${H264_LIBRARY_DIRS}) | |||
endif() | |||
@@ -98,14 +98,14 @@ endif() | |||
if(GNUTLS_FOUND) | |||
target_sources(rfb PRIVATE CSecurityTLS.cxx SSecurityTLS.cxx) | |||
include_directories(${GNUTLS_INCLUDE_DIR}) | |||
include_directories(SYSTEM ${GNUTLS_INCLUDE_DIR}) | |||
target_link_libraries(rfb ${GNUTLS_LIBRARIES}) | |||
endif() | |||
if (NETTLE_FOUND) | |||
target_sources(rfb PRIVATE CSecurityDH.cxx CSecurityMSLogonII.cxx | |||
CSecurityRSAAES.cxx SSecurityRSAAES.cxx) | |||
include_directories(${NETTLE_INCLUDE_DIRS} ${GMP_INCLUDE_DIRS}) | |||
include_directories(SYSTEM ${NETTLE_INCLUDE_DIRS} ${GMP_INCLUDE_DIRS}) | |||
target_link_libraries(rfb ${HOGWEED_LIBRARIES} | |||
${NETTLE_LIBRARIES} ${GMP_LIBRARIES}) | |||
target_link_directories(rfb PUBLIC ${HOGWEED_LIBRARY_DIRS} |
@@ -68,7 +68,8 @@ void CMsgHandler::setName(const char* name) | |||
server.setName(name); | |||
} | |||
void CMsgHandler::fence(rdr::U32 flags, unsigned len, const char data[]) | |||
void CMsgHandler::fence(rdr::U32 /*flags*/, unsigned /*len*/, | |||
const char /*data*/ []) | |||
{ | |||
server.supportsFence = true; | |||
} | |||
@@ -150,20 +151,20 @@ void CMsgHandler::handleClipboardCaps(rdr::U32 flags, const rdr::U32* lengths) | |||
server.setClipboardCaps(flags, lengths); | |||
} | |||
void CMsgHandler::handleClipboardRequest(rdr::U32 flags) | |||
void CMsgHandler::handleClipboardRequest(rdr::U32 /*flags*/) | |||
{ | |||
} | |||
void CMsgHandler::handleClipboardPeek(rdr::U32 flags) | |||
void CMsgHandler::handleClipboardPeek() | |||
{ | |||
} | |||
void CMsgHandler::handleClipboardNotify(rdr::U32 flags) | |||
void CMsgHandler::handleClipboardNotify(rdr::U32 /*flags*/) | |||
{ | |||
} | |||
void CMsgHandler::handleClipboardProvide(rdr::U32 flags, | |||
const size_t* lengths, | |||
const rdr::U8* const* data) | |||
void CMsgHandler::handleClipboardProvide(rdr::U32 /*flags*/, | |||
const size_t* /*lengths*/, | |||
const rdr::U8* const* /*data*/) | |||
{ | |||
} |
@@ -79,7 +79,7 @@ namespace rfb { | |||
virtual void handleClipboardCaps(rdr::U32 flags, | |||
const rdr::U32* lengths); | |||
virtual void handleClipboardRequest(rdr::U32 flags); | |||
virtual void handleClipboardPeek(rdr::U32 flags); | |||
virtual void handleClipboardPeek(); | |||
virtual void handleClipboardNotify(rdr::U32 flags); | |||
virtual void handleClipboardProvide(rdr::U32 flags, | |||
const size_t* lengths, |
@@ -390,7 +390,7 @@ bool CMsgReader::readExtendedClipboard(rdr::S32 len) | |||
handler->handleClipboardRequest(flags); | |||
break; | |||
case clipboardPeek: | |||
handler->handleClipboardPeek(flags); | |||
handler->handleClipboardPeek(); | |||
break; | |||
case clipboardNotify: | |||
handler->handleClipboardNotify(flags); |
@@ -100,31 +100,31 @@ bool CSecurityRSAAES::processMsg() | |||
{ | |||
switch (state) { | |||
case ReadPublicKey: | |||
if (readPublicKey()) { | |||
verifyServer(); | |||
writePublicKey(); | |||
writeRandom(); | |||
state = ReadRandom; | |||
} | |||
return false; | |||
if (!readPublicKey()) | |||
return false; | |||
verifyServer(); | |||
writePublicKey(); | |||
writeRandom(); | |||
state = ReadRandom; | |||
/* fall through */ | |||
case ReadRandom: | |||
if (readRandom()) { | |||
setCipher(); | |||
writeHash(); | |||
state = ReadHash; | |||
} | |||
return false; | |||
if (!readRandom()) | |||
return false; | |||
setCipher(); | |||
writeHash(); | |||
state = ReadHash; | |||
/* fall through */ | |||
case ReadHash: | |||
if (readHash()) { | |||
clearSecrets(); | |||
state = ReadSubtype; | |||
} | |||
if (!readHash()) | |||
return false; | |||
clearSecrets(); | |||
state = ReadSubtype; | |||
/* fall through */ | |||
case ReadSubtype: | |||
if (readSubtype()) { | |||
writeCredentials(); | |||
return true; | |||
} | |||
return false; | |||
if (!readSubtype()) | |||
return false; | |||
writeCredentials(); | |||
return true; | |||
} | |||
assert(!"unreachable"); | |||
return false; |
@@ -62,8 +62,8 @@ namespace rfb { | |||
return !beforeVersion(major,minor+1); | |||
} | |||
const int width() const { return width_; } | |||
const int height() const { return height_; } | |||
int width() const { return width_; } | |||
int height() const { return height_; } | |||
const ScreenSet& screenLayout() const { return screenLayout_; } | |||
void setDimensions(int width, int height); | |||
void setDimensions(int width, int height, const ScreenSet& layout); |
@@ -313,6 +313,8 @@ size_t Congestion::getBandwidth() | |||
void Congestion::debugTrace(const char* filename, int fd) | |||
{ | |||
(void)filename; | |||
(void)fd; | |||
#ifdef CONGESTION_TRACE | |||
#ifdef __linux__ | |||
FILE *f; |
@@ -36,8 +36,10 @@ CopyRectDecoder::~CopyRectDecoder() | |||
{ | |||
} | |||
bool CopyRectDecoder::readRect(const Rect& r, rdr::InStream* is, | |||
const ServerParams& server, rdr::OutStream* os) | |||
bool CopyRectDecoder::readRect(const Rect& /*r*/, | |||
rdr::InStream* is, | |||
const ServerParams& /*server*/, | |||
rdr::OutStream* os) | |||
{ | |||
if (!is->hasData(4)) | |||
return false; | |||
@@ -63,7 +65,8 @@ void CopyRectDecoder::getAffectedRegion(const Rect& rect, | |||
} | |||
void CopyRectDecoder::decodeRect(const Rect& r, const void* buffer, | |||
size_t buflen, const ServerParams& server, | |||
size_t buflen, | |||
const ServerParams& /*server*/, | |||
ModifiablePixelBuffer* pb) | |||
{ | |||
rdr::MemInStream is(buffer, buflen); |
@@ -45,17 +45,22 @@ Decoder::~Decoder() | |||
{ | |||
} | |||
void Decoder::getAffectedRegion(const Rect& rect, const void* buffer, | |||
size_t buflen, const ServerParams& server, | |||
void Decoder::getAffectedRegion(const Rect& rect, | |||
const void* /*buffer*/, | |||
size_t /*buflen*/, | |||
const ServerParams& /*server*/, | |||
Region* region) | |||
{ | |||
region->reset(rect); | |||
} | |||
bool Decoder::doRectsConflict(const Rect& rectA, const void* bufferA, | |||
size_t buflenA, const Rect& rectB, | |||
const void* bufferB, size_t buflenB, | |||
const ServerParams& server) | |||
bool Decoder::doRectsConflict(const Rect& /*rectA*/, | |||
const void* /*bufferA*/, | |||
size_t /*buflenA*/, | |||
const Rect& /*rectB*/, | |||
const void* /*bufferB*/, | |||
size_t /*buflenB*/, | |||
const ServerParams& /*server*/) | |||
{ | |||
return false; | |||
} |
@@ -1060,7 +1060,7 @@ void EncodeManager::OffsetPixelBuffer::update(const PixelFormat& pf, | |||
setBuffer(width, height, (rdr::U8*)data_, stride_); | |||
} | |||
rdr::U8* EncodeManager::OffsetPixelBuffer::getBufferRW(const Rect& r, int* stride) | |||
rdr::U8* EncodeManager::OffsetPixelBuffer::getBufferRW(const Rect& /*r*/, int* /*stride*/) | |||
{ | |||
throw rfb::Exception("Invalid write attempt to OffsetPixelBuffer"); | |||
} |
@@ -51,9 +51,10 @@ namespace rfb { | |||
// checking the list of encodings in the connection parameters. | |||
virtual bool isSupported()=0; | |||
virtual void setCompressLevel(int level) {}; | |||
virtual void setQualityLevel(int level) {}; | |||
virtual void setFineQualityLevel(int quality, int subsampling) {}; | |||
virtual void setCompressLevel(int /*level*/) {}; | |||
virtual void setQualityLevel(int /*level*/) {}; | |||
virtual void setFineQualityLevel(int /*quality*/, | |||
int /*subsampling*/) {}; | |||
virtual int getCompressLevel() { return -1; }; | |||
virtual int getQualityLevel() { return -1; }; |
@@ -65,8 +65,10 @@ H264DecoderContext* H264Decoder::findContext(const Rect& r) | |||
return NULL; | |||
} | |||
bool H264Decoder::readRect(const Rect& r, rdr::InStream* is, | |||
const ServerParams& server, rdr::OutStream* os) | |||
bool H264Decoder::readRect(const Rect& /*r*/, | |||
rdr::InStream* is, | |||
const ServerParams& /*server*/, | |||
rdr::OutStream* os) | |||
{ | |||
rdr::U32 len; | |||
@@ -92,7 +94,8 @@ bool H264Decoder::readRect(const Rect& r, rdr::InStream* is, | |||
} | |||
void H264Decoder::decodeRect(const Rect& r, const void* buffer, | |||
size_t buflen, const ServerParams& server, | |||
size_t buflen, | |||
const ServerParams& /*server*/, | |||
ModifiablePixelBuffer* pb) | |||
{ | |||
rdr::MemInStream is(buffer, buflen); | |||
@@ -134,5 +137,5 @@ void H264Decoder::decodeRect(const Rect& r, const void* buffer, | |||
if (!len) | |||
return; | |||
ctx->decode(is.getptr(len), len, flags, pb); | |||
ctx->decode(is.getptr(len), len, pb); | |||
} |
@@ -33,7 +33,9 @@ namespace rfb { | |||
virtual ~H264DecoderContext() = 0; | |||
virtual void decode(const rdr::U8* h264_buffer, rdr::U32 len, rdr::U32 flags, ModifiablePixelBuffer* pb) {} | |||
virtual void decode(const rdr::U8* /*h264_buffer*/, | |||
rdr::U32 /*len*/, | |||
ModifiablePixelBuffer* /*pb*/) {} | |||
void reset(); | |||
inline bool isEqualRect(const Rect &r) const { return r.equals(rect); } |
@@ -128,7 +128,9 @@ rdr::U8* H264LibavDecoderContext::makeH264WorkBuffer(const rdr::U8* buffer, rdr: | |||
return h264WorkBuffer; | |||
} | |||
void H264LibavDecoderContext::decode(const rdr::U8* h264_in_buffer, rdr::U32 len, rdr::U32 flags, ModifiablePixelBuffer* pb) { | |||
void H264LibavDecoderContext::decode(const rdr::U8* h264_in_buffer, | |||
rdr::U32 len, | |||
ModifiablePixelBuffer* pb) { | |||
os::AutoMutex lock(&mutex); | |||
if (!initialized) | |||
return; |
@@ -34,7 +34,8 @@ namespace rfb { | |||
H264LibavDecoderContext(const Rect &r) : H264DecoderContext(r) {} | |||
~H264LibavDecoderContext() { freeCodec(); } | |||
virtual void decode(const rdr::U8* h264_buffer, rdr::U32 len, rdr::U32 flags, ModifiablePixelBuffer* pb); | |||
virtual void decode(const rdr::U8* h264_buffer, rdr::U32 len, | |||
ModifiablePixelBuffer* pb); | |||
protected: | |||
virtual bool initCodec(); |
@@ -154,7 +154,9 @@ void H264WinDecoderContext::freeCodec() { | |||
initialized = false; | |||
} | |||
void H264WinDecoderContext::decode(const rdr::U8* h264_buffer, rdr::U32 len, rdr::U32 flags, ModifiablePixelBuffer* pb) { | |||
void H264WinDecoderContext::decode(const rdr::U8* h264_buffer, | |||
rdr::U32 len, | |||
ModifiablePixelBuffer* pb) { | |||
os::AutoMutex lock(&mutex); | |||
if (!initialized) | |||
return; |
@@ -33,7 +33,8 @@ namespace rfb { | |||
H264WinDecoderContext(const Rect &r) : H264DecoderContext(r) {}; | |||
~H264WinDecoderContext() { freeCodec(); } | |||
virtual void decode(const rdr::U8* h264_buffer, rdr::U32 len, rdr::U32 flags, ModifiablePixelBuffer* pb); | |||
virtual void decode(const rdr::U8* h264_buffer, rdr::U32 len, | |||
ModifiablePixelBuffer* pb); | |||
protected: | |||
virtual bool initCodec(); |
@@ -63,7 +63,8 @@ bool HextileEncoder::isSupported() | |||
return conn->client.supportsEncoding(encodingHextile); | |||
} | |||
void HextileEncoder::writeRect(const PixelBuffer* pb, const Palette& palette) | |||
void HextileEncoder::writeRect(const PixelBuffer* pb, | |||
const Palette& /*palette*/) | |||
{ | |||
rdr::OutStream* os = conn->getOutStream(); | |||
switch (pb->getPF().bpp) { |
@@ -32,12 +32,11 @@ namespace rfb { | |||
class InputHandler { | |||
public: | |||
virtual ~InputHandler() {} | |||
virtual void keyEvent(rdr::U32 __unused_attr keysym, | |||
rdr::U32 __unused_attr keycode, | |||
bool __unused_attr down) { } | |||
virtual void pointerEvent(const Point& __unused_attr pos, | |||
int __unused_attr buttonMask) { } | |||
virtual void clientCutText(const char* __unused_attr str) { } | |||
virtual void keyEvent(rdr::U32 /*keysym*/, rdr::U32 /*keycode*/, | |||
bool /*down*/) { } | |||
virtual void pointerEvent(const Point& /*pos*/, | |||
int /*buttonMask*/) { } | |||
virtual void clientCutText(const char* /*str*/) { } | |||
}; | |||
} |
@@ -155,15 +155,16 @@ JpegCompressor::~JpegCompressor(void) | |||
delete cinfo; | |||
} | |||
void JpegCompressor::compress(const rdr::U8 *buf, int stride, const Rect& r, | |||
const PixelFormat& pf, int quality, int subsamp) | |||
void JpegCompressor::compress(const rdr::U8 *buf, volatile int stride, | |||
const Rect& r, const PixelFormat& pf, | |||
int quality, int subsamp) | |||
{ | |||
int w = r.width(); | |||
int h = r.height(); | |||
int pixelsize; | |||
rdr::U8 *srcBuf = NULL; | |||
bool srcBufIsTemp = false; | |||
JSAMPROW *rowPointer = NULL; | |||
rdr::U8 * volatile srcBuf = NULL; | |||
volatile bool srcBufIsTemp = false; | |||
JSAMPROW * volatile rowPointer = NULL; | |||
if(setjmp(err->jmpBuffer)) { | |||
// this will execute if libjpeg has an error | |||
@@ -232,6 +233,7 @@ void JpegCompressor::compress(const rdr::U8 *buf, int stride, const Rect& r, | |||
break; | |||
case subsampleGray: | |||
jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); | |||
// fall through | |||
default: | |||
cinfo->comp_info[0].h_samp_factor = 1; | |||
cinfo->comp_info[0].v_samp_factor = 1; | |||
@@ -252,7 +254,7 @@ void JpegCompressor::compress(const rdr::U8 *buf, int stride, const Rect& r, | |||
delete[] rowPointer; | |||
} | |||
void JpegCompressor::writeBytes(const void* data, int length) | |||
void JpegCompressor::writeBytes(const void* /*data*/, int /*length*/) | |||
{ | |||
throw rdr::Exception("writeBytes() is not valid with a JpegCompressor instance. Use compress() instead."); | |||
} |
@@ -84,7 +84,7 @@ struct JPEG_SRC_MGR { | |||
}; | |||
static void | |||
JpegNoOp(j_decompress_ptr dinfo) | |||
JpegNoOp(j_decompress_ptr /*dinfo*/) | |||
{ | |||
} | |||
@@ -150,16 +150,18 @@ JpegDecompressor::~JpegDecompressor(void) | |||
delete dinfo; | |||
} | |||
void JpegDecompressor::decompress(const rdr::U8 *jpegBuf, int jpegBufLen, | |||
rdr::U8 *buf, int stride, const Rect& r, const PixelFormat& pf) | |||
void JpegDecompressor::decompress(const rdr::U8 *jpegBuf, | |||
int jpegBufLen, rdr::U8 *buf, | |||
volatile int stride, | |||
const Rect& r, const PixelFormat& pf) | |||
{ | |||
int w = r.width(); | |||
int h = r.height(); | |||
int pixelsize; | |||
int dstBufStride; | |||
rdr::U8 *dstBuf = NULL; | |||
bool dstBufIsTemp = false; | |||
JSAMPROW *rowPointer = NULL; | |||
rdr::U8 * volatile dstBuf = NULL; | |||
volatile bool dstBufIsTemp = false; | |||
JSAMPROW * volatile rowPointer = NULL; | |||
if(setjmp(err->jmpBuffer)) { | |||
// this will execute if libjpeg has an error |
@@ -51,7 +51,7 @@ void LogWriter::setLevel(int level) { | |||
} | |||
void | |||
LogWriter::listLogWriters(int width) { | |||
LogWriter::listLogWriters(int /*width*/) { | |||
// *** make this respect width... | |||
LogWriter* current = log_writers; | |||
fprintf(stderr, " "); |
@@ -25,22 +25,20 @@ | |||
#include <rfb/Logger.h> | |||
#include <rfb/Configuration.h> | |||
#ifdef __GNUC__ | |||
# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b))) | |||
#else | |||
# define __printf_attr(a, b) | |||
#endif // __GNUC__ | |||
// Each log writer instance has a unique textual name, | |||
// and is attached to a particular Log instance and | |||
// is assigned a particular log level. | |||
#define DEF_LOGFUNCTION(name, level) \ | |||
inline void v##name(const char* fmt, va_list ap) __printf_attr(2, 0) { \ | |||
inline void v##name(const char* fmt, va_list ap) \ | |||
__attribute__((__format__ (__printf__, 2, 0))) \ | |||
{ \ | |||
if (m_log && (level <= m_level)) \ | |||
m_log->write(level, m_name, fmt, ap); \ | |||
} \ | |||
inline void name(const char* fmt, ...) __printf_attr(2, 3) { \ | |||
inline void name(const char* fmt, ...) \ | |||
__attribute__((__format__ (__printf__, 2, 3))) \ | |||
{ \ | |||
if (m_log && (level <= m_level)) { \ | |||
va_list ap; va_start(ap, fmt); \ | |||
m_log->write(level, m_name, fmt, ap);\ | |||
@@ -63,7 +61,9 @@ namespace rfb { | |||
void setLevel(int level); | |||
int getLevel(void) { return m_level; } | |||
inline void write(int level, const char* format, ...) __printf_attr(3, 4) { | |||
inline void write(int level, const char* format, ...) | |||
__attribute__((__format__ (__printf__, 3, 4))) | |||
{ | |||
if (m_log && (level <= m_level)) { | |||
va_list ap; | |||
va_start(ap, format); |
@@ -28,12 +28,6 @@ | |||
// and is attached to a particular Logger instance and | |||
// is assigned a particular log level. | |||
#ifdef __GNUC__ | |||
# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b))) | |||
#else | |||
# define __printf_attr(a, b) | |||
#endif // __GNUC__ | |||
namespace rfb { | |||
class Logger { | |||
@@ -51,7 +45,8 @@ namespace rfb { | |||
// -=- Write data to a log | |||
virtual void write(int level, const char *logname, const char *text) = 0; | |||
void write(int level, const char *logname, const char* format, va_list ap) __printf_attr(4, 0); | |||
void write(int level, const char *logname, const char* format, va_list ap) | |||
__attribute__((__format__ (__printf__, 4, 0))); | |||
// -=- Register a logger | |||
@@ -45,7 +45,7 @@ Logger_File::~Logger_File() | |||
delete mutex; | |||
} | |||
void Logger_File::write(int level, const char *logname, const char *message) | |||
void Logger_File::write(int /*level*/, const char *logname, const char *message) | |||
{ | |||
os::AutoMutex a(mutex); | |||
@@ -339,7 +339,7 @@ rdr::U8* FullFramePixelBuffer::getBufferRW(const Rect& r, int* stride_) | |||
return &data[(r.tl.x + (r.tl.y * stride)) * (format.bpp/8)]; | |||
} | |||
void FullFramePixelBuffer::commitBufferRW(const Rect& r) | |||
void FullFramePixelBuffer::commitBufferRW(const Rect& /*r*/) | |||
{ | |||
} | |||
@@ -371,7 +371,7 @@ void FullFramePixelBuffer::setBuffer(int width, int height, | |||
data = data_; | |||
} | |||
void FullFramePixelBuffer::setSize(int w, int h) | |||
void FullFramePixelBuffer::setSize(int /*w*/, int /*h*/) | |||
{ | |||
// setBuffer() should be used | |||
throw rfb::Exception("Invalid call to FullFramePixelBuffer::setSize()"); |
@@ -86,7 +86,7 @@ namespace rfb { | |||
// Ensure that the specified rectangle of buffer is up to date. | |||
// Overridden by derived classes implementing framebuffer access | |||
// to copy the required display data into place. | |||
virtual void grabRegion(const Region& __unused_attr region) {} | |||
virtual void grabRegion(const Region& /*region*/) {} | |||
protected: | |||
PixelBuffer(); |
@@ -30,8 +30,10 @@ inline Pixel PixelFormat::pixelFromBuffer(const rdr::U8* buffer) const | |||
case 32: | |||
p |= ((Pixel)*(buffer++)) << 24; | |||
p |= ((Pixel)*(buffer++)) << 16; | |||
/* fall through */ | |||
case 16: | |||
p |= ((Pixel)*(buffer++)) << 8; | |||
/* fall through */ | |||
case 8: | |||
p |= *buffer; | |||
} | |||
@@ -57,8 +59,10 @@ inline void PixelFormat::bufferFromPixel(rdr::U8* buffer, Pixel p) const | |||
case 32: | |||
*(buffer++) = (p >> 24) & 0xff; | |||
*(buffer++) = (p >> 16) & 0xff; | |||
/* fall through */ | |||
case 16: | |||
*(buffer++) = (p >> 8) & 0xff; | |||
/* fall through */ | |||
case 8: | |||
*(buffer++) = (p >> 0) & 0xff; | |||
} |
@@ -48,7 +48,7 @@ RREDecoder::~RREDecoder() | |||
{ | |||
} | |||
bool RREDecoder::readRect(const Rect& r, rdr::InStream* is, | |||
bool RREDecoder::readRect(const Rect& /*r*/, rdr::InStream* is, | |||
const ServerParams& server, rdr::OutStream* os) | |||
{ | |||
rdr::U32 numRects; |
@@ -107,7 +107,7 @@ void RREEncoder::writeRect(const PixelBuffer* pb, const Palette& palette) | |||
mos.clear(); | |||
} | |||
void RREEncoder::writeSolidRect(int width, int height, | |||
void RREEncoder::writeSolidRect(int /*width*/, int /*height*/, | |||
const PixelFormat& pf, | |||
const rdr::U8* colour) | |||
{ |
@@ -44,7 +44,8 @@ bool RawEncoder::isSupported() | |||
return true; | |||
} | |||
void RawEncoder::writeRect(const PixelBuffer* pb, const Palette& palette) | |||
void RawEncoder::writeRect(const PixelBuffer* pb, | |||
const Palette& /*palette*/) | |||
{ | |||
const rdr::U8* buffer; | |||
int stride; |
@@ -286,7 +286,7 @@ bool SConnection::processInitMsg() | |||
return reader_->readClientInit(); | |||
} | |||
bool SConnection::handleAuthFailureTimeout(Timer* t) | |||
bool SConnection::handleAuthFailureTimeout(Timer* /*t*/) | |||
{ | |||
if (state_ != RFBSTATE_SECURITY_FAILURE) { | |||
close("SConnection::handleAuthFailureTimeout: invalid state"); | |||
@@ -402,7 +402,7 @@ void SConnection::handleClipboardRequest(rdr::U32 flags) | |||
handleClipboardRequest(); | |||
} | |||
void SConnection::handleClipboardPeek(rdr::U32 flags) | |||
void SConnection::handleClipboardPeek() | |||
{ | |||
if (client.clipboardFlags() & rfb::clipboardNotify) | |||
writer()->writeClipboardNotify(hasLocalClipboard ? rfb::clipboardUTF8 : 0); | |||
@@ -452,7 +452,7 @@ void SConnection::authSuccess() | |||
{ | |||
} | |||
void SConnection::queryConnection(const char* userName) | |||
void SConnection::queryConnection(const char* /*userName*/) | |||
{ | |||
approveConnection(true); | |||
} | |||
@@ -491,14 +491,14 @@ void SConnection::approveConnection(bool accept, const char* reason) | |||
} | |||
} | |||
void SConnection::clientInit(bool shared) | |||
void SConnection::clientInit(bool /*shared*/) | |||
{ | |||
writer_->writeServerInit(client.width(), client.height(), | |||
client.pf(), client.name()); | |||
state_ = RFBSTATE_NORMAL; | |||
} | |||
void SConnection::close(const char* reason) | |||
void SConnection::close(const char* /*reason*/) | |||
{ | |||
state_ = RFBSTATE_CLOSING; | |||
cleanup(); | |||
@@ -512,7 +512,8 @@ void SConnection::setPixelFormat(const PixelFormat& pf) | |||
writeFakeColourMap(); | |||
} | |||
void SConnection::framebufferUpdateRequest(const Rect& r, bool incremental) | |||
void SConnection::framebufferUpdateRequest(const Rect& /*r*/, | |||
bool /*incremental*/) | |||
{ | |||
if (!readyForSetColourMapEntries) { | |||
readyForSetColourMapEntries = true; | |||
@@ -533,8 +534,9 @@ void SConnection::fence(rdr::U32 flags, unsigned len, const char data[]) | |||
writer()->writeFence(flags, len, data); | |||
} | |||
void SConnection::enableContinuousUpdates(bool enable, | |||
int x, int y, int w, int h) | |||
void SConnection::enableContinuousUpdates(bool /*enable*/, | |||
int /*x*/, int /*y*/, | |||
int /*w*/, int /*h*/) | |||
{ | |||
} | |||
@@ -542,11 +544,11 @@ void SConnection::handleClipboardRequest() | |||
{ | |||
} | |||
void SConnection::handleClipboardAnnounce(bool available) | |||
void SConnection::handleClipboardAnnounce(bool /*available*/) | |||
{ | |||
} | |||
void SConnection::handleClipboardData(const char* data) | |||
void SConnection::handleClipboardData(const char* /*data*/) | |||
{ | |||
} | |||
@@ -85,7 +85,7 @@ namespace rfb { | |||
virtual void clientCutText(const char* str); | |||
virtual void handleClipboardRequest(rdr::U32 flags); | |||
virtual void handleClipboardPeek(rdr::U32 flags); | |||
virtual void handleClipboardPeek(); | |||
virtual void handleClipboardNotify(rdr::U32 flags); | |||
virtual void handleClipboardProvide(rdr::U32 flags, | |||
const size_t* lengths, | |||
@@ -222,7 +222,8 @@ namespace rfb { | |||
// throwConnFailedException() prints a message to the log, sends a conn | |||
// failed message to the client (if possible) and throws a | |||
// ConnFailedException. | |||
void throwConnFailedException(const char* format, ...) __printf_attr(2, 3); | |||
void throwConnFailedException(const char* format, ...) | |||
__attribute__((__format__ (__printf__, 2, 3))); | |||
void setState(stateEnum s) { state_ = s; } | |||
@@ -84,9 +84,9 @@ namespace rfb { | |||
// setScreenLayout() requests to reconfigure the framebuffer and/or | |||
// the layout of screens. | |||
virtual unsigned int setScreenLayout(int __unused_attr fb_width, | |||
int __unused_attr fb_height, | |||
const ScreenSet& __unused_attr layout) { | |||
virtual unsigned int setScreenLayout(int /*fb_width*/, | |||
int /*fb_height*/, | |||
const ScreenSet& /*layout*/) { | |||
return resultProhibited; | |||
} | |||
@@ -104,14 +104,14 @@ namespace rfb { | |||
// handleClipboardAnnounce() is called to indicate a change in the | |||
// clipboard on a client. Call VNCServer::requestClipboard() to | |||
// access the actual data. | |||
virtual void handleClipboardAnnounce(bool __unused_attr available) {} | |||
virtual void handleClipboardAnnounce(bool /*available*/) {} | |||
// handleClipboardData() is called when a client has sent over | |||
// the clipboard data as a result of a previous call to | |||
// VNCServer::requestClipboard(). Note that this function might | |||
// never be called if the clipboard data was no longer available | |||
// when the client received the request. | |||
virtual void handleClipboardData(const char* __unused_attr data) {} | |||
virtual void handleClipboardData(const char* /*data*/) {} | |||
protected: | |||
virtual ~SDesktop() {} | |||
@@ -149,7 +149,7 @@ namespace rfb { | |||
server = 0; | |||
} | |||
virtual void queryConnection(network::Socket* sock, | |||
const char* userName) { | |||
const char* /*userName*/) { | |||
server->approveConnection(sock, true, NULL); | |||
} | |||
@@ -40,7 +40,7 @@ SMsgHandler::~SMsgHandler() | |||
{ | |||
} | |||
void SMsgHandler::clientInit(bool shared) | |||
void SMsgHandler::clientInit(bool /*shared*/) | |||
{ | |||
} | |||
@@ -118,21 +118,21 @@ void SMsgHandler::handleClipboardCaps(rdr::U32 flags, const rdr::U32* lengths) | |||
client.setClipboardCaps(flags, lengths); | |||
} | |||
void SMsgHandler::handleClipboardRequest(rdr::U32 flags) | |||
void SMsgHandler::handleClipboardRequest(rdr::U32 /*flags*/) | |||
{ | |||
} | |||
void SMsgHandler::handleClipboardPeek(rdr::U32 flags) | |||
void SMsgHandler::handleClipboardPeek() | |||
{ | |||
} | |||
void SMsgHandler::handleClipboardNotify(rdr::U32 flags) | |||
void SMsgHandler::handleClipboardNotify(rdr::U32 /*flags*/) | |||
{ | |||
} | |||
void SMsgHandler::handleClipboardProvide(rdr::U32 flags, | |||
const size_t* lengths, | |||
const rdr::U8* const* data) | |||
void SMsgHandler::handleClipboardProvide(rdr::U32 /*flags*/, | |||
const size_t* /*lengths*/, | |||
const rdr::U8* const* /*data*/) | |||
{ | |||
} | |||
@@ -57,7 +57,7 @@ namespace rfb { | |||
virtual void handleClipboardCaps(rdr::U32 flags, | |||
const rdr::U32* lengths); | |||
virtual void handleClipboardRequest(rdr::U32 flags); | |||
virtual void handleClipboardPeek(rdr::U32 flags); | |||
virtual void handleClipboardPeek(); | |||
virtual void handleClipboardNotify(rdr::U32 flags); | |||
virtual void handleClipboardProvide(rdr::U32 flags, | |||
const size_t* lengths, |
@@ -429,7 +429,7 @@ bool SMsgReader::readExtendedClipboard(rdr::S32 len) | |||
handler->handleClipboardRequest(flags); | |||
break; | |||
case clipboardPeek: | |||
handler->handleClipboardPeek(flags); | |||
handler->handleClipboardPeek(); | |||
break; | |||
case clipboardNotify: | |||
handler->handleClipboardNotify(flags); |
@@ -238,36 +238,35 @@ bool SSecurityRSAAES::processMsg() | |||
loadPrivateKey(); | |||
writePublicKey(); | |||
state = ReadPublicKey; | |||
// fall through | |||
/* fall through */ | |||
case ReadPublicKey: | |||
if (readPublicKey()) { | |||
writeRandom(); | |||
state = ReadRandom; | |||
} | |||
return false; | |||
if (!readPublicKey()) | |||
return false; | |||
writeRandom(); | |||
state = ReadRandom; | |||
/* fall through */ | |||
case ReadRandom: | |||
if (readRandom()) { | |||
setCipher(); | |||
writeHash(); | |||
state = ReadHash; | |||
} | |||
return false; | |||
if (!readRandom()) | |||
return false; | |||
setCipher(); | |||
writeHash(); | |||
state = ReadHash; | |||
/* fall through */ | |||
case ReadHash: | |||
if (readHash()) { | |||
clearSecrets(); | |||
writeSubtype(); | |||
state = ReadCredentials; | |||
} | |||
return false; | |||
if (!readHash()) | |||
return false; | |||
clearSecrets(); | |||
writeSubtype(); | |||
state = ReadCredentials; | |||
/* fall through */ | |||
case ReadCredentials: | |||
if (readCredentials()) { | |||
if (requireUsername) | |||
verifyUserPass(); | |||
else | |||
verifyPass(); | |||
return true; | |||
} | |||
return false; | |||
if (!readCredentials()) | |||
return false; | |||
if (requireUsername) | |||
verifyUserPass(); | |||
else | |||
verifyPass(); | |||
return true; | |||
} | |||
assert(!"unreachable"); | |||
return false; |
@@ -51,8 +51,8 @@ namespace rfb { | |||
return !beforeVersion(major,minor+1); | |||
} | |||
const int width() const { return width_; } | |||
const int height() const { return height_; } | |||
int width() const { return width_; } | |||
int height() const { return height_; } | |||
const ScreenSet& screenLayout() const { return screenLayout_; } | |||
void setDimensions(int width, int height); | |||
void setDimensions(int width, int height, const ScreenSet& layout); |
@@ -199,13 +199,13 @@ bool TightDecoder::readRect(const Rect& r, rdr::InStream* is, | |||
return true; | |||
} | |||
bool TightDecoder::doRectsConflict(const Rect& rectA, | |||
bool TightDecoder::doRectsConflict(const Rect& /*rectA*/, | |||
const void* bufferA, | |||
size_t buflenA, | |||
const Rect& rectB, | |||
const Rect& /*rectB*/, | |||
const void* bufferB, | |||
size_t buflenB, | |||
const ServerParams& server) | |||
const ServerParams& /*server*/) | |||
{ | |||
rdr::U8 comp_ctl_a, comp_ctl_b; | |||
@@ -89,7 +89,7 @@ void TightEncoder::writeRect(const PixelBuffer* pb, const Palette& palette) | |||
{ | |||
switch (palette.size()) { | |||
case 0: | |||
writeFullColourRect(pb, palette); | |||
writeFullColourRect(pb); | |||
break; | |||
case 1: | |||
Encoder::writeSolidRect(pb, palette); | |||
@@ -102,7 +102,7 @@ void TightEncoder::writeRect(const PixelBuffer* pb, const Palette& palette) | |||
} | |||
} | |||
void TightEncoder::writeSolidRect(int width, int height, | |||
void TightEncoder::writeSolidRect(int /*width*/, int /*height*/, | |||
const PixelFormat& pf, | |||
const rdr::U8* colour) | |||
{ | |||
@@ -154,11 +154,11 @@ void TightEncoder::writeIndexedRect(const PixelBuffer* pb, const Palette& palett | |||
break; | |||
default: | |||
// It's more efficient to just do raw pixels | |||
writeFullColourRect(pb, palette); | |||
writeFullColourRect(pb); | |||
} | |||
} | |||
void TightEncoder::writeFullColourRect(const PixelBuffer* pb, const Palette& palette) | |||
void TightEncoder::writeFullColourRect(const PixelBuffer* pb) | |||
{ | |||
const int streamId = 0; | |||
@@ -43,7 +43,7 @@ namespace rfb { | |||
protected: | |||
void writeMonoRect(const PixelBuffer* pb, const Palette& palette); | |||
void writeIndexedRect(const PixelBuffer* pb, const Palette& palette); | |||
void writeFullColourRect(const PixelBuffer* pb, const Palette& palette); | |||
void writeFullColourRect(const PixelBuffer* pb); | |||
void writePixels(const rdr::U8* buffer, const PixelFormat& pf, | |||
unsigned int count, rdr::OutStream* os); |
@@ -112,7 +112,8 @@ int TightJPEGEncoder::getQualityLevel() | |||
return qualityLevel; | |||
} | |||
void TightJPEGEncoder::writeRect(const PixelBuffer* pb, const Palette& palette) | |||
void TightJPEGEncoder::writeRect(const PixelBuffer* pb, | |||
const Palette& /*palette*/) | |||
{ | |||
const rdr::U8* buffer; | |||
int stride; |
@@ -37,7 +37,7 @@ AliasParameter pam_service("pam_service", "Alias for PAMService", | |||
int do_pam_auth(const char *service, const char *username, | |||
const char *password); | |||
bool UnixPasswordValidator::validateInternal(SConnection * sc, | |||
bool UnixPasswordValidator::validateInternal(SConnection * /*sc*/, | |||
const char *username, | |||
const char *password) | |||
{ |
@@ -29,7 +29,7 @@ | |||
using namespace rfb; | |||
// This method will only work for Windows NT, 2000, and XP (and possibly Vista) | |||
bool WinPasswdValidator::validateInternal(rfb::SConnection* sc, | |||
bool WinPasswdValidator::validateInternal(rfb::SConnection* /*sc*/, | |||
const char* username, | |||
const char* password) | |||
{ |
@@ -80,8 +80,9 @@ ZRLEDecoder::~ZRLEDecoder() | |||
{ | |||
} | |||
bool ZRLEDecoder::readRect(const Rect& r, rdr::InStream* is, | |||
const ServerParams& server, rdr::OutStream* os) | |||
bool ZRLEDecoder::readRect(const Rect& /*r*/, rdr::InStream* is, | |||
const ServerParams& /*server*/, | |||
rdr::OutStream* os) | |||
{ | |||
rdr::U32 len; | |||
@@ -76,7 +76,7 @@ void ZRLEEncoder::writeRect(const PixelBuffer* pb, const Palette& palette) | |||
tile.br.x = pb->width(); | |||
if (palette.size() == 0) | |||
writeRawTile(tile, pb, palette); | |||
writeRawTile(tile, pb); | |||
else if (palette.size() <= 16) | |||
writePaletteTile(tile, pb, palette); | |||
else | |||
@@ -171,8 +171,7 @@ void ZRLEEncoder::writePaletteRLETile(const Rect& tile, const PixelBuffer* pb, | |||
} | |||
} | |||
void ZRLEEncoder::writeRawTile(const Rect& tile, const PixelBuffer* pb, | |||
const Palette& palette) | |||
void ZRLEEncoder::writeRawTile(const Rect& tile, const PixelBuffer* pb) | |||
{ | |||
const rdr::U8* buffer; | |||
int stride; |
@@ -42,8 +42,7 @@ namespace rfb { | |||
const Palette& palette); | |||
void writePaletteRLETile(const Rect& tile, const PixelBuffer* pb, | |||
const Palette& palette); | |||
void writeRawTile(const Rect& tile, const PixelBuffer* pb, | |||
const Palette& palette); | |||
void writeRawTile(const Rect& tile, const PixelBuffer* pb); | |||
void writePalette(const PixelFormat& pf, const Palette& palette); | |||
@@ -29,16 +29,6 @@ | |||
struct timeval; | |||
#ifdef __GNUC__ | |||
# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b))) | |||
#else | |||
# define __printf_attr(a, b) | |||
#endif // __GNUC__ | |||
#ifndef __unused_attr | |||
# define __unused_attr __attribute((__unused__)) | |||
#endif | |||
namespace rfb { | |||
// -=- Class to handle cleanup of arrays of characters | |||
@@ -53,7 +43,8 @@ namespace rfb { | |||
~CharArray() { | |||
delete [] buf; | |||
} | |||
void format(const char *fmt, ...) __printf_attr(2, 3); | |||
void format(const char *fmt, ...) | |||
__attribute__((__format__ (__printf__, 2, 3))); | |||
// Get the buffer pointer & clear it (i.e. caller takes ownership) | |||
char* takeBuf() {char* tmp = buf; buf = 0; return tmp;} | |||
void replaceBuf(char* b) {delete [] buf; buf = b;} |
@@ -1,5 +1,5 @@ | |||
include_directories(${CMAKE_SOURCE_DIR}/common) | |||
include_directories(${GETTEXT_INCLUDE_DIR}) | |||
include_directories(SYSTEM ${GETTEXT_INCLUDE_DIR}) | |||
add_library(test_util STATIC util.cxx) | |||
@@ -13,7 +13,7 @@ add_executable(encperf encperf.cxx) | |||
target_link_libraries(encperf test_util rfb) | |||
if (BUILD_VIEWER) | |||
include_directories(${FLTK_INCLUDE_DIR}) | |||
include_directories(SYSTEM ${FLTK_INCLUDE_DIR}) | |||
add_executable(fbperf | |||
fbperf.cxx | |||
${CMAKE_SOURCE_DIR}/vncviewer/PlatformPixelBuffer.cxx |
@@ -41,7 +41,8 @@ struct TestEntry { | |||
testfn fn; | |||
}; | |||
static void testMemcpy(rfb::PixelFormat &dstpf, rfb::PixelFormat &srcpf, | |||
static void testMemcpy(rfb::PixelFormat &dstpf, | |||
rfb::PixelFormat& /*srcpf*/, | |||
rdr::U8 *dst, rdr::U8 *src) | |||
{ | |||
int h; | |||
@@ -53,19 +54,22 @@ static void testMemcpy(rfb::PixelFormat &dstpf, rfb::PixelFormat &srcpf, | |||
} | |||
} | |||
static void testBuffer(rfb::PixelFormat &dstpf, rfb::PixelFormat &srcpf, | |||
static void testBuffer(rfb::PixelFormat &dstpf, | |||
rfb::PixelFormat &srcpf, | |||
rdr::U8 *dst, rdr::U8 *src) | |||
{ | |||
dstpf.bufferFromBuffer(dst, srcpf, src, tile, tile, fbsize, fbsize); | |||
} | |||
static void testToRGB(rfb::PixelFormat &dstpf, rfb::PixelFormat &srcpf, | |||
static void testToRGB(rfb::PixelFormat& /*dstpf*/, | |||
rfb::PixelFormat &srcpf, | |||
rdr::U8 *dst, rdr::U8 *src) | |||
{ | |||
srcpf.rgbFromBuffer(dst, src, tile, fbsize, tile); | |||
} | |||
static void testFromRGB(rfb::PixelFormat &dstpf, rfb::PixelFormat &srcpf, | |||
static void testFromRGB(rfb::PixelFormat &dstpf, | |||
rfb::PixelFormat& /*srcpf*/, | |||
rdr::U8 *dst, rdr::U8 *src) | |||
{ | |||
dstpf.bufferFromRGB(dst, src, tile, fbsize, tile); | |||
@@ -120,7 +124,7 @@ static void doTests(rfb::PixelFormat &dstpf, rfb::PixelFormat &srcpf) | |||
printf("\n"); | |||
} | |||
int main(int argc, char **argv) | |||
int main(int /*argc*/, char** /*argv*/) | |||
{ | |||
size_t bufsize; | |||
@@ -139,7 +139,7 @@ void CConn::initDone() | |||
server.height())); | |||
} | |||
void CConn::setPixelFormat(const rfb::PixelFormat& pf) | |||
void CConn::setPixelFormat(const rfb::PixelFormat& /*pf*/) | |||
{ | |||
// Override format | |||
CConnection::setPixelFormat(filePF); |
@@ -329,12 +329,11 @@ void SConn::getStats(double& ratio, unsigned long long& bytes, | |||
manager->getStats(ratio, bytes, rawEquivalent); | |||
} | |||
void SConn::setAccessRights(AccessRights ar) | |||
void SConn::setAccessRights(AccessRights) | |||
{ | |||
} | |||
void SConn::setDesktopSize(int fb_width, int fb_height, | |||
const rfb::ScreenSet& layout) | |||
void SConn::setDesktopSize(int, int, const rfb::ScreenSet&) | |||
{ | |||
} | |||
@@ -378,7 +378,7 @@ static void dotest(TestWindow* win) | |||
1.0 / (delay + rate * 1920 * 1080)); | |||
} | |||
int main(int argc, char** argv) | |||
int main(int /*argc*/, char** /*argv*/) | |||
{ | |||
TestWindow* win; | |||
@@ -1,6 +1,6 @@ | |||
include_directories(${CMAKE_SOURCE_DIR}/common) | |||
include_directories(${CMAKE_SOURCE_DIR}/vncviewer) | |||
include_directories(${GETTEXT_INCLUDE_DIR}) | |||
include_directories(SYSTEM ${GETTEXT_INCLUDE_DIR}) | |||
add_executable(conv conv.cxx) | |||
target_link_libraries(conv rfb) |
@@ -291,7 +291,7 @@ static void doTests(const rfb::PixelFormat &dstpf, | |||
} | |||
} | |||
int main(int argc, char **argv) | |||
int main(int /*argc*/, char** /*argv*/) | |||
{ | |||
rfb::PixelFormat dstpf, srcpf; | |||
@@ -84,7 +84,7 @@ static void testCRLF(const char* input, const char* expected) | |||
rfb::strFree(output); | |||
} | |||
int main(int argc, char** argv) | |||
int main(int /*argc*/, char** /*argv*/) | |||
{ | |||
testLF("", ""); | |||
testLF("no EOL", "no EOL"); |
@@ -461,7 +461,7 @@ void testDragAndRelease() | |||
printf("OK\n"); | |||
} | |||
int main(int argc, char** argv) | |||
int main(int /*argc*/, char** /*argv*/) | |||
{ | |||
testDisabledOption(); | |||
@@ -1233,7 +1233,7 @@ void testIgnore() | |||
testIgnoreAfterGesture(); | |||
} | |||
int main(int argc, char** argv) | |||
int main(int /*argc*/, char** /*argv*/) | |||
{ | |||
testOneTap(); | |||
testTwoTap(); |
@@ -46,7 +46,7 @@ static void doTest(const char* hostAndPort, | |||
rfb::strFree(host); | |||
} | |||
int main(int argc, char** argv) | |||
int main(int /*argc*/, char** /*argv*/) | |||
{ | |||
doTest(":5", "localhost", 5905); | |||
@@ -183,7 +183,7 @@ void is888Tests() | |||
printf("\n"); | |||
} | |||
int main(int argc, char** argv) | |||
int main(int /*argc*/, char** /*argv*/) | |||
{ | |||
sanityTests(); | |||
is888Tests(); |
@@ -85,7 +85,7 @@ struct _utf8utf16 utf8utf16[] = { | |||
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(*a)) | |||
int main(int argc, char** argv) | |||
int main(int /*argc*/, char** /*argv*/) | |||
{ | |||
int failures; | |||
size_t i; |
@@ -1,4 +1,4 @@ | |||
include_directories(${X11_INCLUDE_DIR}) | |||
include_directories(SYSTEM ${X11_INCLUDE_DIR}) | |||
include_directories(${CMAKE_SOURCE_DIR}/common) | |||
include_directories(${CMAKE_SOURCE_DIR}/common/rfb) |
@@ -91,7 +91,7 @@ private: | |||
XDrawString(dpy, win(), gc, startx, starty, text.buf, strlen(text.buf)); | |||
} | |||
virtual void handleEvent(TXWindow* w, XEvent* ev) { | |||
virtual void handleEvent(TXWindow* /*w*/, XEvent* ev) { | |||
switch (ev->type) { | |||
case Expose: | |||
paint(); |
@@ -109,7 +109,7 @@ private: | |||
text, strlen(text)); | |||
} | |||
virtual void handleEvent(TXWindow* w, XEvent* ev) { | |||
virtual void handleEvent(TXWindow* /*w*/, XEvent* ev) { | |||
switch (ev->type) { | |||
case Expose: | |||
paint(); |
@@ -82,7 +82,7 @@ public: | |||
} | |||
protected: | |||
virtual void deleteWindow(TXWindow* w) { | |||
virtual void deleteWindow(TXWindow* /*w*/) { | |||
ok = false; | |||
done = true; | |||
unmap(); |
@@ -108,7 +108,7 @@ private: | |||
} while (text.buf[i] != 0); | |||
} | |||
virtual void handleEvent(TXWindow* w, XEvent* ev) { | |||
virtual void handleEvent(TXWindow* /*w*/, XEvent* ev) { | |||
switch (ev->type) { | |||
case Expose: | |||
paint(); |
@@ -142,19 +142,21 @@ public: | |||
// takeFocus() is called when the window has received keyboard focus from the | |||
// window manager. | |||
virtual void takeFocus(Time time) {} | |||
virtual void takeFocus(Time /*time*/) {} | |||
// selectionNotify() is called when the selection owner has replied to a | |||
// request for information about a selection from the selection owner. | |||
virtual void selectionNotify(XSelectionEvent* ev, Atom type, int format, | |||
int nitems, void* data) {} | |||
virtual void selectionNotify(XSelectionEvent* /*ev*/, Atom /*type*/, | |||
int /*format*/, int /*nitems*/, | |||
void* /*data*/) {} | |||
// selectionRequest() is called when this window is the selection owner and | |||
// another X client has requested the selection. It should set the given | |||
// property on the given window to the value of the given selection, | |||
// returning true if successful, false otherwise. | |||
virtual bool selectionRequest(Window requestor, | |||
Atom selection, Atom property) { return false;} | |||
virtual bool selectionRequest(Window /*requestor*/, | |||
Atom /*selection*/, | |||
Atom /*property*/) { return false;} | |||
// Static methods | |||
@@ -1,4 +1,4 @@ | |||
include_directories(${X11_INCLUDE_DIR}) | |||
include_directories(SYSTEM ${X11_INCLUDE_DIR}) | |||
include_directories(${CMAKE_SOURCE_DIR}/common) | |||
include_directories(${CMAKE_SOURCE_DIR}/unix/tx) |
@@ -74,7 +74,7 @@ void QueryConnectDialog::buttonActivate(TXButton* b) { | |||
callback->queryRejected(); | |||
} | |||
bool QueryConnectDialog::handleTimeout(rfb::Timer* t) { | |||
bool QueryConnectDialog::handleTimeout(rfb::Timer* /*t*/) { | |||
if (timeUntilReject-- == 0) { | |||
unmap(); | |||
callback->queryTimedOut(); |
@@ -110,7 +110,7 @@ public: | |||
// handleEvent() | |||
virtual void handleEvent(TXWindow* w, XEvent* ev) { | |||
virtual void handleEvent(TXWindow* /*w*/, XEvent* ev) { | |||
if (ev->type == vncExtEventBase + VncExtQueryConnectNotify) { | |||
vlog.debug("query connection event"); | |||
if (queryConnectDialog) | |||
@@ -134,7 +134,7 @@ public: | |||
} | |||
// TXDeleteWindowCallback method | |||
virtual void deleteWindow(TXWindow* w) { | |||
virtual void deleteWindow(TXWindow* /*w*/) { | |||
exit(1); | |||
} | |||
@@ -48,7 +48,7 @@ extern char **environ; | |||
const char *SERVICE_NAME = "tigervnc"; | |||
// Main script PID | |||
volatile static pid_t script = -1; | |||
static volatile pid_t script = -1; | |||
// Daemon completion pipe | |||
int daemon_pipe_fd = -1; | |||
@@ -142,6 +142,7 @@ finish_daemon(void) | |||
static void | |||
sighandler(int sig) | |||
{ | |||
(void)sig; | |||
if (script > 0) { | |||
kill(script, SIGTERM); | |||
} | |||
@@ -169,6 +170,10 @@ conv(int num_msg, | |||
const struct pam_message **msg, | |||
struct pam_response **resp, void *appdata_ptr) | |||
{ | |||
(void)num_msg; | |||
(void)msg; | |||
(void)resp; | |||
(void)appdata_ptr; | |||
/* Opening a session should not require a conversation */ | |||
return PAM_CONV_ERR; | |||
} | |||
@@ -344,7 +349,7 @@ static void | |||
redir_stdio(const char *homedir, const char *display) | |||
{ | |||
int fd; | |||
size_t hostlen; | |||
long hostlen; | |||
char* hostname = NULL; | |||
char logfile[PATH_MAX]; | |||
@@ -1,4 +1,4 @@ | |||
include_directories(${X11_INCLUDE_DIR}) | |||
include_directories(SYSTEM ${X11_INCLUDE_DIR}) | |||
include_directories(${CMAKE_SOURCE_DIR}/unix/common) | |||
include_directories(${CMAKE_SOURCE_DIR}/unix/tx) | |||
include_directories(${CMAKE_SOURCE_DIR}/unix) |
@@ -208,7 +208,8 @@ void Image::updateRect(Image *src, int dst_x, int dst_y, | |||
static bool caughtShmError = false; | |||
static int ShmCreationXErrorHandler(Display *dpy, XErrorEvent *error) | |||
static int ShmCreationXErrorHandler(Display* /*dpy*/, | |||
XErrorEvent* /*error*/) | |||
{ | |||
caughtShmError = true; | |||
return 0; |
@@ -505,11 +505,13 @@ int vncRandRReconfigureOutput(int outputIdx, int x, int y, | |||
int vncRandRCanCreateOutputs(int extraOutputs) | |||
{ | |||
(void)extraOutputs; | |||
return 0; | |||
} | |||
int vncRandRCreateOutputs(int extraOutputs) | |||
{ | |||
(void)extraOutputs; | |||
return 0; | |||
} | |||
@@ -545,7 +545,7 @@ void XDesktop::keyEvent(rdr::U32 keysym, rdr::U32 xtcode, bool down) { | |||
#endif | |||
} | |||
void XDesktop::clientCutText(const char* str) { | |||
void XDesktop::clientCutText(const char* /*str*/) { | |||
} | |||
ScreenSet XDesktop::computeScreenLayout() |
@@ -78,7 +78,7 @@ StringParameter interface("interface", | |||
static const char* defaultDesktopName() | |||
{ | |||
size_t host_max = sysconf(_SC_HOST_NAME_MAX); | |||
long host_max = sysconf(_SC_HOST_NAME_MAX); | |||
if (host_max < 0) | |||
return ""; | |||
@@ -90,7 +90,7 @@ static const char* defaultDesktopName() | |||
if (pwent == NULL) | |||
return ""; | |||
size_t len = snprintf(NULL, 0, "%s@%s", pwent->pw_name, hostname.data()); | |||
int len = snprintf(NULL, 0, "%s@%s", pwent->pw_name, hostname.data()); | |||
if (len < 0) | |||
return ""; | |||
@@ -108,7 +108,7 @@ static const char* defaultDesktopName() | |||
static bool caughtSignal = false; | |||
static void CleanupSignalHandler(int sig) | |||
static void CleanupSignalHandler(int /*sig*/) | |||
{ | |||
caughtSignal = true; | |||
} |
@@ -26,16 +26,14 @@ extern "C" { | |||
void vncInitRFB(void); | |||
#ifdef __GNUC__ | |||
# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b))) | |||
#else | |||
# define __printf_attr(a, b) | |||
#endif // __GNUC__ | |||
void vncLogError(const char *name, const char *format, ...) __printf_attr(2, 3); | |||
void vncLogStatus(const char *name, const char *format, ...) __printf_attr(2, 3); | |||
void vncLogInfo(const char *name, const char *format, ...) __printf_attr(2, 3); | |||
void vncLogDebug(const char *name, const char *format, ...) __printf_attr(2, 3); | |||
void vncLogError(const char *name, const char *format, ...) | |||
__attribute__((__format__ (__printf__, 2, 3))); | |||
void vncLogStatus(const char *name, const char *format, ...) | |||
__attribute__((__format__ (__printf__, 2, 3))); | |||
void vncLogInfo(const char *name, const char *format, ...) | |||
__attribute__((__format__ (__printf__, 2, 3))); | |||
void vncLogDebug(const char *name, const char *format, ...) | |||
__attribute__((__format__ (__printf__, 2, 3))); | |||
int vncSetParam(const char *name, const char *value); | |||
int vncSetParamSimple(const char *nameAndValue); |
@@ -24,18 +24,12 @@ | |||
extern "C" { | |||
#endif | |||
#ifdef __GNUC__ | |||
# define __printf_attr(a, b) __attribute__((__format__ (__printf__, a, b))) | |||
# define __noreturn_attr __attribute__((noreturn)) | |||
#else | |||
# define __printf_attr(a, b) | |||
# define __noreturn_attr | |||
#endif // __GNUC__ | |||
const char *vncGetDisplay(void); | |||
unsigned long vncGetServerGeneration(void); | |||
void vncFatalError(const char *format, ...) __printf_attr(1, 2) __noreturn_attr; | |||
void vncFatalError(const char *format, ...) | |||
__attribute__((__format__ (__printf__, 1, 2))) | |||
__attribute__((noreturn)); | |||
int vncGetScreenCount(void); | |||
@@ -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!")); | |||
} |
@@ -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) | |||
@@ -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; | |||
@@ -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); |
@@ -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; |
@@ -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; | |||
@@ -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; |
@@ -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(); |
@@ -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); |
@@ -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 |