diff options
author | Sebastian Lipponer <mail@sebastianlipponer.de> | 2019-11-25 08:22:11 +0100 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2019-11-25 16:22:11 +0900 |
commit | cd040a4ce1ea3d2008048083a862461596cd2cd2 (patch) | |
tree | 9962ef9fd7ff7627322f34dbfd83614b7d8e6ec9 /src/shared | |
parent | 346781ff633aee48eee5700a0b379d97cf86c935 (diff) | |
download | DLT-daemon-cd040a4ce1ea3d2008048083a862461596cd2cd2.tar.gz |
Change the DLT_CHECK_RCV_DATA_SIZE macro to an internal function (#191)
The use of this macro in a if condition is actually non-standard C++
code. GCC issues a warning that ISO C++ forbids braced-groups within
expressions when compiled with -Wpedantic. Other compilers fail with an
error. Change the macro to an internal function in order to improve the
portability to other platforms (i.e. MSVC, proprietary embedded).
Signed-off-by: Sebastian Lipponer <mail@sebastianlipponer.de>
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/dlt_common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c index 42ba516..b4916ed 100644 --- a/src/shared/dlt_common.c +++ b/src/shared/dlt_common.c @@ -2110,6 +2110,16 @@ DltReturnValue dlt_set_storageheader(DltStorageHeader *storageheader, const char return DLT_RETURN_OK; } +DltReturnValue dlt_check_rcv_data_size(int received, int required) +{ + int _ret = DLT_RETURN_OK; + if ((received - required) < 0) { + dlt_vlog(LOG_WARNING, "%s: Received data not complete\n", __func__); + _ret = DLT_RETURN_ERROR; + } + return _ret; +} + DltReturnValue dlt_check_storageheader(DltStorageHeader *storageheader) { if (storageheader == NULL) |