Skip to content

Commit

Permalink
Remove const from request parameter of decoding functions.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jvalenzuela authored and MartinMelikMerkumians committed Oct 18, 2023
1 parent c8c1fc5 commit aeab220
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
30 changes: 15 additions & 15 deletions source/src/cip/cipcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
30 changes: 15 additions & 15 deletions source/src/opener_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,67 +471,67 @@ 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,
const CipMessageRouterRequest *const message_router_request,
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,
Expand Down

0 comments on commit aeab220

Please sign in to comment.