diff options
author | Paul Selkirk <paul@psgd.org> | 2017-10-23 18:05:31 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2017-10-23 18:05:31 -0400 |
commit | ca84af553cbaae45b17cce04d457b2e61cc4277c (patch) | |
tree | 90f2bc5e96d2f1ae3fece3dfb9075edda08c4ace /rpc_misc.c | |
parent | 12a3c63b75044b207dd7982ce3ed170231bd4467 (diff) |
Cleanup signed/unsigned mismatches, mostly in loop counters
Diffstat (limited to 'rpc_misc.c')
-rw-r--r-- | rpc_misc.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -116,12 +116,12 @@ static inline hal_error_t alloc_slot(const hal_client_handle_t client, #if HAL_STATIC_CLIENT_STATE_BLOCKS > 0 - for (int i = 0; slot == NULL && i < sizeof(client_handle)/sizeof(*client_handle); i++) + for (size_t i = 0; slot == NULL && i < sizeof(client_handle)/sizeof(*client_handle); i++) if (client_handle[i].logged_in != HAL_USER_NONE && client_handle[i].handle.handle == client.handle) slot = &client_handle[i]; - for (int i = 0; slot == NULL && i < sizeof(client_handle)/sizeof(*client_handle); i++) + for (size_t i = 0; slot == NULL && i < sizeof(client_handle)/sizeof(*client_handle); i++) if (client_handle[i].logged_in == HAL_USER_NONE) slot = &client_handle[i]; @@ -161,7 +161,7 @@ static inline client_slot_t *find_handle(const hal_client_handle_t handle) hal_critical_section_start(); #if HAL_STATIC_CLIENT_STATE_BLOCKS > 0 - for (int i = 0; slot == NULL && i < sizeof(client_handle)/sizeof(*client_handle); i++) + for (size_t i = 0; slot == NULL && i < sizeof(client_handle)/sizeof(*client_handle); i++) if (client_handle[i].logged_in != HAL_USER_NONE && client_handle[i].handle.handle == handle.handle) slot = &client_handle[i]; #endif @@ -191,7 +191,7 @@ static hal_error_t login(const hal_client_handle_t client, return err; unsigned diff = 0; - for (int i = 0; i < sizeof(buf); i++) + for (size_t i = 0; i < sizeof(buf); i++) diff |= buf[i] ^ p->pin[i]; if (diff != 0) { @@ -227,7 +227,7 @@ static hal_error_t logout_all(void) client_slot_t *slot; hal_error_t err; - int i = 0; + size_t i = 0; do { |