diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-01-04 16:18:46 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-01-04 19:17:28 +0100 |
commit | 3a1c46ff751a96dfdc721190a93be3954929725e (patch) | |
tree | b4b60c322545aaee22506f1071048ad5a604b123 | |
parent | 225e1516f9cc5d2318e9a9cd7b84b69b0f150e43 (diff) | |
download | tigervnc-3a1c46ff751a96dfdc721190a93be3954929725e.tar.gz tigervnc-3a1c46ff751a96dfdc721190a93be3954929725e.zip |
Explicitly mark unused parameters
This allows us to separate accidentally unused, from explicitly unused
parameters, which allows us to turn on such checks in the compiler.
81 files changed, 207 insertions, 163 deletions
diff --git a/common/rdr/MemInStream.h b/common/rdr/MemInStream.h index a5196594..b54334ca 100644 --- a/common/rdr/MemInStream.h +++ b/common/rdr/MemInStream.h @@ -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; }; diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx index 43cd0165..27942764 100644 --- a/common/rfb/CConnection.cxx +++ b/common/rfb/CConnection.cxx @@ -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*/) { } diff --git a/common/rfb/CMsgHandler.cxx b/common/rfb/CMsgHandler.cxx index 9200e82b..f4f785b2 100644 --- a/common/rfb/CMsgHandler.cxx +++ b/common/rfb/CMsgHandler.cxx @@ -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,7 +151,7 @@ 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*/) { } @@ -158,12 +159,12 @@ 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*/) { } diff --git a/common/rfb/Congestion.cxx b/common/rfb/Congestion.cxx index 32339a14..f642752e 100644 --- a/common/rfb/Congestion.cxx +++ b/common/rfb/Congestion.cxx @@ -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; diff --git a/common/rfb/CopyRectDecoder.cxx b/common/rfb/CopyRectDecoder.cxx index 82ae06f1..fb05dcbd 100644 --- a/common/rfb/CopyRectDecoder.cxx +++ b/common/rfb/CopyRectDecoder.cxx @@ -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); diff --git a/common/rfb/Decoder.cxx b/common/rfb/Decoder.cxx index 924f86d8..832d8cf0 100644 --- a/common/rfb/Decoder.cxx +++ b/common/rfb/Decoder.cxx @@ -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; } diff --git a/common/rfb/EncodeManager.cxx b/common/rfb/EncodeManager.cxx index e49fa254..6a78939e 100644 --- a/common/rfb/EncodeManager.cxx +++ b/common/rfb/EncodeManager.cxx @@ -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"); } diff --git a/common/rfb/Encoder.h b/common/rfb/Encoder.h index d5a0288e..76079930 100644 --- a/common/rfb/Encoder.h +++ b/common/rfb/Encoder.h @@ -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; }; diff --git a/common/rfb/H264Decoder.cxx b/common/rfb/H264Decoder.cxx index 1341366d..92231fcd 100644 --- a/common/rfb/H264Decoder.cxx +++ b/common/rfb/H264Decoder.cxx @@ -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); diff --git a/common/rfb/H264DecoderContext.h b/common/rfb/H264DecoderContext.h index 20c65774..f261f4f2 100644 --- a/common/rfb/H264DecoderContext.h +++ b/common/rfb/H264DecoderContext.h @@ -33,8 +33,9 @@ namespace rfb { virtual ~H264DecoderContext() = 0; - virtual void decode(const rdr::U8* h264_buffer, rdr::U32 len, - 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); } diff --git a/common/rfb/HextileEncoder.cxx b/common/rfb/HextileEncoder.cxx index e3845a83..f9db06b8 100644 --- a/common/rfb/HextileEncoder.cxx +++ b/common/rfb/HextileEncoder.cxx @@ -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) { diff --git a/common/rfb/InputHandler.h b/common/rfb/InputHandler.h index b91f0e42..4719eca0 100644 --- a/common/rfb/InputHandler.h +++ b/common/rfb/InputHandler.h @@ -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*/) { } }; } diff --git a/common/rfb/JpegCompressor.cxx b/common/rfb/JpegCompressor.cxx index 18d34c3d..0ecc6de9 100644 --- a/common/rfb/JpegCompressor.cxx +++ b/common/rfb/JpegCompressor.cxx @@ -252,7 +252,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."); } diff --git a/common/rfb/JpegDecompressor.cxx b/common/rfb/JpegDecompressor.cxx index 7b24e783..b879ae32 100644 --- a/common/rfb/JpegDecompressor.cxx +++ b/common/rfb/JpegDecompressor.cxx @@ -84,7 +84,7 @@ struct JPEG_SRC_MGR { }; static void -JpegNoOp(j_decompress_ptr dinfo) +JpegNoOp(j_decompress_ptr /*dinfo*/) { } diff --git a/common/rfb/LogWriter.cxx b/common/rfb/LogWriter.cxx index 7feee2fe..6df82d8e 100644 --- a/common/rfb/LogWriter.cxx +++ b/common/rfb/LogWriter.cxx @@ -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, " "); diff --git a/common/rfb/Logger_file.cxx b/common/rfb/Logger_file.cxx index 89ff7433..684614cc 100644 --- a/common/rfb/Logger_file.cxx +++ b/common/rfb/Logger_file.cxx @@ -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); diff --git a/common/rfb/PixelBuffer.cxx b/common/rfb/PixelBuffer.cxx index 1b39a9ec..1b534b7b 100644 --- a/common/rfb/PixelBuffer.cxx +++ b/common/rfb/PixelBuffer.cxx @@ -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()"); diff --git a/common/rfb/PixelBuffer.h b/common/rfb/PixelBuffer.h index 3e4018f9..b12a734e 100644 --- a/common/rfb/PixelBuffer.h +++ b/common/rfb/PixelBuffer.h @@ -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(); diff --git a/common/rfb/RREDecoder.cxx b/common/rfb/RREDecoder.cxx index a0818987..a01cbe74 100644 --- a/common/rfb/RREDecoder.cxx +++ b/common/rfb/RREDecoder.cxx @@ -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; diff --git a/common/rfb/RREEncoder.cxx b/common/rfb/RREEncoder.cxx index f5b9be72..31f94e7c 100644 --- a/common/rfb/RREEncoder.cxx +++ b/common/rfb/RREEncoder.cxx @@ -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) { diff --git a/common/rfb/RawEncoder.cxx b/common/rfb/RawEncoder.cxx index a820c32c..28115588 100644 --- a/common/rfb/RawEncoder.cxx +++ b/common/rfb/RawEncoder.cxx @@ -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; diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx index 00116414..8e0bff8c 100644 --- a/common/rfb/SConnection.cxx +++ b/common/rfb/SConnection.cxx @@ -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"); @@ -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*/) { } diff --git a/common/rfb/SDesktop.h b/common/rfb/SDesktop.h index b4104ea7..6d2a5dd8 100644 --- a/common/rfb/SDesktop.h +++ b/common/rfb/SDesktop.h @@ -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); } diff --git a/common/rfb/SMsgHandler.cxx b/common/rfb/SMsgHandler.cxx index f00b570b..4f008039 100644 --- a/common/rfb/SMsgHandler.cxx +++ b/common/rfb/SMsgHandler.cxx @@ -40,7 +40,7 @@ SMsgHandler::~SMsgHandler() { } -void SMsgHandler::clientInit(bool shared) +void SMsgHandler::clientInit(bool /*shared*/) { } @@ -118,7 +118,7 @@ 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*/) { } @@ -126,13 +126,13 @@ 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*/) { } diff --git a/common/rfb/TightDecoder.cxx b/common/rfb/TightDecoder.cxx index ce01104e..69971dbc 100644 --- a/common/rfb/TightDecoder.cxx +++ b/common/rfb/TightDecoder.cxx @@ -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; diff --git a/common/rfb/TightEncoder.cxx b/common/rfb/TightEncoder.cxx index 1143ebcf..94acd3d1 100644 --- a/common/rfb/TightEncoder.cxx +++ b/common/rfb/TightEncoder.cxx @@ -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) { diff --git a/common/rfb/TightJPEGEncoder.cxx b/common/rfb/TightJPEGEncoder.cxx index 11701e74..976601f7 100644 --- a/common/rfb/TightJPEGEncoder.cxx +++ b/common/rfb/TightJPEGEncoder.cxx @@ -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; diff --git a/common/rfb/UnixPasswordValidator.cxx b/common/rfb/UnixPasswordValidator.cxx index ee7bc0da..fa1513a4 100644 --- a/common/rfb/UnixPasswordValidator.cxx +++ b/common/rfb/UnixPasswordValidator.cxx @@ -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) { diff --git a/common/rfb/WinPasswdValidator.cxx b/common/rfb/WinPasswdValidator.cxx index b2edde5f..f07c27e8 100644 --- a/common/rfb/WinPasswdValidator.cxx +++ b/common/rfb/WinPasswdValidator.cxx @@ -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) { diff --git a/common/rfb/ZRLEDecoder.cxx b/common/rfb/ZRLEDecoder.cxx index 3c7ed2ce..f5120e9c 100644 --- a/common/rfb/ZRLEDecoder.cxx +++ b/common/rfb/ZRLEDecoder.cxx @@ -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; diff --git a/common/rfb/util.h b/common/rfb/util.h index f0ac9ef8..d0b32a61 100644 --- a/common/rfb/util.h +++ b/common/rfb/util.h @@ -35,10 +35,6 @@ struct timeval; # 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 diff --git a/tests/perf/convperf.cxx b/tests/perf/convperf.cxx index 4897f159..7a01bae8 100644 --- a/tests/perf/convperf.cxx +++ b/tests/perf/convperf.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; diff --git a/tests/perf/decperf.cxx b/tests/perf/decperf.cxx index 21674127..0509c15d 100644 --- a/tests/perf/decperf.cxx +++ b/tests/perf/decperf.cxx @@ -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); diff --git a/tests/perf/encperf.cxx b/tests/perf/encperf.cxx index 8fb9553d..476b613a 100644 --- a/tests/perf/encperf.cxx +++ b/tests/perf/encperf.cxx @@ -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&) { } diff --git a/tests/perf/fbperf.cxx b/tests/perf/fbperf.cxx index 01781725..d512ef80 100644 --- a/tests/perf/fbperf.cxx +++ b/tests/perf/fbperf.cxx @@ -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; diff --git a/tests/unit/conv.cxx b/tests/unit/conv.cxx index b14f8987..5696c149 100644 --- a/tests/unit/conv.cxx +++ b/tests/unit/conv.cxx @@ -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; diff --git a/tests/unit/convertlf.cxx b/tests/unit/convertlf.cxx index b85b270c..4dff9098 100644 --- a/tests/unit/convertlf.cxx +++ b/tests/unit/convertlf.cxx @@ -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"); diff --git a/tests/unit/emulatemb.cxx b/tests/unit/emulatemb.cxx index 927f3e48..7dfc2541 100644 --- a/tests/unit/emulatemb.cxx +++ b/tests/unit/emulatemb.cxx @@ -461,7 +461,7 @@ void testDragAndRelease() printf("OK\n"); } -int main(int argc, char** argv) +int main(int /*argc*/, char** /*argv*/) { testDisabledOption(); diff --git a/tests/unit/gesturehandler.cxx b/tests/unit/gesturehandler.cxx index 12d83556..bc39c24c 100644 --- a/tests/unit/gesturehandler.cxx +++ b/tests/unit/gesturehandler.cxx @@ -1233,7 +1233,7 @@ void testIgnore() testIgnoreAfterGesture(); } -int main(int argc, char** argv) +int main(int /*argc*/, char** /*argv*/) { testOneTap(); testTwoTap(); diff --git a/tests/unit/hostport.cxx b/tests/unit/hostport.cxx index 6ca5df8f..93ebc4c7 100644 --- a/tests/unit/hostport.cxx +++ b/tests/unit/hostport.cxx @@ -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); diff --git a/tests/unit/pixelformat.cxx b/tests/unit/pixelformat.cxx index 6ab736b8..a2ca50d0 100644 --- a/tests/unit/pixelformat.cxx +++ b/tests/unit/pixelformat.cxx @@ -183,7 +183,7 @@ void is888Tests() printf("\n"); } -int main(int argc, char** argv) +int main(int /*argc*/, char** /*argv*/) { sanityTests(); is888Tests(); diff --git a/tests/unit/unicode.cxx b/tests/unit/unicode.cxx index aa2af85b..0cd0f077 100644 --- a/tests/unit/unicode.cxx +++ b/tests/unit/unicode.cxx @@ -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; diff --git a/unix/tx/TXButton.h b/unix/tx/TXButton.h index b7472797..35694333 100644 --- a/unix/tx/TXButton.h +++ b/unix/tx/TXButton.h @@ -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(); diff --git a/unix/tx/TXCheckbox.h b/unix/tx/TXCheckbox.h index 0880b38c..76cdc950 100644 --- a/unix/tx/TXCheckbox.h +++ b/unix/tx/TXCheckbox.h @@ -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(); diff --git a/unix/tx/TXDialog.h b/unix/tx/TXDialog.h index 28876e7e..861a20be 100644 --- a/unix/tx/TXDialog.h +++ b/unix/tx/TXDialog.h @@ -82,7 +82,7 @@ public: } protected: - virtual void deleteWindow(TXWindow* w) { + virtual void deleteWindow(TXWindow* /*w*/) { ok = false; done = true; unmap(); diff --git a/unix/tx/TXLabel.h b/unix/tx/TXLabel.h index 3d5200d6..aba798cb 100644 --- a/unix/tx/TXLabel.h +++ b/unix/tx/TXLabel.h @@ -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(); diff --git a/unix/tx/TXWindow.h b/unix/tx/TXWindow.h index 5a72c335..746791d6 100644 --- a/unix/tx/TXWindow.h +++ b/unix/tx/TXWindow.h @@ -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 diff --git a/unix/vncconfig/QueryConnectDialog.cxx b/unix/vncconfig/QueryConnectDialog.cxx index 31302d2d..e13af34b 100644 --- a/unix/vncconfig/QueryConnectDialog.cxx +++ b/unix/vncconfig/QueryConnectDialog.cxx @@ -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(); diff --git a/unix/vncconfig/vncconfig.cxx b/unix/vncconfig/vncconfig.cxx index 276d0e62..c15d91f4 100644 --- a/unix/vncconfig/vncconfig.cxx +++ b/unix/vncconfig/vncconfig.cxx @@ -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); } diff --git a/unix/vncserver/vncsession.c b/unix/vncserver/vncsession.c index 49d68435..db3f9fe8 100644 --- a/unix/vncserver/vncsession.c +++ b/unix/vncserver/vncsession.c @@ -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; } diff --git a/unix/x0vncserver/Image.cxx b/unix/x0vncserver/Image.cxx index fb2d0602..b171c904 100644 --- a/unix/x0vncserver/Image.cxx +++ b/unix/x0vncserver/Image.cxx @@ -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; diff --git a/unix/x0vncserver/RandrGlue.c b/unix/x0vncserver/RandrGlue.c index 9530fd7a..f303297a 100644 --- a/unix/x0vncserver/RandrGlue.c +++ b/unix/x0vncserver/RandrGlue.c @@ -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; } diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index d5c6b2db..5f5366b7 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -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() diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index 7384f93a..a612f8ac 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -108,7 +108,7 @@ static const char* defaultDesktopName() static bool caughtSignal = false; -static void CleanupSignalHandler(int sig) +static void CleanupSignalHandler(int /*sig*/) { caughtSignal = true; } 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/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 9b086f4f..1bd66b92 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -1031,7 +1031,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 +1271,7 @@ void DesktopWindow::handleResizeTimeout(void *data) } -void DesktopWindow::reconfigureFullscreen(void *data) +void DesktopWindow::reconfigureFullscreen(void* /*data*/) { std::set<DesktopWindow *>::iterator iter; @@ -1495,7 +1496,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 +1553,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/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx index f4736a64..c756f3a8 100644 --- a/vncviewer/OptionsDialog.cxx +++ b/vncviewer/OptionsDialog.cxx @@ -1050,7 +1050,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 +1067,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 +1078,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 +1090,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 +1104,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 +1115,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 +1132,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 +1143,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 +1151,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/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 cbe1026e..529f2f30 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -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/win/rfb_win32/Dialog.cxx b/win/rfb_win32/Dialog.cxx index 08a5226c..369bea30 100644 --- a/win/rfb_win32/Dialog.cxx +++ b/win/rfb_win32/Dialog.cxx @@ -229,7 +229,7 @@ struct DLGTEMPLATEEX { short cy; }; -static int CALLBACK removeCtxtHelp(HWND hwnd, UINT message, LPARAM lParam) { +static int CALLBACK removeCtxtHelp(HWND /*hwnd*/, UINT message, LPARAM lParam) { if (message == PSCB_PRECREATE) { // Remove the context-help style, to remove the titlebar ? button // *** Nasty hack to cope with new & old dialog template formats... @@ -280,6 +280,7 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo centerWindow(handle, owner); plog.info("created %p", handle); + (void)capture; #ifdef _DIALOG_CAPTURE if (capture) { plog.info("capturing \"%s\"", (const char*)CStr(title.buf)); diff --git a/win/rfb_win32/Dialog.h b/win/rfb_win32/Dialog.h index cb23baff..35abb990 100644 --- a/win/rfb_win32/Dialog.h +++ b/win/rfb_win32/Dialog.h @@ -60,13 +60,13 @@ namespace rfb { // onCommand() is called upon receipt of a WM_COMMAND message item other than IDOK // or IDCANCEL. It should return true if the command has been handled. - virtual bool onCommand(int item, int cmd) { return false; } + virtual bool onCommand(int /*item*/, int /*cmd*/) { return false; } // onHelp() is called upon receipt of a WM_MENU message. This indicates that // context-specific help should be displayed, for a dialog control, for example. // It should return true if the command has been handled. - virtual bool onHelp(int item) { return false; } + virtual bool onHelp(int /*item*/) { return false; } // onOk() is called when the OK button is pressed. The hwnd argument is the // dialog box's window handle. diff --git a/win/rfb_win32/MonitorInfo.cxx b/win/rfb_win32/MonitorInfo.cxx index b9865e91..2f216e19 100644 --- a/win/rfb_win32/MonitorInfo.cxx +++ b/win/rfb_win32/MonitorInfo.cxx @@ -79,8 +79,8 @@ struct monitorByNameData { }; static BOOL CALLBACK monitorByNameEnumProc(HMONITOR monitor, - HDC dc, - LPRECT pos, + HDC /*dc*/, + LPRECT /*pos*/, LPARAM d) { monitorByNameData* data = (monitorByNameData*)d; memset(data->info, 0, sizeof(MONITORINFOEXA)); diff --git a/win/rfb_win32/RegConfig.cxx b/win/rfb_win32/RegConfig.cxx index 8a87bc4b..715f8097 100644 --- a/win/rfb_win32/RegConfig.cxx +++ b/win/rfb_win32/RegConfig.cxx @@ -73,7 +73,7 @@ void RegConfig::loadRegistryConfig(RegKey& key) { } } -void RegConfig::processEvent(HANDLE event_) { +void RegConfig::processEvent(HANDLE /*event*/) { vlog.info("registry changed"); // Reinstate the registry change notifications diff --git a/win/rfb_win32/SecurityPage.cxx b/win/rfb_win32/SecurityPage.cxx index e540702d..59d0a832 100644 --- a/win/rfb_win32/SecurityPage.cxx +++ b/win/rfb_win32/SecurityPage.cxx @@ -106,7 +106,7 @@ SecurityPage::initDialog() } bool -SecurityPage::onCommand(int id, int cmd) +SecurityPage::onCommand(int id, int /*cmd*/) { if (id == IDC_ENC_X509) { if (isItemChecked(IDC_ENC_X509)) diff --git a/win/vncconfig/Authentication.h b/win/vncconfig/Authentication.h index 175cd240..1e4ea4ac 100644 --- a/win/vncconfig/Authentication.h +++ b/win/vncconfig/Authentication.h @@ -149,7 +149,7 @@ namespace rfb { setItemChecked(enc_idc, enable); setItemChecked(auth_idc, enable); } - inline bool showFileChooser(const RegKey& rk, + inline bool showFileChooser(const RegKey& /*rk*/, const char* title, const char* filter, HWND hwnd) diff --git a/win/vncconfig/Desktop.h b/win/vncconfig/Desktop.h index 1a687d74..a102a0c7 100644 --- a/win/vncconfig/Desktop.h +++ b/win/vncconfig/Desktop.h @@ -40,7 +40,7 @@ namespace rfb { setItemChecked(IDC_REMOVE_WALLPAPER, rfb::win32::SDisplay::removeWallpaper); setItemChecked(IDC_DISABLE_EFFECTS, rfb::win32::SDisplay::disableEffects); } - bool onCommand(int id, int cmd) { + bool onCommand(int id, int /*cmd*/) { switch (id) { case IDC_DISCONNECT_LOGOFF: case IDC_DISCONNECT_LOCK: diff --git a/win/vncconfig/Hooking.h b/win/vncconfig/Hooking.h index f5ef8b74..1b02a1d5 100644 --- a/win/vncconfig/Hooking.h +++ b/win/vncconfig/Hooking.h @@ -39,7 +39,7 @@ namespace rfb { setItemChecked(IDC_CAPTUREBLT, rfb::win32::DeviceFrameBuffer::useCaptureBlt); onCommand(IDC_USEHOOKS, 0); } - bool onCommand(int id, int cmd) { + bool onCommand(int id, int /*cmd*/) { switch (id) { case IDC_USEPOLLING: case IDC_USEHOOKS: diff --git a/win/vncconfig/Inputs.h b/win/vncconfig/Inputs.h index f290831e..e71efde6 100644 --- a/win/vncconfig/Inputs.h +++ b/win/vncconfig/Inputs.h @@ -49,7 +49,7 @@ namespace rfb { enableAffectSSaver = false; enableItem(IDC_AFFECT_SCREENSAVER, enableAffectSSaver); } - bool onCommand(int id, int cmd) { + bool onCommand(int /*id*/, int /*cmd*/) { BOOL inputResetsBlocked; SystemParametersInfo(SPI_GETBLOCKSENDINPUTRESETS, 0, &inputResetsBlocked, 0); setChanged((rfb::Server::acceptKeyEvents != isItemChecked(IDC_ACCEPT_KEYS)) || diff --git a/win/vncconfig/Legacy.h b/win/vncconfig/Legacy.h index 9fb20563..0fcf29fe 100644 --- a/win/vncconfig/Legacy.h +++ b/win/vncconfig/Legacy.h @@ -39,7 +39,7 @@ namespace rfb { void initDialog() { setItemChecked(IDC_PROTOCOL_3_3, rfb::Server::protocol3_3); } - bool onCommand(int id, int cmd) { + bool onCommand(int id, int /*cmd*/) { switch (id) { case IDC_LEGACY_IMPORT: { diff --git a/win/vncconfig/Sharing.h b/win/vncconfig/Sharing.h index 872ae133..4dcb1db9 100644 --- a/win/vncconfig/Sharing.h +++ b/win/vncconfig/Sharing.h @@ -36,7 +36,7 @@ namespace rfb { setItemChecked(IDC_SHARE_ALWAYS, rfb::Server::alwaysShared); setItemChecked(IDC_SHARE_CLIENT, !(rfb::Server::neverShared || rfb::Server::alwaysShared)); } - bool onCommand(int id, int cmd) { + bool onCommand(int /*id*/, int /*cmd*/) { setChanged((isItemChecked(IDC_DISCONNECT_CLIENTS) != rfb::Server::disconnectClients) || (isItemChecked(IDC_SHARE_NEVER) != rfb::Server::neverShared) || (isItemChecked(IDC_SHARE_ALWAYS) != rfb::Server::alwaysShared)); diff --git a/win/vncconfig/vncconfig.cxx b/win/vncconfig/vncconfig.cxx index 18045c77..c58303d4 100644 --- a/win/vncconfig/vncconfig.cxx +++ b/win/vncconfig/vncconfig.cxx @@ -76,7 +76,7 @@ processParams(int argc, char* argv[]) { } -int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, char* cmdLine, int cmdShow) { +int WINAPI WinMain(HINSTANCE inst, HINSTANCE /*prev*/, char* /*cmdLine*/, int /*cmdShow*/) { // Configure debugging output #ifdef _DEBUG diff --git a/win/winvnc/ControlPanel.cxx b/win/winvnc/ControlPanel.cxx index a2a85e2d..d498513a 100644 --- a/win/winvnc/ControlPanel.cxx +++ b/win/winvnc/ControlPanel.cxx @@ -102,7 +102,7 @@ void ControlPanel::UpdateListView(ListConnInfo* LCInfo) } } -BOOL ControlPanel::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +BOOL ControlPanel::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM /*lParam*/) { switch (msg) { case WM_INITDIALOG: diff --git a/win/winvnc/VNCServerService.cxx b/win/winvnc/VNCServerService.cxx index 4092592a..43459855 100644 --- a/win/winvnc/VNCServerService.cxx +++ b/win/winvnc/VNCServerService.cxx @@ -101,7 +101,7 @@ BOOL GetSessionUserTokenWin(OUT LPHANDLE lphUserToken) ////////////////////////////////////////////////////////////////////////////// // START the app as system -HANDLE LaunchProcessWin(DWORD dwSessionId) +HANDLE LaunchProcessWin(DWORD /*dwSessionId*/) { HANDLE hProcess = NULL; HANDLE hToken = NULL; @@ -125,7 +125,7 @@ HANDLE LaunchProcessWin(DWORD dwSessionId) return hProcess; } -DWORD VNCServerService::serviceMain(int argc, TCHAR* argv[]) +DWORD VNCServerService::serviceMain(int /*argc*/, TCHAR* /*argv*/ []) { ConsoleSessionId OlddwSessionId; diff --git a/win/winvnc/winvnc.cxx b/win/winvnc/winvnc.cxx index b1bfb9dc..271538d0 100644 --- a/win/winvnc/winvnc.cxx +++ b/win/winvnc/winvnc.cxx @@ -238,7 +238,7 @@ static void processParams(int argc, char** argv) { // -=- main // -int WINAPI WinMain(HINSTANCE inst, HINSTANCE prevInst, char* cmdLine, int cmdShow) { +int WINAPI WinMain(HINSTANCE /*inst*/, HINSTANCE /*prevInst*/, char* /*cmdLine*/, int /*cmdShow*/) { int result = 0; try { diff --git a/win/wm_hooks/wm_hooks.cxx b/win/wm_hooks/wm_hooks.cxx index 54c3d80d..be845d6a 100644 --- a/win/wm_hooks/wm_hooks.cxx +++ b/win/wm_hooks/wm_hooks.cxx @@ -73,7 +73,7 @@ ATOM ATOM_Popup_Selection = GlobalAddAtom(_T("RFB.WM_Hooks.PopupSelectionAtom")) HINSTANCE dll_instance = 0; -BOOL WINAPI DllMain(HANDLE instance, ULONG reason, LPVOID reserved) { +BOOL WINAPI DllMain(HANDLE instance, ULONG reason, LPVOID /*reserved*/) { switch (reason) { case DLL_PROCESS_ATTACH: dll_instance = (HINSTANCE)instance; @@ -144,7 +144,7 @@ bool NotifyCursor(HCURSOR cursor) { return NotifyHookOwner(WM_HK_CursorChanged, 0, (LPARAM)cursor); } -void ProcessWindowMessage(UINT msg, HWND wnd, WPARAM wParam, LPARAM lParam) { +void ProcessWindowMessage(UINT msg, HWND wnd, WPARAM wParam, LPARAM /*lParam*/) { #ifdef _DEBUG if ((msg >= diagnostic_min) && (msg <= diagnostic_max)) PostThreadMessage(hook_owner, WM_HK_Diagnostic, msg, (LPARAM)wnd); |