Skip to content

Commit

Permalink
Merge pull request nasa#1133 from skliper/fix723-filter_truncation
Browse files Browse the repository at this point in the history
Fix nasa#723, CFE_EVS_Register const correct and report truncation
  • Loading branch information
astrogeco authored Feb 3, 2021
2 parents 64aeec0 + b50cd5b commit 4936a5d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion fsw/cfe-core/src/evs/cfe_evs.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
/*
** Function: CFE_EVS_Register - See API and header file for details
*/
int32 CFE_EVS_Register (void *Filters, uint16 NumEventFilters, uint16 FilterScheme)
int32 CFE_EVS_Register (const void *Filters, uint16 NumEventFilters, uint16 FilterScheme)
{
uint16 FilterLimit;
uint16 i;
Expand Down Expand Up @@ -89,6 +89,8 @@ int32 CFE_EVS_Register (void *Filters, uint16 NumEventFilters, uint16 FilterSche
else
{
FilterLimit = CFE_PLATFORM_EVS_MAX_EVENT_FILTERS;
CFE_ES_WriteToSysLog("CFE_EVS_Register: Filter limit truncated to %d\n",
(int)FilterLimit);
}

if (Filters != NULL)
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/inc/cfe_evs.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ typedef struct CFE_EVS_BinFilter {
** \sa #CFE_EVS_Unregister
**
**/
CFE_Status_t CFE_EVS_Register (void *Filters, /* Pointer to an array of filters */
CFE_Status_t CFE_EVS_Register (const void *Filters, /* Pointer to an array of filters */
uint16 NumFilteredEvents, /* How many elements in the array? */
uint16 FilterScheme); /* Filtering Algorithm to be implemented */

Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/ut-stubs/ut_evs_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ int32 CFE_EVS_SendTimedEvent(CFE_TIME_SysTime_t Time,
** Returns either a user-defined status flag or CFE_SUCCESS.
**
******************************************************************************/
int32 CFE_EVS_Register(void *Filters,
int32 CFE_EVS_Register(const void *Filters,
uint16 NumFilteredEvents,
uint16 FilterScheme)
{
Expand Down

0 comments on commit 4936a5d

Please sign in to comment.