diff options
author | Ran Benita <ran234@gmail.com> | 2012-08-30 12:13:37 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2012-09-02 19:17:09 +0300 |
commit | 06d7803a6d0f7dbcdb098d8e00122c097d40b80d (patch) | |
tree | a1fb53d4cc9f76899af2b2b9746625539788b61a /src/utils.h | |
parent | 9f0c01606346e63861b52bfc7ed8cff964cf9699 (diff) | |
download | xorg-lib-libxkbcommon-06d7803a6d0f7dbcdb098d8e00122c097d40b80d.tar.gz |
state: fix mod_names_are_active
This function was always returning -1.
Adding a test, we see that test/state.c treat the is_active functions as
returning booleans, which would treat -1 as success, so we test for > 0
instead (most users would probably get this wrong as well...).
Also update the documentation for the are_active functions, and add a
ATTR_NULL_SENTINEL for gcc __attribute__((sentinel)).
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h index 3fda939..4b2bb32 100644 --- a/src/utils.h +++ b/src/utils.h @@ -107,4 +107,10 @@ isempty(const char *s) #define ATTR_MALLOC #endif +#if defined(__GNUC__) && (__GNUC__ >= 4) +# define ATTR_NULL_SENTINEL __attribute__((__sentinel__)) +#else +# define ATTR_NULL_SENTINEL +#endif /* GNUC >= 4 */ + #endif /* UTILS_H */ |