From 0949599f0aac9df78ab9a5e28a568dbaf8978101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 14 Jul 2017 10:32:20 +0200 Subject: [PATCH] dataman: fix compilation error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit error: invalid conversion from ‘int’ to ‘dm_item_t’ and error: no ‘operator++(int)’ declared for postfix ‘++’ --- src/modules/dataman/dataman.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/dataman/dataman.cpp b/src/modules/dataman/dataman.cpp index daa4d83ac9..c455ad7b2b 100644 --- a/src/modules/dataman/dataman.cpp +++ b/src/modules/dataman/dataman.cpp @@ -770,7 +770,7 @@ static int _ram_restart(dm_reset_reason reason) /* Loop through all of the data segments and delete those that are not persistent */ - for (dm_item_t item = DM_KEY_SAFE_POINTS; item < DM_KEY_NUM_KEYS; item++) { + for (int item = (int)DM_KEY_SAFE_POINTS; item < (int)DM_KEY_NUM_KEYS; item++) { for (unsigned i = 0; i < g_per_item_max_index[item]; i++) { /* check if segment contains data */ if (buffer[0]) { @@ -809,7 +809,7 @@ _file_restart(dm_reset_reason reason) /* We need to scan the entire file and invalidate and data that should not persist after the last reset */ /* Loop through all of the data segments and delete those that are not persistent */ - for (dm_item_t item = DM_KEY_SAFE_POINTS; item < DM_KEY_NUM_KEYS; item++) { + for (int item = (int)DM_KEY_SAFE_POINTS; item < (int)DM_KEY_NUM_KEYS; item++) { for (unsigned i = 0; i < g_per_item_max_index[item]; i++) { /* Get data segment at current offset */ if (lseek(dm_operations_data.file.fd, offset, SEEK_SET) != offset) { @@ -1252,7 +1252,7 @@ task_main(int argc, char *argv[]) /* Initialize global variables */ g_key_offsets[0] = 0; - for (dm_item_t i = 0; i < (DM_KEY_NUM_KEYS - 1); i++) { + for (int i = 0; i < ((int)DM_KEY_NUM_KEYS - 1); i++) { g_key_offsets[i + 1] = g_key_offsets[i] + (g_per_item_max_index[i] * g_per_item_size[i]); }