From: Mikko Rasa Date: Fri, 24 May 2013 14:42:09 +0000 (+0300) Subject: Avoid a shadowing warning from clang X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=7a493cb73ff5f5f820d4873d6c993d0e9c5a580a;ds=sidebyside Avoid a shadowing warning from clang It considers the handle member of the outer class to be shadowed by the parameter of an inner class member function. --- diff --git a/source/io/unix/serial.cpp b/source/io/unix/serial.cpp index 49d9e9c..69939a8 100644 --- a/source/io/unix/serial.cpp +++ b/source/io/unix/serial.cpp @@ -33,14 +33,14 @@ void Serial::platform_init(const string &port) } -void Serial::DeviceState::get_from(const Handle &handle) +void Serial::DeviceState::get_from(const Handle &h) { - tcgetattr(*handle, &state); + tcgetattr(*h, &state); } -void Serial::DeviceState::apply_to(const Handle &handle) +void Serial::DeviceState::apply_to(const Handle &h) { - if(tcsetattr(*handle, TCSADRAIN, &state)==-1) + if(tcsetattr(*h, TCSADRAIN, &state)==-1) throw system_error("tcsetattr"); } diff --git a/source/io/windows/serial.cpp b/source/io/windows/serial.cpp index 0092754..84a3175 100644 --- a/source/io/windows/serial.cpp +++ b/source/io/windows/serial.cpp @@ -28,14 +28,14 @@ void Serial::platform_init(const string &port) } -void Serial::DeviceState::get_from(const Handle &handle) +void Serial::DeviceState::get_from(const Handle &h) { - GetCommState(*handle, &state); + GetCommState(*h, &state); } -void Serial::DeviceState::apply_to(const Handle &handle) +void Serial::DeviceState::apply_to(const Handle &h) { - if(SetCommState(*handle, &state)==0) + if(SetCommState(*h, &state)==0) throw system_error("SetCommState"); }