Skip to content

Commit

Permalink
Fix nasa#2153, Remove unnecessary parentheses around return values
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Sep 27, 2022
1 parent 9f42688 commit a094d37
Show file tree
Hide file tree
Showing 23 changed files with 97 additions and 97 deletions.
4 changes: 2 additions & 2 deletions modules/core_api/fsw/inc/cfe_resourceid.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
*/
static inline unsigned long CFE_ResourceId_ToInteger(CFE_ResourceId_t id)
{
return ((unsigned long)CFE_RESOURCEID_UNWRAP(id));
return (unsigned long)CFE_RESOURCEID_UNWRAP(id);
}

/**
Expand All @@ -120,7 +120,7 @@ static inline unsigned long CFE_ResourceId_ToInteger(CFE_ResourceId_t id)
*/
static inline CFE_ResourceId_t CFE_ResourceId_FromInteger(unsigned long Value)
{
return ((CFE_ResourceId_t)CFE_RESOURCEID_WRAP(Value));
return (CFE_ResourceId_t)CFE_RESOURCEID_WRAP(Value);
}

/**
Expand Down
38 changes: 19 additions & 19 deletions modules/es/fsw/src/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int32 CFE_ES_GetResetType(uint32 *ResetSubtypePtr)
*ResetSubtypePtr = CFE_ES_Global.ResetDataPtr->ResetVars.ResetSubtype;
}

return (CFE_ES_Global.ResetDataPtr->ResetVars.ResetType);
return CFE_ES_Global.ResetDataPtr->ResetVars.ResetType;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -152,7 +152,7 @@ CFE_Status_t CFE_ES_ResetCFE(uint32 ResetType)
ReturnCode = CFE_ES_BAD_ARGUMENT;
}

return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -221,7 +221,7 @@ CFE_Status_t CFE_ES_RestartApp(CFE_ES_AppId_t AppID)

} /* end if */

return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -290,7 +290,7 @@ CFE_Status_t CFE_ES_ReloadApp(CFE_ES_AppId_t AppID, const char *AppFileName)
CFE_RESOURCEID_TO_ULONG(AppID));
}

return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -343,7 +343,7 @@ CFE_Status_t CFE_ES_DeleteApp(CFE_ES_AppId_t AppID)
CFE_RESOURCEID_TO_ULONG(AppID));
}

return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -568,7 +568,7 @@ bool CFE_ES_RunLoop(uint32 *RunStatus)

CFE_ES_UnlockSharedData(__func__, __LINE__);

