diff options
author | Chih-hung Hsieh <chh@google.com> | 2016-04-19 00:34:41 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-04-19 00:34:41 +0200 |
commit | 0231e7016dfe56625d6d01a1de468cd23d9cf01a (patch) | |
tree | 543fc407741ac3df540e3bfe4c36688e3bda6d80 /minui | |
parent | Merge "Fix IWYU errors." am: 51dcd0d (diff) | |
parent | Merge "Fix google-runtime-int warnings." (diff) | |
download | android_bootable_recovery-0231e7016dfe56625d6d01a1de468cd23d9cf01a.tar android_bootable_recovery-0231e7016dfe56625d6d01a1de468cd23d9cf01a.tar.gz android_bootable_recovery-0231e7016dfe56625d6d01a1de468cd23d9cf01a.tar.bz2 android_bootable_recovery-0231e7016dfe56625d6d01a1de468cd23d9cf01a.tar.lz android_bootable_recovery-0231e7016dfe56625d6d01a1de468cd23d9cf01a.tar.xz android_bootable_recovery-0231e7016dfe56625d6d01a1de468cd23d9cf01a.tar.zst android_bootable_recovery-0231e7016dfe56625d6d01a1de468cd23d9cf01a.zip |
Diffstat (limited to 'minui')
-rw-r--r-- | minui/events.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/minui/events.cpp b/minui/events.cpp index 3b2262a4b..a6b9671ed 100644 --- a/minui/events.cpp +++ b/minui/events.cpp @@ -49,7 +49,7 @@ static unsigned ev_count = 0; static unsigned ev_dev_count = 0; static unsigned ev_misc_count = 0; -static bool test_bit(size_t bit, unsigned long* array) { +static bool test_bit(size_t bit, unsigned long* array) { // NOLINT return (array[bit/BITS_PER_LONG] & (1UL << (bit % BITS_PER_LONG))) != 0; } @@ -65,7 +65,8 @@ int ev_init(ev_callback input_cb, void* data) { if (dir != NULL) { dirent* de; while ((de = readdir(dir))) { - unsigned long ev_bits[BITS_TO_LONGS(EV_MAX)]; + // Use unsigned long to match ioctl's parameter type. + unsigned long ev_bits[BITS_TO_LONGS(EV_MAX)]; // NOLINT // fprintf(stderr,"/dev/input/%s\n", de->d_name); if (strncmp(de->d_name, "event", 5)) continue; @@ -175,8 +176,9 @@ int ev_get_input(int fd, uint32_t epevents, input_event* ev) { } int ev_sync_key_state(ev_set_key_callback set_key_cb, void* data) { - unsigned long ev_bits[BITS_TO_LONGS(EV_MAX)]; - unsigned long key_bits[BITS_TO_LONGS(KEY_MAX)]; + // Use unsigned long to match ioctl's parameter type. + unsigned long ev_bits[BITS_TO_LONGS(EV_MAX)]; // NOLINT + unsigned long key_bits[BITS_TO_LONGS(KEY_MAX)]; // NOLINT for (size_t i = 0; i < ev_dev_count; ++i) { memset(ev_bits, 0, sizeof(ev_bits)); @@ -203,8 +205,9 @@ int ev_sync_key_state(ev_set_key_callback set_key_cb, void* data) { } void ev_iterate_available_keys(std::function<void(int)> f) { - unsigned long ev_bits[BITS_TO_LONGS(EV_MAX)]; - unsigned long key_bits[BITS_TO_LONGS(KEY_MAX)]; + // Use unsigned long to match ioctl's parameter type. + unsigned long ev_bits[BITS_TO_LONGS(EV_MAX)]; // NOLINT + unsigned long key_bits[BITS_TO_LONGS(KEY_MAX)]; // NOLINT for (size_t i = 0; i < ev_dev_count; ++i) { memset(ev_bits, 0, sizeof(ev_bits)); |