From cd040a4ce1ea3d2008048083a862461596cd2cd2 Mon Sep 17 00:00:00 2001 From: Sebastian Lipponer Date: Mon, 25 Nov 2019 08:22:11 +0100 Subject: 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 --- src/gateway/dlt_gateway.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gateway') diff --git a/src/gateway/dlt_gateway.c b/src/gateway/dlt_gateway.c index 4c006f5..57d801b 100644 --- a/src/gateway/dlt_gateway.c +++ b/src/gateway/dlt_gateway.c @@ -971,7 +971,7 @@ DLT_STATIC DltReturnValue dlt_gateway_parse_get_log_info(DltDaemon *daemon, return DLT_RETURN_WRONG_PARAMETER; } - if (DLT_CHECK_RCV_DATA_SIZE(msg->datasize, sizeof(DltServiceGetLogInfoResponse)) < 0) + if (dlt_check_rcv_data_size(msg->datasize, sizeof(DltServiceGetLogInfoResponse)) < 0) return DLT_RETURN_ERROR; /* if the request was send from gateway, clear all application and context list */ @@ -1093,7 +1093,7 @@ DLT_STATIC int dlt_gateway_parse_get_default_log_level(DltDaemon *daemon, return DLT_RETURN_WRONG_PARAMETER; } - if (DLT_CHECK_RCV_DATA_SIZE(msg->datasize, + if (dlt_check_rcv_data_size(msg->datasize, sizeof(DltServiceGetDefaultLogLevelResponse)) < 0) { dlt_log(LOG_ERR, "Received data incomplete.\n"); return DLT_RETURN_ERROR; -- cgit v1.2.1