summaryrefslogtreecommitdiff
path: root/src/offlinelogstorage
diff options
context:
space:
mode:
authorSebastian Lipponer <mail@sebastianlipponer.de>2019-12-10 13:24:07 +0100
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2019-12-10 21:24:07 +0900
commit52c275c51e253223230e235584ab07523a830303 (patch)
treedc9217e198ee96c94c9bb5f002c25540794ff9ee /src/offlinelogstorage
parentcd040a4ce1ea3d2008048083a862461596cd2cd2 (diff)
downloadDLT-daemon-52c275c51e253223230e235584ab07523a830303.tar.gz
Fix compiler warnings: pointer of type ‘void *’ used in arithmetic (#196)
Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
Diffstat (limited to 'src/offlinelogstorage')
-rw-r--r--src/offlinelogstorage/dlt_offline_logstorage_behavior.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/offlinelogstorage/dlt_offline_logstorage_behavior.c b/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
index 8b27111..3f7555e 100644
--- a/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
+++ b/src/offlinelogstorage/dlt_offline_logstorage_behavior.c
@@ -519,8 +519,8 @@ DLT_STATIC int dlt_logstorage_find_dlt_header(void *ptr,
char substring[] = { 'D', 'L', 'T', 0x01 };
while (cnt > 0) {
- if (*((char *)(ptr + offset + index)) == 'D') {
- if (strncmp(ptr + offset + index, substring, 4) == 0)
+ if (*((char *)ptr + offset + index) == 'D') {
+ if (strncmp((char *)ptr + offset + index, substring, 4) == 0)
return index;
}
@@ -548,9 +548,9 @@ DLT_STATIC int dlt_logstorage_find_last_dlt_header(void *ptr,
char substring[] = {'D', 'L', 'T', 0x01};
while(cnt > 0)
{
- if (*((char *)(ptr + offset + cnt)) == 'D')
+ if (*((char *)ptr + offset + cnt) == 'D')
{
- if (strncmp(ptr + offset + cnt, substring, 4) == 0)
+ if (strncmp((char *)ptr + offset + cnt, substring, 4) == 0)
{
return cnt;
}
@@ -653,7 +653,7 @@ DLT_STATIC int dlt_logstorage_sync_to_file(DltLogStorageFilterConfig *config,
}
}
- ret = fwrite(config->cache + start_offset + start_index, count, 1,
+ ret = fwrite((char *)config->cache + start_offset + start_index, count, 1,
config->log);
dlt_logstorage_check_write_ret(config, ret);
@@ -691,7 +691,7 @@ DLT_STATIC int dlt_logstorage_sync_to_file(DltLogStorageFilterConfig *config,
}
}
- ret = fwrite(config->cache + start_offset + start_index, count, 1,
+ ret = fwrite((char *)config->cache + start_offset + start_index, count, 1,
config->log);
dlt_logstorage_check_write_ret(config, ret);
@@ -962,7 +962,7 @@ int dlt_logstorage_write_msg_cache(DltLogStorageFilterConfig *config,
DltLogStorageCacheFooter *footer = NULL;
int msg_size;
int remain_cache_size;
- void *curr_write_addr = NULL;
+ char *curr_write_addr = NULL;
int ret = 0;
unsigned int cache_size;
@@ -983,7 +983,7 @@ int dlt_logstorage_write_msg_cache(DltLogStorageFilterConfig *config,
cache_size = config->file_size;
}
- footer = (DltLogStorageCacheFooter *)(config->cache + cache_size);
+ footer = (DltLogStorageCacheFooter *)((char *)config->cache + cache_size);
if (footer == NULL)
{
dlt_log(LOG_ERR, "Cannot retrieve cache footer. Address is NULL\n");
@@ -994,7 +994,7 @@ int dlt_logstorage_write_msg_cache(DltLogStorageFilterConfig *config,
if (msg_size <= remain_cache_size) /* add at current position */
{
- curr_write_addr = (void *)(config->cache + footer->offset);
+ curr_write_addr = (char *)config->cache + footer->offset;
footer->offset += msg_size;
if (footer->wrap_around_cnt < 1) {
footer->end_sync_offset = footer->offset;
@@ -1123,7 +1123,7 @@ int dlt_logstorage_sync_msg_cache(DltLogStorageFilterConfig *config,
cache_size = config->file_size;
}
- footer = (DltLogStorageCacheFooter *)(config->cache + cache_size);
+ footer = (DltLogStorageCacheFooter *)((char *)config->cache + cache_size);
if (footer == NULL)
{
dlt_log(LOG_ERR, "Cannot retrieve cache information\n");