From f7db9af41b2280d44c39a8aa506da5345d549301 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 1 Jun 2021 15:07:40 -0400 Subject: [PATCH] Fix #1062, const correct OS_SelectFdIsSet This function does not modify its "Set" argument, therefore it should be qualified as "const". --- src/os/inc/osapi-select.h | 2 +- src/os/shared/src/osapi-select.c | 2 +- src/ut-stubs/osapi-select-stubs.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/os/inc/osapi-select.h b/src/os/inc/osapi-select.h index ac3b0c296..ee4e127cd 100644 --- a/src/os/inc/osapi-select.h +++ b/src/os/inc/osapi-select.h @@ -161,7 +161,7 @@ int32 OS_SelectFdClear(OS_FdSet *Set, osal_id_t objid); * @retval true FdSet structure contains ID * @retval false FDSet structure does not contain ID */ -bool OS_SelectFdIsSet(OS_FdSet *Set, osal_id_t objid); +bool OS_SelectFdIsSet(const OS_FdSet *Set, osal_id_t objid); /**@}*/ #endif /* OSAPI_SELECT_H */ diff --git a/src/os/shared/src/osapi-select.c b/src/os/shared/src/osapi-select.c index 5d346eb66..e03b7050f 100644 --- a/src/os/shared/src/osapi-select.c +++ b/src/os/shared/src/osapi-select.c @@ -190,7 +190,7 @@ int32 OS_SelectFdClear(OS_FdSet *Set, osal_id_t objid) * See description in API and header file for detail * *-----------------------------------------------------------------*/ -bool OS_SelectFdIsSet(OS_FdSet *Set, osal_id_t objid) +bool OS_SelectFdIsSet(const OS_FdSet *Set, osal_id_t objid) { int32 return_code; osal_index_t local_id; diff --git a/src/ut-stubs/osapi-select-stubs.c b/src/ut-stubs/osapi-select-stubs.c index 9b9375965..7c6ab31af 100644 --- a/src/ut-stubs/osapi-select-stubs.c +++ b/src/ut-stubs/osapi-select-stubs.c @@ -66,11 +66,11 @@ int32 OS_SelectFdClear(OS_FdSet *Set, osal_id_t objid) * Generated stub function for OS_SelectFdIsSet() * ---------------------------------------------------- */ -bool OS_SelectFdIsSet(OS_FdSet *Set, osal_id_t objid) +bool OS_SelectFdIsSet(const OS_FdSet *Set, osal_id_t objid) { UT_GenStub_SetupReturnBuffer(OS_SelectFdIsSet, bool); - UT_GenStub_AddParam(OS_SelectFdIsSet, OS_FdSet *, Set); + UT_GenStub_AddParam(OS_SelectFdIsSet, const OS_FdSet *, Set); UT_GenStub_AddParam(OS_SelectFdIsSet, osal_id_t, objid); UT_GenStub_Execute(OS_SelectFdIsSet, Basic, NULL);