diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-06-05 11:22:35 +1000 |
|---|---|---|
| committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-06-26 17:47:28 +1000 |
| commit | dc27c627a7ca7759b3cc917e2fa76dc83dcbc5bf (patch) | |
| tree | 95757cf1d1408b67cda7bafd3dc5f27a3849f142 /libevdev/libevdev-util.h | |
| parent | 645d5d3a645cf2c3ec1813b13dd5a3144ee8f912 (diff) | |
| download | libevdev-dc27c627a7ca7759b3cc917e2fa76dc83dcbc5bf.tar.gz | |
Fix type_to_mask to return -1
EV_SYN doesn't have a max, so 0 is not enough.
returning 0 on failure is a bad idea, as mask is unset.
Diffstat (limited to 'libevdev/libevdev-util.h')
| -rw-r--r-- | libevdev/libevdev-util.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libevdev/libevdev-util.h b/libevdev/libevdev-util.h index 74f8edb..b052597 100644 --- a/libevdev/libevdev-util.h +++ b/libevdev/libevdev-util.h @@ -53,10 +53,10 @@ set_bit_state(unsigned long *array, int bit, int state) clear_bit(array, bit); } -static inline unsigned int +static inline int type_to_mask_const(const struct libevdev *dev, unsigned int type, const unsigned long **mask) { - unsigned int max; + int max; switch(type) { case EV_ABS: @@ -76,16 +76,16 @@ type_to_mask_const(const struct libevdev *dev, unsigned int type, const unsigned max = LED_MAX; break; default: - return 0; + return -1; } return max; } -static inline unsigned int +static inline int type_to_mask(struct libevdev *dev, unsigned int type, unsigned long **mask) { - unsigned int max; + int max; switch(type) { case EV_ABS: @@ -105,7 +105,7 @@ type_to_mask(struct libevdev *dev, unsigned int type, unsigned long **mask) max = LED_MAX; break; default: - return 0; + return -1; } return max; |
