From 6cde7b4d2e6bbc337912d706dfc163296a6f7c2d Mon Sep 17 00:00:00 2001 From: Avi Date: Fri, 24 Feb 2023 12:42:33 +1000 Subject: [PATCH] Fix #379, Align mismatched function prototype/implem. parameter names --- fsw/mcp750-vxworks/src/cfe_psp_support.c | 6 +++--- fsw/pc-linux/src/cfe_psp_support.c | 8 ++++---- fsw/pc-rtems/src/cfe_psp_support.c | 4 ++-- fsw/shared/src/cfe_psp_memutils.c | 18 +++++++++--------- .../src/coveragetest-cfe-psp-support.c | 2 +- ut-stubs/ut_psp_stubs.c | 14 +++++++------- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/fsw/mcp750-vxworks/src/cfe_psp_support.c b/fsw/mcp750-vxworks/src/cfe_psp_support.c index b912c94c..ef47232f 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_support.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_support.c @@ -77,15 +77,15 @@ extern CFE_PSP_MemoryBlock_t MCP750_ReservedMemBlock; ** Provides a common interface to the processor reset. ** ** Arguments: -** reset_type : Type of reset. +** resetType : Type of reset. ** ** Return: ** (none) */ -void CFE_PSP_Restart(uint32 reset_type) +void CFE_PSP_Restart(uint32 resetType) { - if (reset_type == CFE_PSP_RST_TYPE_POWERON) + if (resetType == CFE_PSP_RST_TYPE_POWERON) { CFE_PSP_ReservedMemoryMap.BootPtr->bsp_reset_type = CFE_PSP_RST_TYPE_POWERON; CFE_PSP_FlushCaches(1, MCP750_ReservedMemBlock.BlockPtr, MCP750_ReservedMemBlock.BlockSize); diff --git a/fsw/pc-linux/src/cfe_psp_support.c b/fsw/pc-linux/src/cfe_psp_support.c index 59e39da5..c2e9f6a8 100644 --- a/fsw/pc-linux/src/cfe_psp_support.c +++ b/fsw/pc-linux/src/cfe_psp_support.c @@ -57,15 +57,15 @@ extern char CFE_PSP_CpuName[]; ** Provides a common interface to the processor reset. ** ** Arguments: -** reset_type : Type of reset. +** resetType : Type of reset. ** ** Return: ** (none) */ -void CFE_PSP_Restart(uint32 reset_type) +void CFE_PSP_Restart(uint32 resetType) { - if (reset_type == CFE_PSP_RST_TYPE_POWERON) + if (resetType == CFE_PSP_RST_TYPE_POWERON) { OS_printf("CFE_PSP: Exiting cFE with POWERON Reset status.\n"); @@ -81,7 +81,7 @@ void CFE_PSP_Restart(uint32 reset_type) /* * Record the reset type for the next boot. */ - CFE_PSP_ReservedMemoryMap.BootPtr->NextResetType = reset_type; + CFE_PSP_ReservedMemoryMap.BootPtr->NextResetType = resetType; CFE_PSP_ReservedMemoryMap.BootPtr->ValidityFlag = CFE_PSP_BOOTRECORD_VALID; /* diff --git a/fsw/pc-rtems/src/cfe_psp_support.c b/fsw/pc-rtems/src/cfe_psp_support.c index b72bc0d4..cf4896d9 100644 --- a/fsw/pc-rtems/src/cfe_psp_support.c +++ b/fsw/pc-rtems/src/cfe_psp_support.c @@ -71,13 +71,13 @@ extern CFE_PSP_MemoryBlock_t PcRtems_ReservedMemBlock; ** Provides a common interface to the processor reset. ** ** Arguments: -** reset_type : Type of reset. +** resetType : Type of reset. ** ** Return: ** (none) */ -void CFE_PSP_Restart(uint32 reset_type) +void CFE_PSP_Restart(uint32 resetType) { CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize); OS_printf("CFE_PSP_Restart is not implemented on this platform ( yet ! )\n"); diff --git a/fsw/shared/src/cfe_psp_memutils.c b/fsw/shared/src/cfe_psp_memutils.c index 32ffd654..a4dae498 100644 --- a/fsw/shared/src/cfe_psp_memutils.c +++ b/fsw/shared/src/cfe_psp_memutils.c @@ -48,15 +48,15 @@ /* ** ** Purpose: -** Copies 'size' byte from memory address pointed by 'src' to memory -** address pointed by ' dst' For now we are using the standard c library +** Copies 'n' byte from memory address pointed by 'src' to memory +** address pointed by ' dest' For now we are using the standard c library ** call 'memcpy' but if we find we need to make it more efficient then ** we'll implement it in assembly. ** ** Assumptions and Notes: ** ** Parameters: -** dst : pointer to an address to copy to +** dest : pointer to an address to copy to ** src : pointer address to copy from ** ** Global Inputs: None @@ -66,17 +66,17 @@ ** ** Return Values: CFE_PSP_SUCCESS */ -int32 CFE_PSP_MemCpy(void *dst, const void *src, uint32 size) +int32 CFE_PSP_MemCpy(void *dest, const void *src, uint32 n) { - memcpy(dst, src, size); + memcpy(dest, src, n); return CFE_PSP_SUCCESS; } /* ** ** Purpose: -** Copies 'size' number of byte of value 'value' to memory address pointed -** by 'dst' .For now we are using the standard c library call 'memset' +** Copies 'n' number of byte of value 'value' to memory address pointed +** by 'dest' .For now we are using the standard c library call 'memset' ** but if we find we need to make it more efficient then we'll implement ** it in assembly. ** @@ -95,8 +95,8 @@ int32 CFE_PSP_MemCpy(void *dst, const void *src, uint32 size) /* ** CFE_PSP_MemSet */ -int32 CFE_PSP_MemSet(void *dst, uint8 value, uint32 size) +int32 CFE_PSP_MemSet(void *dest, uint8 value, uint32 n) { - memset(dst, (int)value, (size_t)size); + memset(dest, (int)value, (size_t)n); return CFE_PSP_SUCCESS; } diff --git a/unit-test-coverage/mcp750-vxworks/src/coveragetest-cfe-psp-support.c b/unit-test-coverage/mcp750-vxworks/src/coveragetest-cfe-psp-support.c index 7ded8d9d..3e9388b1 100644 --- a/unit-test-coverage/mcp750-vxworks/src/coveragetest-cfe-psp-support.c +++ b/unit-test-coverage/mcp750-vxworks/src/coveragetest-cfe-psp-support.c @@ -49,7 +49,7 @@ void Test_CFE_PSP_Restart(void) { /* * Test Case For: - * void CFE_PSP_Restart(uint32 reset_type) + * void CFE_PSP_Restart(uint32 resetType) */ UT_Setup_ReservedMem_BootRec(); diff --git a/ut-stubs/ut_psp_stubs.c b/ut-stubs/ut_psp_stubs.c index 853a67e8..026ea26d 100644 --- a/ut-stubs/ut_psp_stubs.c +++ b/ut-stubs/ut_psp_stubs.c @@ -355,7 +355,7 @@ int32 CFE_PSP_GetVolatileDiskMem(cpuaddr *PtrToVolDisk, uint32 *SizeOfVolDisk) ** \par Description ** This function is used as a placeholder for the PSP function ** CFE_PSP_Restart. The variable PSPRestartRtn.value is set to the -** value passed to the function, reset_type, and the variable +** value passed to the function, resetType, and the variable ** PSPRestartRtn.count is incremented each time this function is called. ** The unit tests compare these values to expected results to verify ** proper system response. @@ -367,10 +367,10 @@ int32 CFE_PSP_GetVolatileDiskMem(cpuaddr *PtrToVolDisk, uint32 *SizeOfVolDisk) ** This function does not return a value. ** ******************************************************************************/ -void CFE_PSP_Restart(uint32 reset_type) +void CFE_PSP_Restart(uint32 resetType) { UT_DEFAULT_IMPL(CFE_PSP_Restart); - UT_Stub_CopyFromLocal(UT_KEY(CFE_PSP_Restart), (uint8 *)&reset_type, sizeof(reset_type)); + UT_Stub_CopyFromLocal(UT_KEY(CFE_PSP_Restart), (uint8 *)&resetType, sizeof(resetType)); } /*****************************************************************************/ @@ -690,7 +690,7 @@ int32 CFE_PSP_MemValidateRange(cpuaddr Address, size_t Size, uint32 MemoryType) ** Returns OS_SUCCESS. ** ******************************************************************************/ -int32 CFE_PSP_MemCpy(void *dst, const void *src, uint32 size) +int32 CFE_PSP_MemCpy(void *dest, const void *src, uint32 n) { int32 status; @@ -699,7 +699,7 @@ int32 CFE_PSP_MemCpy(void *dst, const void *src, uint32 size) if (status >= 0) { /* this is not actually a stub; it actually has to _do_ the intended function */ - memcpy(dst, src, size); + memcpy(dest, src, n); } return status; @@ -720,7 +720,7 @@ int32 CFE_PSP_MemCpy(void *dst, const void *src, uint32 size) ** Returns OS_SUCCESS. ** ******************************************************************************/ -int32 CFE_PSP_MemSet(void *dst, uint8 value, uint32 size) +int32 CFE_PSP_MemSet(void *dest, uint8 value, uint32 n) { int32 status; @@ -729,7 +729,7 @@ int32 CFE_PSP_MemSet(void *dst, uint8 value, uint32 size) if (status >= 0) { /* this is not actually a stub; it actually has to _do_ the intended function */ - memset(dst, (int)value, (size_t)size); + memset(dest, (int)value, (size_t)n); } return status;