Skip to content

Commit

Permalink
Fix nasa#1062, const correct OS_SelectFdIsSet
Browse files Browse the repository at this point in the history
This function does not modify its "Set" argument, therefore
it should be qualified as "const".
  • Loading branch information
jphickey committed Jun 1, 2021
1 parent 6776050 commit f7db9af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/os/inc/osapi-select.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion src/os/shared/src/osapi-select.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/ut-stubs/osapi-select-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f7db9af

Please sign in to comment.