From f9f18a7bcd28ae2d32a1956c7c6517921cca9f89 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 27 Oct 2020 12:25:35 -0400 Subject: [PATCH] Fix #370, rename MAX CDS name macro to FULL_NAME_LEN Simple replacement of CFE_MISSION_ES_CDS_MAX_NAME_LEN with CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN, to differentiate it from CFE_MISSION_ES_CDS_MAX_NAME_LENGTH - which is the CDS name without the app name. --- cmake/sample_defs/sample_mission_cfg.h | 2 +- fsw/cfe-core/src/es/cfe_es_api.c | 2 +- fsw/cfe-core/src/es/cfe_es_cds.h | 2 +- fsw/cfe-core/src/es/cfe_es_task.c | 4 ++-- fsw/cfe-core/src/es/cfe_es_verify.h | 4 ++-- fsw/cfe-core/src/inc/cfe_es_msg.h | 4 ++-- fsw/cfe-core/unit-test/es_UT.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/sample_defs/sample_mission_cfg.h b/cmake/sample_defs/sample_mission_cfg.h index 02d3c20b4..85d57ad2f 100644 --- a/cmake/sample_defs/sample_mission_cfg.h +++ b/cmake/sample_defs/sample_mission_cfg.h @@ -610,7 +610,7 @@ ** This value should be kept as a multiple of 4, to maintain alignment of ** any possible neighboring fields without implicit padding. */ -#define CFE_MISSION_ES_CDS_MAX_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4) +#define CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4) diff --git a/fsw/cfe-core/src/es/cfe_es_api.c b/fsw/cfe-core/src/es/cfe_es_api.c index c296fdac5..9cda0f38d 100644 --- a/fsw/cfe-core/src/es/cfe_es_api.c +++ b/fsw/cfe-core/src/es/cfe_es_api.c @@ -1544,7 +1544,7 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, CFE_ES_CDS_Offset_t B CFE_ES_ResourceID_t ThisAppId; char AppName[OS_MAX_API_NAME] = {"UNKNOWN"}; - char CDSName[CFE_MISSION_ES_CDS_MAX_NAME_LEN] = {""}; + char CDSName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN] = {""}; /* Initialize output to safe value, in case this fails */ *CDSHandlePtr = CFE_ES_RESOURCEID_UNDEFINED; diff --git a/fsw/cfe-core/src/es/cfe_es_cds.h b/fsw/cfe-core/src/es/cfe_es_cds.h index 806f29031..2f3ac1a63 100644 --- a/fsw/cfe-core/src/es/cfe_es_cds.h +++ b/fsw/cfe-core/src/es/cfe_es_cds.h @@ -115,7 +115,7 @@ typedef struct CFE_ES_ResourceID_t BlockID; /**< Abstract ID associated with this CDS block */ CFE_ES_CDS_Offset_t BlockOffset; /**< Start offset of the block in CDS memory */ CFE_ES_CDS_Offset_t BlockSize; /**< Size, in bytes, of the CDS memory block */ - char Name[CFE_MISSION_ES_CDS_MAX_NAME_LEN]; + char Name[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; bool Table; /**< \brief Flag that indicates whether CDS contains a Critical Table */ } CFE_ES_CDS_RegRec_t; diff --git a/fsw/cfe-core/src/es/cfe_es_task.c b/fsw/cfe-core/src/es/cfe_es_task.c index d1fabc6cc..7365909fe 100644 --- a/fsw/cfe-core/src/es/cfe_es_task.c +++ b/fsw/cfe-core/src/es/cfe_es_task.c @@ -1680,10 +1680,10 @@ int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDS_t *data) { int32 Status; const CFE_ES_DeleteCDSCmd_Payload_t *cmd = &data->Payload; - char LocalCdsName[CFE_MISSION_ES_CDS_MAX_NAME_LEN]; + char LocalCdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; CFE_SB_MessageStringGet(LocalCdsName, (char *)cmd->CdsName, NULL, - CFE_MISSION_ES_CDS_MAX_NAME_LEN, sizeof(cmd->CdsName)); + CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN, sizeof(cmd->CdsName)); Status = CFE_ES_DeleteCDS(LocalCdsName, false); diff --git a/fsw/cfe-core/src/es/cfe_es_verify.h b/fsw/cfe-core/src/es/cfe_es_verify.h index 51aaa2364..8434e077c 100644 --- a/fsw/cfe-core/src/es/cfe_es_verify.h +++ b/fsw/cfe-core/src/es/cfe_es_verify.h @@ -362,8 +362,8 @@ #if ((CFE_MISSION_ES_CDS_MAX_NAME_LENGTH % 4) != 0) #error CFE_MISSION_ES_CDS_MAX_NAME_LENGTH must be a multiple of 4 #endif -#if ((CFE_MISSION_ES_CDS_MAX_NAME_LEN % 4) != 0) - #error CFE_MISSION_ES_CDS_MAX_NAME_LEN must be a multiple of 4 +#if ((CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN % 4) != 0) + #error CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN must be a multiple of 4 #endif diff --git a/fsw/cfe-core/src/inc/cfe_es_msg.h b/fsw/cfe-core/src/inc/cfe_es_msg.h index 602bc058f..5f6b71ff3 100644 --- a/fsw/cfe-core/src/inc/cfe_es_msg.h +++ b/fsw/cfe-core/src/inc/cfe_es_msg.h @@ -1256,7 +1256,7 @@ typedef struct CFE_ES_SetMaxPRCount **/ typedef struct CFE_ES_DeleteCDSCmd_Payload { - char CdsName[CFE_MISSION_ES_CDS_MAX_NAME_LEN]; /**< \brief ASCII text string containing name of CDS to delete */ + char CdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief ASCII text string containing name of CDS to delete */ } CFE_ES_DeleteCDSCmd_Payload_t; @@ -1477,7 +1477,7 @@ typedef struct CFE_ES_CDSRegDumpRec CFE_ES_CDSHandle_t Handle; /**< \brief Handle of CDS */ CFE_ES_CDS_Offset_t Size; /**< \brief Size, in bytes, of the CDS memory block */ bool Table; /**< \brief Flag that indicates whether CDS contains a Critical Table */ - char Name[CFE_MISSION_ES_CDS_MAX_NAME_LEN]; /**< \brief Processor Unique Name of CDS */ + char Name[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; /**< \brief Processor Unique Name of CDS */ uint8 ByteAlignSpare[3]; /**< \brief Spare bytes to ensure structure size is multiple of 4 bytes */ } CFE_ES_CDSRegDumpRec_t; diff --git a/fsw/cfe-core/unit-test/es_UT.c b/fsw/cfe-core/unit-test/es_UT.c index 8384236b3..9c36de00e 100644 --- a/fsw/cfe-core/unit-test/es_UT.c +++ b/fsw/cfe-core/unit-test/es_UT.c @@ -5394,7 +5394,7 @@ void TestCDS() { uint32 CdsSize; uint8 *CdsPtr; - char CDSName[CFE_MISSION_ES_CDS_MAX_NAME_LEN + 4]; + char CDSName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN + 4]; CFE_ES_CDSHandle_t CDSHandle; CFE_ES_CDS_RegRec_t *UtCDSRegRecPtr; uint32 i;