Skip to content

Commit

Permalink
Merge pull request nasa#919 from CDKnightNASA/fix-888-return_code
Browse files Browse the repository at this point in the history
Fix nasa#888, Add typedef for function return status codes
  • Loading branch information
astrogeco authored Oct 2, 2020
2 parents 7e755c3 + 3715b61 commit 5d5cfac
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 161 deletions.
6 changes: 6 additions & 0 deletions fsw/cfe-core/src/inc/cfe_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
/* Include Files */
#include "osapi.h"

/*
* Define a type for readability.
*/

typedef int32 CFE_Status_t;

/*
** Status Codes are 32 bit values formatted as follows:
**
Expand Down
88 changes: 44 additions & 44 deletions fsw/cfe-core/src/inc/cfe_es.h

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions fsw/cfe-core/src/inc/cfe_evs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

/********************************** Include Files ************************************/
#include "cfe_evs_extern_typedefs.h"
#include "cfe_error.h"
#include "common_types.h" /* Basic data types */
#include "cfe_time.h" /* Time library function definitions */
#include "cfe_evs_msg.h" /* EVS command codes and data structures*/
Expand Down Expand Up @@ -139,7 +140,7 @@ typedef struct CFE_EVS_BinFilter {
** \sa #CFE_EVS_Unregister
**
**/
int32 CFE_EVS_Register (void *Filters, /* Pointer to an array of filters */
CFE_Status_t CFE_EVS_Register (void *Filters, /* Pointer to an array of filters */
uint16 NumFilteredEvents, /* How many elements in the array? */
uint16 FilterScheme); /* Filtering Algorithm to be implemented */

Expand All @@ -163,7 +164,7 @@ int32 CFE_EVS_Register (void *Filters, /* Pointer to a
** \sa #CFE_EVS_Register
**
**/
int32 CFE_EVS_Unregister( void );
CFE_Status_t CFE_EVS_Unregister( void );
/**@}*/

/** @defgroup CFEAPIEVSSend cFE Send Event APIs
Expand Down Expand Up @@ -212,9 +213,9 @@ int32 CFE_EVS_Unregister( void );
** \sa #CFE_EVS_SendEventWithAppID, #CFE_EVS_SendTimedEvent
**
**/
int32 CFE_EVS_SendEvent (uint16 EventID,
uint16 EventType,
const char *Spec, ... ) OS_PRINTF(3,4);
CFE_Status_t CFE_EVS_SendEvent (uint16 EventID,
uint16 EventType,
const char *Spec, ... ) OS_PRINTF(3,4);


/**
Expand Down Expand Up @@ -263,10 +264,10 @@ int32 CFE_EVS_SendEvent (uint16 EventID,
** \sa #CFE_EVS_SendEvent, #CFE_EVS_SendTimedEvent
**
**/
int32 CFE_EVS_SendEventWithAppID (uint16 EventID,
uint16 EventType,
CFE_ES_ResourceID_t AppID,
const char *Spec, ... ) OS_PRINTF(4,5);
CFE_Status_t CFE_EVS_SendEventWithAppID (uint16 EventID,
uint16 EventType,
CFE_ES_ResourceID_t AppID,
const char *Spec, ... ) OS_PRINTF(4,5);


/**
Expand Down Expand Up @@ -315,10 +316,10 @@ int32 CFE_EVS_SendEventWithAppID (uint16 EventID,
** \sa #CFE_EVS_SendEvent, #CFE_EVS_SendEventWithAppID
**
**/
int32 CFE_EVS_SendTimedEvent (CFE_TIME_SysTime_t Time,
uint16 EventID,
uint16 EventType,
const char *Spec, ... ) OS_PRINTF(4,5);
CFE_Status_t CFE_EVS_SendTimedEvent (CFE_TIME_SysTime_t Time,
uint16 EventID,
uint16 EventType,
const char *Spec, ... ) OS_PRINTF(4,5);
/**@}*/

/** @defgroup CFEAPIEVSResetFilter cFE Reset Event Filter APIs
Expand Down Expand Up @@ -346,7 +347,7 @@ int32 CFE_EVS_SendTimedEvent (CFE_TIME_SysTime_t Time,
** \sa #CFE_EVS_ResetAllFilters
**
**/
int32 CFE_EVS_ResetFilter (int16 EventID);
CFE_Status_t CFE_EVS_ResetFilter (int16 EventID);


/**
Expand All @@ -367,7 +368,7 @@ int32 CFE_EVS_ResetFilter (int16 EventID);
** \sa #CFE_EVS_ResetFilter
**
**/
int32 CFE_EVS_ResetAllFilters ( void );
CFE_Status_t CFE_EVS_ResetAllFilters ( void );
/**@}*/


Expand Down
9 changes: 5 additions & 4 deletions fsw/cfe-core/src/inc/cfe_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
** Required header files...
*/
#include "cfe_fs_extern_typedefs.h"
#include "cfe_error.h"
#include "common_types.h"
#include "cfe_time.h"

Expand Down Expand Up @@ -70,7 +71,7 @@
** \sa #CFE_FS_WriteHeader
**
******************************************************************************/
int32 CFE_FS_ReadHeader(CFE_FS_Header_t *Hdr, osal_id_t FileDes);
CFE_Status_t CFE_FS_ReadHeader(CFE_FS_Header_t *Hdr, osal_id_t FileDes);

/*****************************************************************************/
/**
Expand Down Expand Up @@ -128,7 +129,7 @@ void CFE_FS_InitHeader(CFE_FS_Header_t *Hdr, const char *Description, uint32 Sub
** \sa #CFE_FS_ReadHeader
**
******************************************************************************/
int32 CFE_FS_WriteHeader(osal_id_t FileDes, CFE_FS_Header_t *Hdr);
CFE_Status_t CFE_FS_WriteHeader(osal_id_t FileDes, CFE_FS_Header_t *Hdr);

/*****************************************************************************/
/**
Expand All @@ -153,7 +154,7 @@ int32 CFE_FS_WriteHeader(osal_id_t FileDes, CFE_FS_Header_t *Hdr);
** \return Execution status, see \ref CFEReturnCodes
**
******************************************************************************/
int32 CFE_FS_SetTimestamp(osal_id_t FileDes, CFE_TIME_SysTime_t NewTimestamp);
CFE_Status_t CFE_FS_SetTimestamp(osal_id_t FileDes, CFE_TIME_SysTime_t NewTimestamp);
/**@}*/


Expand Down Expand Up @@ -181,7 +182,7 @@ int32 CFE_FS_SetTimestamp(osal_id_t FileDes, CFE_TIME_SysTime_t NewTimestamp);
** \return Execution status, see \ref CFEReturnCodes
**
******************************************************************************/
int32 CFE_FS_ExtractFilenameFromPath(const char *OriginalPath, char *FileNameOnly);
CFE_Status_t CFE_FS_ExtractFilenameFromPath(const char *OriginalPath, char *FileNameOnly);
/**@}*/

#endif /* _cfe_fs_ */
Expand Down
Loading

0 comments on commit 5d5cfac

Please sign in to comment.