diff --git a/fsw/cfe-core/src/inc/cfe_es.h b/fsw/cfe-core/src/inc/cfe_es.h index 6c47987a6..4656898e6 100644 --- a/fsw/cfe-core/src/inc/cfe_es.h +++ b/fsw/cfe-core/src/inc/cfe_es.h @@ -116,7 +116,11 @@ * - Convert ID to simple integer (typically for printing/logging) * - Convert simple integer to ID (inverse of above) */ -typedef uint32 CFE_ES_ResourceID_t; +typedef struct CFE_ES_ResourceID +{ + uint32 Val; +} CFE_ES_ResourceID_t; + /** * \brief Memory Handle type @@ -150,7 +154,7 @@ typedef uint32 CFE_ES_MemOffset_t; * type via standard functions like memset(), such that objects initialzed * using this method will also be set to safe values. */ -#define CFE_ES_RESOURCEID_UNDEFINED ((CFE_ES_ResourceID_t)0) +#define CFE_ES_RESOURCEID_UNDEFINED ((CFE_ES_ResourceID_t){0}) /** * @brief A resource ID value that represents a reserved entry @@ -159,7 +163,7 @@ typedef uint32 CFE_ES_MemOffset_t; * table entries that are not available for use. For instance, this may * be used while setting up an entry initially. */ -#define CFE_ES_RESOURCEID_RESERVED ((CFE_ES_ResourceID_t)0xFFFFFFFF) +#define CFE_ES_RESOURCEID_RESERVED ((CFE_ES_ResourceID_t){0xFFFFFFFF}) /** * @brief Convert a resource ID to an integer. @@ -185,7 +189,7 @@ typedef uint32 CFE_ES_MemOffset_t; */ static inline unsigned long CFE_ES_ResourceID_ToInteger(CFE_ES_ResourceID_t id) { - return ((unsigned long)id); + return (id.Val); } /** @@ -204,7 +208,7 @@ static inline unsigned long CFE_ES_ResourceID_ToInteger(CFE_ES_ResourceID_t id) */ static inline CFE_ES_ResourceID_t CFE_ES_ResourceID_FromInteger(unsigned long Value) { - return ((CFE_ES_ResourceID_t)Value); + return ((CFE_ES_ResourceID_t){ .Val = Value }); } /** @@ -216,7 +220,7 @@ static inline CFE_ES_ResourceID_t CFE_ES_ResourceID_FromInteger(unsigned long Va */ static inline bool CFE_ES_ResourceID_Equal(CFE_ES_ResourceID_t id1, CFE_ES_ResourceID_t id2) { - return (id1 == id2); + return (id1.Val == id2.Val); } /** @@ -234,7 +238,7 @@ static inline bool CFE_ES_ResourceID_Equal(CFE_ES_ResourceID_t id1, CFE_ES_Resou */ static inline bool CFE_ES_ResourceID_IsDefined(CFE_ES_ResourceID_t id) { - return (id != 0); + return (id.Val != 0); } /**