return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -726,7 +726,7 @@ CFE_Status_t CFE_ES_GetAppIDByName(CFE_ES_AppId_t *AppIdPtr, const char *AppName

CFE_ES_UnlockSharedData(__func__, __LINE__);

return (Result);
return Result;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -767,7 +767,7 @@ CFE_Status_t CFE_ES_GetLibIDByName(CFE_ES_LibId_t *LibIdPtr, const char *LibName

CFE_ES_UnlockSharedData(__func__, __LINE__);

return (Result);
return Result;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -802,7 +802,7 @@ CFE_Status_t CFE_ES_GetTaskIDByName(CFE_ES_TaskId_t *TaskIdPtr, const char *Task
*TaskIdPtr = CFE_ES_TASKID_UNDEFINED;
}

return (Result);
return Result;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -840,7 +840,7 @@ CFE_Status_t CFE_ES_GetAppID(CFE_ES_AppId_t *AppIdPtr)

CFE_ES_UnlockSharedData(__func__, __LINE__);

return (Result);
return Result;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -920,7 +920,7 @@ CFE_Status_t CFE_ES_GetAppName(char *AppName, CFE_ES_AppId_t AppId, size_t Buffe

CFE_ES_UnlockSharedData(__func__, __LINE__);

return (Result);
return Result;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -966,7 +966,7 @@ CFE_Status_t CFE_ES_GetLibName(char *LibName, CFE_ES_LibId_t LibId, size_t Buffe

CFE_ES_UnlockSharedData(__func__, __LINE__);

return (Result);
return Result;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -1209,7 +1209,7 @@ int32 CFE_ES_GetModuleInfo(CFE_ES_AppInfo_t *ModuleInfo, CFE_ResourceId_t Resour
break;
}

return (Status);
return Status;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -1285,7 +1285,7 @@ CFE_Status_t CFE_ES_GetTaskInfo(CFE_ES_TaskInfo_t *TaskInfo, CFE_ES_TaskId_t Tas

CFE_ES_UnlockSharedData(__func__, __LINE__);

return (Status);
return Status;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -1381,7 +1381,7 @@ CFE_Status_t CFE_ES_CreateChildTask(CFE_ES_TaskId_t *TaskIdPtr, const char *Task
ReturnCode = CFE_ES_StartAppTask(TaskIdPtr, TaskName, FunctionPtr, &Params, ParentAppId);
}

return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -1528,7 +1528,7 @@ CFE_Status_t CFE_ES_DeleteChildTask(CFE_ES_TaskId_t TaskId)
CFE_ES_WriteToSysLog("%s: Error: Invalid Task ID: %lu\n", __func__, CFE_RESOURCEID_TO_ULONG(TaskId));
ReturnCode = CFE_ES_ERR_RESOURCEID_NOT_VALID;
}
return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -1623,7 +1623,7 @@ CFE_Status_t CFE_ES_WriteToSysLog(const char *SpecStringPtr, ...)
/* Output the entry to the console */
OS_printf("%s", TmpString);

return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -1701,7 +1701,7 @@ uint32 CFE_ES_CalculateCRC(const void *DataPtr, size_t DataLength, uint32 InputC
default:
break;
}
return (Crc);
return Crc;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -2109,7 +2109,7 @@ CFE_Status_t CFE_ES_GetGenCounterIDByName(CFE_ES_CounterId_t *CounterIdPtr, cons

CFE_ES_UnlockSharedData(__func__, __LINE__);

return (Result);
return Result;
}

/*----------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions modules/es/fsw/src/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ int32 CFE_ES_ParseFileEntry(const char **TokenList, uint32 NumTokens)
Status = CFE_ES_ERR_APP_CREATE;
}

return (Status);
return Status;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -545,7 +545,7 @@ int32 CFE_ES_GetTaskFunction(CFE_ES_TaskEntryFuncPtr_t *FuncPtr)
*FuncPtr = EntryFunc;
}

return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -976,7 +976,7 @@ int32 CFE_ES_LoadLibrary(CFE_ES_LibId_t *LibraryIdPtr, const char *LibName, cons

*LibraryIdPtr = CFE_ES_LIBID_C(PendingResourceId);

return (Status);
return Status;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -1556,7 +1556,7 @@ int32 CFE_ES_CleanUpApp(CFE_ES_AppId_t AppId)

CFE_ES_UnlockSharedData(__func__, __LINE__);

return (ReturnCode);
return ReturnCode;
}

/*
Expand Down Expand Up @@ -1739,7 +1739,7 @@ int32 CFE_ES_CleanupTaskResources(CFE_ES_TaskId_t TaskId)
Result = CFE_ES_TASK_DELETE_ERR;
}

return (Result);
return Result;
}

/*----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_cds.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ int32 CFE_ES_RegisterCDSEx(CFE_ES_CDSHandle_t *HandlePtr, size_t UserBlockSize,

*HandlePtr = CFE_ES_CDSHANDLE_C(PendingBlockId);

return (Status);
return Status;
}

/*----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_cds.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static inline bool CFE_ES_CDSBlockRecordIsUsed(const CFE_ES_CDS_RegRec_t *CDSBlo
*/
static inline CFE_ES_CDSHandle_t CFE_ES_CDSBlockRecordGetID(const CFE_ES_CDS_RegRec_t *CDSBlockRecPtr)
{
return (CDSBlockRecPtr->BlockID);
return CDSBlockRecPtr->BlockID;
}

/*---------------------------------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_erlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int32 CFE_ES_WriteToERLogWithContext(CFE_ES_LogEntryType_Enum_t EntryType, uint3
*/
CFE_ES_UnlockSharedData(__func__, __LINE__);

return (CFE_SUCCESS);
return CFE_SUCCESS;
}

/*----------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions modules/es/fsw/src/cfe_es_generic_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ int32 CFE_ES_GenPoolGetBlock(CFE_ES_GenPoolRecord_t *PoolRecPtr, size_t *BlockOf
{
CFE_ES_WriteToSysLog("%s: Err:size(%lu) > max(%lu)\n", __func__, (unsigned long)ReqSize,
(unsigned long)PoolRecPtr->Buckets[PoolRecPtr->NumBuckets - 1].BlockSize);
return (CFE_ES_ERR_MEM_BLOCK_SIZE);
return CFE_ES_ERR_MEM_BLOCK_SIZE;
}

/* first attempt to recycle any buffers from the same bucket that were freed */
Expand All @@ -391,7 +391,7 @@ int32 CFE_ES_GenPoolGetBlock(CFE_ES_GenPoolRecord_t *PoolRecPtr, size_t *BlockOf
Status = CFE_ES_GenPoolCreatePoolBlock(PoolRecPtr, BucketId, ReqSize, BlockOffsetPtr);
}

return (Status);
return Status;
}

/*----------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions modules/es/fsw/src/cfe_es_mempool.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ CFE_Status_t CFE_ES_PoolCreateEx(CFE_ES_MemHandle_t *PoolID, void *MemPtr, size_
{
CFE_ES_WriteToSysLog("%s: Num Block Sizes (%d) greater than max (%d)\n", __func__, (int)NumBlockSizes,
CFE_PLATFORM_ES_POOL_MAX_BUCKETS);
return (CFE_ES_BAD_ARGUMENT);
return CFE_ES_BAD_ARGUMENT;
}

/*
Expand Down Expand Up @@ -355,7 +355,7 @@ CFE_Status_t CFE_ES_PoolCreateEx(CFE_ES_MemHandle_t *PoolID, void *MemPtr, size_
*/
*PoolID = CFE_ES_MEMHANDLE_C(PendingID);

return (Status);
return Status;
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -441,7 +441,7 @@ int32 CFE_ES_GetPoolBuf(CFE_ES_MemPoolBuf_t *BufPtr, CFE_ES_MemHandle_t Handle,
CFE_ES_GetAppID(&AppId);
CFE_ES_WriteToSysLog("%s: Err:Bad handle(0x%08lX) AppId=%lu\n", __func__, CFE_RESOURCEID_TO_ULONG(Handle),
CFE_RESOURCEID_TO_ULONG(AppId));
return (CFE_ES_ERR_RESOURCEID_NOT_VALID);
return CFE_ES_ERR_RESOURCEID_NOT_VALID;
}

/*
Expand Down Expand Up @@ -473,7 +473,7 @@ int32 CFE_ES_GetPoolBuf(CFE_ES_MemPoolBuf_t *BufPtr, CFE_ES_MemHandle_t Handle,
/* If not successful, return error now */
if (Status != CFE_SUCCESS)
{
return (Status);
return Status;
}

/* Compute the actual buffer address. */
Expand Down Expand Up @@ -507,7 +507,7 @@ CFE_Status_t CFE_ES_GetPoolBufInfo(CFE_ES_MemHandle_t Handle, CFE_ES_MemPoolBuf_
/* basic sanity check */
if (!CFE_ES_MemPoolRecordIsMatch(PoolRecPtr, Handle))
{
return (CFE_ES_ERR_RESOURCEID_NOT_VALID);
return CFE_ES_ERR_RESOURCEID_NOT_VALID;
}

/*
Expand Down Expand Up @@ -571,7 +571,7 @@ int32 CFE_ES_PutPoolBuf(CFE_ES_MemHandle_t Handle, CFE_ES_MemPoolBuf_t BufPtr)
{
CFE_ES_WriteToSysLog("%s: Err:Invalid Memory Handle (0x%08lX).\n", __func__, CFE_RESOURCEID_TO_ULONG(Handle));

return (CFE_ES_ERR_RESOURCEID_NOT_VALID);
return CFE_ES_ERR_RESOURCEID_NOT_VALID;
}

/*
Expand Down Expand Up @@ -653,7 +653,7 @@ CFE_Status_t CFE_ES_GetMemPoolStats(CFE_ES_MemPoolStats_t *BufPtr, CFE_ES_MemHan
CFE_ES_GetAppID(&AppId);
CFE_ES_WriteToSysLog("%s: Err:Bad handle(0x%08lX) AppId=%lu\n", __func__, CFE_RESOURCEID_TO_ULONG(Handle),
CFE_RESOURCEID_TO_ULONG(AppId));
return (CFE_ES_ERR_RESOURCEID_NOT_VALID);
return CFE_ES_ERR_RESOURCEID_NOT_VALID;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_mempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static inline bool CFE_ES_MemPoolRecordIsUsed(const CFE_ES_MemPoolRecord_t *Pool
*/
static inline CFE_ES_MemHandle_t CFE_ES_MemPoolRecordGetID(const CFE_ES_MemPoolRecord_t *PoolRecPtr)
{
return (PoolRecPtr->PoolID);
return PoolRecPtr->PoolID;
}

/*---------------------------------------------------------------------------------------*/
Expand Down
4 changes: 2 additions & 2 deletions modules/es/fsw/src/cfe_es_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static inline CFE_ES_LibId_t CFE_ES_LibRecordGetID(const CFE_ES_LibRecord_t *Lib
* The initial implementation does not store the ID in the entry;
* the ID is simply the zero-based index into the table.
*/
return (LibRecPtr->LibId);
return LibRecPtr->LibId;
}

/*---------------------------------------------------------------------------------------*/
Expand Down Expand Up @@ -411,7 +411,7 @@ static inline const char *CFE_ES_LibRecordGetName(const CFE_ES_LibRecord_t *LibR
*/
static inline CFE_ES_TaskId_t CFE_ES_TaskRecordGetID(const CFE_ES_TaskRecord_t *TaskRecPtr)
{
return (TaskRecPtr->TaskId);
return TaskRecPtr->TaskId;
}

/*---------------------------------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_syslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ int32 CFE_ES_SysLogAppend_Unsync(const char *LogString)
++CFE_ES_Global.ResetDataPtr->SystemLogEntryNum;
}

return (ReturnCode);
return ReturnCode;
}

/*----------------------------------------------------------------
Expand Down
Loading

0 comments on commit a094d37

Please sign in to comment.