From 8e1dcecd79a91976629362c2a05f5c1ef2495710 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 4 Sep 2014 02:33:09 +0200 Subject: add -Wshadow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libgamma-error.cc | 11 +++++++- src/libgamma-method.cc | 9 ++++++- src/libgamma-method.hh | 71 +++++++++++++++++++++++++------------------------- 3 files changed, 54 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/libgamma-error.cc b/src/libgamma-error.cc index 951db22..7233584 100644 --- a/src/libgamma-error.cc +++ b/src/libgamma-error.cc @@ -75,7 +75,12 @@ namespace libgamma return libgamma_value_of_error(cstr); } - + +#ifdef __GCC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wshadow" +#endif + /** * Constructor. * @@ -106,6 +111,10 @@ namespace libgamma return strerror(this->error_code); } +#ifdef __GCC__ +# pragma GCC diagnostic pop +#endif + /** * Create an exception from an error code diff --git a/src/libgamma-method.cc b/src/libgamma-method.cc index 16d61ff..dae9929 100644 --- a/src/libgamma-method.cc +++ b/src/libgamma-method.cc @@ -332,7 +332,10 @@ namespace libgamma return *this; } - +#ifdef __GCC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wshadow" +#endif /** * Constructor. @@ -540,5 +543,9 @@ namespace libgamma return r != 0; } +#ifdef __GCC__ +# pragma GCC diagnostic pop +#endif + } diff --git a/src/libgamma-method.hh b/src/libgamma-method.hh index d4bfed3..09a93bb 100644 --- a/src/libgamma-method.hh +++ b/src/libgamma-method.hh @@ -521,13 +521,13 @@ namespace libgamma /** * Constructor. * - * @param ramp The ramp. - * @param size The size of the ramp. + * @param native_ramp The ramp. + * @param ramp_size The size of the ramp. */ - Ramp(T* ramp, size_t size) + Ramp(T* native_ramp, size_t ramp_size) { - this->ramp = ramp; - this->size = size; + this->ramp = native_ramp; + this->size = ramp_size; } /** @@ -597,20 +597,21 @@ namespace libgamma /** * Constructor. * - * @param red The red gamma ramp. - * @param green The green gamma ramp. - * @param blue The blue gamma ramp. - * @param red_size The size of the gamma ramp for the red channel. - * @param green_size The size of the gamma ramp for the green channel. - * @param blue_size The size of the gamma ramp for the blue channel. - * @param depth The bit-depth of the gamma ramps, -1 for single precision - * floating point, and -2 for double precision floating point. - */ - GammaRamps(T* red, T* green, T* blue, size_t red_size, size_t green_size, size_t blue_size, signed depth) : - red(Ramp(red, red_size)), - green(Ramp(green, green_size)), - blue(Ramp(blue, blue_size)), - depth(depth) + * @param red_ramp The red gamma ramp. + * @param green_ramp The green gamma ramp. + * @param blue_ramp The blue gamma ramp. + * @param red_size The size of the gamma ramp for the red channel. + * @param green_size The size of the gamma ramp for the green channel. + * @param blue_size The size of the gamma ramp for the blue channel. + * @param gamma_depth The bit-depth of the gamma ramps, -1 for single precision + * floating point, and -2 for double precision floating point. + */ + GammaRamps(T* red_ramp, T* green_ramp, T* blue_ramp, + size_t red_size, size_t green_size, size_t blue_size, signed gamma_depth) : + red(Ramp(red_ramp, red_size)), + green(Ramp(green_ramp, green_size)), + blue(Ramp(blue_ramp, blue_size)), + depth(gamma_depth) { /* Do nothing. */ } @@ -838,15 +839,15 @@ namespace libgamma bool information(CRTCInformation* output, int32_t fields); #define __LIBGAMMA_GET_GAMMA(AFFIX) \ - libgamma_gamma_ramps ## AFFIX ## _t native; \ + libgamma_gamma_ramps ## AFFIX ## _t ramps_; \ int r; \ - native.red = ramps->red.ramp; \ - native.green = ramps->green.ramp; \ - native.blue = ramps->blue.ramp; \ - native.red_size = ramps->red.size; \ - native.green_size = ramps->green.size; \ - native.blue_size = ramps->blue.size; \ - r = libgamma_crtc_get_gamma_ramps ## AFFIX(this->native, &native); \ + ramps_.red = ramps->red.ramp; \ + ramps_.green = ramps->green.ramp; \ + ramps_.blue = ramps->blue.ramp; \ + ramps_.red_size = ramps->red.size; \ + ramps_.green_size = ramps->green.size; \ + ramps_.blue_size = ramps->blue.size; \ + r = libgamma_crtc_get_gamma_ramps ## AFFIX(this->native, &ramps_); \ if (r != 0) \ throw create_error(r) @@ -913,15 +914,15 @@ namespace libgamma #undef __LIBGAMMA_GET_GAMMA #define __LIBGAMMA_SET_GAMMA(AFFIX) \ - libgamma_gamma_ramps ## AFFIX ## _t native; \ + libgamma_gamma_ramps ## AFFIX ## _t ramps_; \ int r; \ - native.red = ramps->red.ramp; \ - native.green = ramps->green.ramp; \ - native.blue = ramps->blue.ramp; \ - native.red_size = ramps->red.size; \ - native.green_size = ramps->green.size; \ - native.blue_size = ramps->blue.size; \ - r = libgamma_crtc_set_gamma_ramps ## AFFIX(this->native, native); \ + ramps_.red = ramps->red.ramp; \ + ramps_.green = ramps->green.ramp; \ + ramps_.blue = ramps->blue.ramp; \ + ramps_.red_size = ramps->red.size; \ + ramps_.green_size = ramps->green.size; \ + ramps_.blue_size = ramps->blue.size; \ + r = libgamma_crtc_set_gamma_ramps ## AFFIX(this->native, ramps_); \ if (r != 0) \ throw create_error(r) -- cgit v1.2.3-70-g09d2