aboutsummaryrefslogtreecommitdiffstats
path: root/src/ramps.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-16 16:05:48 +0200
committerMattias Andrée <maandree@kth.se>2016-07-16 16:05:48 +0200
commitc5a454342f78eec4c58b1477d9190a084f40cfac (patch)
tree3f98b7e6412182942bc36d44402790541d91fcea /src/ramps.h
parentThe stuff around supportinf SIGRTMIN+0 and SIGRTMIN+1 (diff)
downloadcoopgammad-c5a454342f78eec4c58b1477d9190a084f40cfac.tar.gz
coopgammad-c5a454342f78eec4c58b1477d9190a084f40cfac.tar.bz2
coopgammad-c5a454342f78eec4c58b1477d9190a084f40cfac.tar.xz
attributes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/ramps.h')
-rw-r--r--src/ramps.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/ramps.h b/src/ramps.h
index d6c53cf..0ba8579 100644
--- a/src/ramps.h
+++ b/src/ramps.h
@@ -19,6 +19,16 @@
+#ifndef GCC_ONLY
+# if defined(__GNUC__) && !defined(__clang__)
+# define GCC_ONLY(...) __VA_ARGS__
+# else
+# define GCC_ONLY(...) /* nothing */
+# endif
+#endif
+
+
+
/**
* Gamma ramps union for all
* lbigamma gamma ramps types
@@ -69,7 +79,8 @@ union gamma_ramps
* @param ramps_size The byte-size of ramps
* @return The number of marshalled byte
*/
-size_t gamma_ramps_marshal(const union gamma_ramps* this, void* buf, size_t ramps_size);
+GCC_ONLY(__attribute__((nonnull(1))))
+size_t gamma_ramps_marshal(const union gamma_ramps* restrict this, void* restrict buf, size_t ramps_size);
/**
* Unmarshal a ramp trio
@@ -79,7 +90,8 @@ size_t gamma_ramps_marshal(const union gamma_ramps* this, void* buf, size_t ramp
* @param ramps_size The byte-size of ramps
* @return The number of unmarshalled bytes, 0 on error
*/
-size_t gamma_ramps_unmarshal(union gamma_ramps* this, const void* buf, size_t ramps_size);
+GCC_ONLY(__attribute__((nonnull)))
+size_t gamma_ramps_unmarshal(union gamma_ramps* restrict this, const void* restrict buf, size_t ramps_size);
/**
* Apply a ramp-trio on top of another ramp-trio
@@ -93,5 +105,7 @@ size_t gamma_ramps_unmarshal(union gamma_ramps* this, const void* buf, size_t ra
* @param base The CLUT on top of which the new filter should be applied,
* this can be the same pointer as `dest`
*/
-void apply(union gamma_ramps* dest, void* application, int depth, union gamma_ramps* base);
+GCC_ONLY(__attribute__((nonnull)))
+void apply(union gamma_ramps* restrict dest, void* restrict application,
+ int depth, union gamma_ramps* restrict base);