From aeab22031c753b54e2f0c773dfe986e965e36b57 Mon Sep 17 00:00:00 2001 From: Jason Valenzuela Date: Sat, 8 Jan 2022 10:29:26 -0500 Subject: [PATCH] Remove const from request parameter of decoding functions. These functions advance the message_router_request->data pointer, which means that parameter cannot be const. Resolves const qualifier compiler warnings, e.g. Visual Studio C4090. --- source/src/cip/cipcommon.c | 30 +++++++++++++++--------------- source/src/opener_api.h | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/source/src/cip/cipcommon.c b/source/src/cip/cipcommon.c index fac06ffea..488c2a783 100644 --- a/source/src/cip/cipcommon.c +++ b/source/src/cip/cipcommon.c @@ -844,7 +844,7 @@ EipStatus SetAttributeSingle(CipInstance *RESTRICT const instance, } int DecodeCipBool(CipBool *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetBoolFromMessage(&message_router_request->data); @@ -853,7 +853,7 @@ int DecodeCipBool(CipBool *const data, } int DecodeCipByte(CipByte *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetByteFromMessage(&message_router_request->data); @@ -893,7 +893,7 @@ int DecodeCipByteArray(CipByteArray *const data, } int DecodeCipWord(CipWord *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetWordFromMessage(&message_router_request->data); @@ -902,7 +902,7 @@ int DecodeCipWord(CipWord *const data, } int DecodeCipDword(CipDword *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetDintFromMessage(&message_router_request->data); @@ -911,7 +911,7 @@ int DecodeCipDword(CipDword *const data, } int DecodeCipLword(CipLword *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetLintFromMessage(&message_router_request->data); @@ -920,7 +920,7 @@ int DecodeCipLword(CipLword *const data, } int DecodeCipUsint(CipUsint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetUsintFromMessage(&message_router_request->data); @@ -929,7 +929,7 @@ int DecodeCipUsint(CipUsint *const data, } int DecodeCipUint(CipUint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetUintFromMessage(&message_router_request->data); @@ -938,7 +938,7 @@ int DecodeCipUint(CipUint *const data, } int DecodeCipUdint(CipUdint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetUdintFromMessage(&message_router_request->data); @@ -947,7 +947,7 @@ int DecodeCipUdint(CipUdint *const data, } int DecodeCipUlint(CipUlint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetLintFromMessage(&message_router_request->data); @@ -956,7 +956,7 @@ int DecodeCipUlint(CipUlint *const data, } int DecodeCipSint(CipSint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetSintFromMessage(&message_router_request->data); @@ -965,7 +965,7 @@ int DecodeCipSint(CipSint *const data, } int DecodeCipInt(CipInt *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetIntFromMessage(&message_router_request->data); @@ -974,7 +974,7 @@ int DecodeCipInt(CipInt *const data, } int DecodeCipDint(CipDint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetDintFromMessage(&message_router_request->data); @@ -983,7 +983,7 @@ int DecodeCipDint(CipDint *const data, } int DecodeCipLint(CipLint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetLintFromMessage(&message_router_request->data); @@ -992,7 +992,7 @@ int DecodeCipLint(CipLint *const data, } int DecodeCipReal(CipReal *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetDintFromMessage(&message_router_request->data); @@ -1001,7 +1001,7 @@ int DecodeCipReal(CipReal *const data, } int DecodeCipLreal(CipLreal *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response) { *data = GetLintFromMessage(&message_router_request->data); diff --git a/source/src/opener_api.h b/source/src/opener_api.h index 07c6e2102..643899b54 100644 --- a/source/src/opener_api.h +++ b/source/src/opener_api.h @@ -471,11 +471,11 @@ void EncodeCipEthernetLinkPhyisicalAddress(const void *const data, * -1 .. error */ int DecodeCipBool(CipBool *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipByte(CipByte *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipByteArray(CipByteArray *const data, @@ -483,55 +483,55 @@ int DecodeCipByteArray(CipByteArray *const data, CipMessageRouterResponse *const message_router_response); int DecodeCipWord(CipWord *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipDword(CipDword *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipLword(CipLword *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipUsint(CipUsint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipUint(CipUint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipUdint(CipUdint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipUlint(CipUlint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipSint(CipSint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipInt(CipInt *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipDint(CipDint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipLint(CipLint *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipReal(CipReal *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipLreal(CipLreal *const data, - const CipMessageRouterRequest *const message_router_request, + CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response); int DecodeCipString(CipString *const data,