aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libswo/decoder.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libswo/decoder.c b/libswo/decoder.c
index 9dd1ad9..b0c0227 100644
--- a/libswo/decoder.c
+++ b/libswo/decoder.c
@@ -183,11 +183,10 @@ static int decode_cond_payload(struct libswo_context *ctx, uint32_t *value)
static uint32_t decode_payload(const uint8_t *buffer, uint8_t size)
{
uint32_t tmp;
- unsigned int i;
tmp = 0;
- for (i = 0; i < size; i++)
+ for (unsigned int i = 0; i < size; i++)
tmp |= (buffer[i] << (i * 8));
return tmp;
@@ -196,7 +195,6 @@ static uint32_t decode_payload(const uint8_t *buffer, uint8_t size)
static bool decode_sync_packet(struct libswo_context *ctx)
{
size_t i;
- size_t j;
size_t num_bits;
uint8_t tmp;
@@ -215,7 +213,7 @@ static bool decode_sync_packet(struct libswo_context *ctx)
num_bits += 8;
}
- for (j = 0; j < 8; j++, num_bits++)
+ for (size_t j = 0; j < 8; j++, num_bits++)
if (tmp & (1 << j))
break;