aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libgamma-error.hh10
-rw-r--r--src/libgamma-facade.hh8
-rw-r--r--src/libgamma-method.cc4
-rw-r--r--src/libgamma-method.hh8
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.