From d9df2815e3c3e32a6a36b0569920459cd1e686b4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 4 Sep 2014 02:24:13 +0200 Subject: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libgamma-error.hh | 10 +++++++--- src/libgamma-facade.hh | 8 +++++++- src/libgamma-method.cc | 4 ++-- src/libgamma-method.hh | 8 +++++++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/libgamma-error.hh b/src/libgamma-error.hh index 12550f2..0bd0fce 100644 --- a/src/libgamma-error.hh +++ b/src/libgamma-error.hh @@ -25,6 +25,10 @@ #include "libgamma-native.hh" +#ifndef __GCC__ +# define __attribute__(X) /* emtpy */ +#endif + #ifndef __WIN32__ # define libgamma_gid_t gid_t @@ -82,7 +86,7 @@ namespace libgamma * @return The error code, zero if the name is `nullptr` * or does not refer to a `libgamma` error. */ - int value_of_error(const std::string* name); + int value_of_error(const std::string* name) __attribute__((pure)); /** @@ -122,9 +126,9 @@ namespace libgamma return *this; } - operator char*() const + operator const char*() const { - return (char*)libgamma_group_name; + return libgamma_group_name; } }; diff --git a/src/libgamma-facade.hh b/src/libgamma-facade.hh index c52d7d8..c08521a 100644 --- a/src/libgamma-facade.hh +++ b/src/libgamma-facade.hh @@ -26,6 +26,12 @@ #include "libgamma-method.hh" +#ifndef __GCC__ +# define __attribute__(X) /* emtpy */ +#endif + + + namespace libgamma { /** @@ -49,7 +55,7 @@ namespace libgamma * @param method The adjustment method. * @return Whether the adjustment method is available. */ - int is_method_available(int method); + int is_method_available(int method) __attribute__((const)); /** * Return the capabilities of an adjustment method. diff --git a/src/libgamma-method.cc b/src/libgamma-method.cc index 18bb9bb..16d61ff 100644 --- a/src/libgamma-method.cc +++ b/src/libgamma-method.cc @@ -202,13 +202,13 @@ namespace libgamma gamma_depth_error(info->gamma_depth_error), gamma_support(info->gamma_support), gamma_support_error(info->gamma_support_error), - subpixel_order((SubpixelOrder)(info->subpixel_order)), + subpixel_order(info->subpixel_order), subpixel_order_error(info->subpixel_order_error), active(info->active), active_error(info->active_error), connector_name(nullptr), connector_name_error(info->connector_name_error), - connector_type((ConnectorType)(info->connector_type)), + connector_type(info->connector_type), connector_type_error(info->connector_type_error), gamma_red(info->gamma_red), gamma_green(info->gamma_green), diff --git a/src/libgamma-method.hh b/src/libgamma-method.hh index aedf6f6..d4bfed3 100644 --- a/src/libgamma-method.hh +++ b/src/libgamma-method.hh @@ -26,6 +26,12 @@ #include "libgamma-error.hh" +#ifndef __GCC__ +# define __attribute__(X) /* emtpy */ +#endif + + + namespace libgamma { /** @@ -102,7 +108,7 @@ namespace libgamma /** * Destructor. */ - ~MethodCapabilities(); + ~MethodCapabilities() __attribute__((const)); /** * Copy operator. -- cgit v1.2.3-70-g09d2