From 2c66355c229bd10ad9f0c34e9ea31ed50c715955 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 3 Nov 2020 20:31:11 +0100 Subject: Channel.h: rename variable to prevent shadowing In file included from Proxy.h:39:0, from ServerProxy.h:32, from ServerProxy.cpp:36: Channel.h: In member function 'int Channel::handleEncodeIdentity(EncodeBuffer&, ChannelCache*, MessageStore*, const unsigned char*, unsigned int, int)': Channel.h:369:3: warning: declaration of 'bigEndian' shadows a member of 'this' [-Wshadow] { ^ Channel.h: In member function 'int Channel::handleDecodeIdentity(DecodeBuffer&, ChannelCache*, MessageStore*, unsigned char*&, unsigned int&, int, WriteBuffer*)': Channel.h:378:3: warning: declaration of 'bigEndian' shadows a member of 'this' [-Wshadow] { ^ RHEL7's g++ 4.8.5 reports this while Debian's g++ 10.2.0-15 does not. This is described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709 and fixed in gcc 5.0. Rename the variables anyway to be on the safe side. Fixes ArcticaProject/nx-libs#956 --- nxcomp/src/Channel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nxcomp/src') diff --git a/nxcomp/src/Channel.h b/nxcomp/src/Channel.h index 7e432416a..3b37fa60d 100644 --- a/nxcomp/src/Channel.h +++ b/nxcomp/src/Channel.h @@ -365,18 +365,18 @@ class Channel int handleEncodeIdentity(EncodeBuffer &encodeBuffer, ChannelCache *channelCache, MessageStore *store, const unsigned char *buffer, - const unsigned int size, int bigEndian) + const unsigned int size, int _bigEndian) { return (store -> encodeIdentity(encodeBuffer, buffer, size, - bigEndian, channelCache)); + _bigEndian, channelCache)); } int handleDecodeIdentity(DecodeBuffer &decodeBuffer, ChannelCache *channelCache, MessageStore *store, unsigned char *&buffer, - unsigned int &size, int bigEndian, + unsigned int &size, int _bigEndian, WriteBuffer *writeBuffer) { - return (store -> decodeIdentity(decodeBuffer, buffer, size, bigEndian, + return (store -> decodeIdentity(decodeBuffer, buffer, size, _bigEndian, writeBuffer, channelCache)); } -- cgit v1.2.3 From e66d2c86beb330d420d8208d28d9da52b7a9dfa3 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 3 Nov 2020 20:41:16 +0100 Subject: Log.h: fix some shadow warnings "warning: declaration of '' shadows a member of 'this' This shows up in gcc 4.8.5 and has been fixed in gcc 5.0, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709 Change the variable names anyway to be on the safe side. Fixes ArcticaProject/nx-libs#958 --- nxcomp/src/Log.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'nxcomp/src') diff --git a/nxcomp/src/Log.h b/nxcomp/src/Log.h index 95436a55d..52482f5a6 100644 --- a/nxcomp/src/Log.h +++ b/nxcomp/src/Log.h @@ -105,7 +105,7 @@ class NXLogStamp } - NXLogStamp(NXLogLevel level, const char *file = "", const char *function = "", size_t line = 0) : file_(file), function_(function), line_(line), level_(level) + NXLogStamp(NXLogLevel _level, const char *_file = "", const char *_function = "", size_t _line = 0) : file_(_file), function_(_function), line_(_line), level_(_level) { gettimeofday(×tamp_, NULL); } @@ -300,9 +300,9 @@ class NXLog return level_; } - void level(NXLogLevel level) + void level(NXLogLevel _level) { - level_ = level; + level_ = _level; } @@ -312,9 +312,9 @@ class NXLog return get_data()->current_level; } - void current_level(NXLogLevel level) + void current_level(NXLogLevel _level) { - get_data()->current_level = level; + get_data()->current_level = _level; } /** Source file from which messages are currently originating */ @@ -333,10 +333,10 @@ class NXLog return stream_; } - void stream(std::ostream *stream) + void stream(std::ostream *_stream) { flush(); - stream_ = stream; + stream_ = _stream; } bool synchronized() const { -- cgit v1.2.3