From 235eade4ecc4bf651714d7671e8e9af5b52b0bd7 Mon Sep 17 00:00:00 2001 From: Avi Date: Mon, 20 Feb 2023 09:03:16 +1000 Subject: [PATCH] Fix #1332, Resolve compiler warnings re. signedness comparisons --- modules/es/fsw/src/cfe_es_api.c | 2 +- modules/es/fsw/src/cfe_es_apps.c | 2 +- modules/es/fsw/src/cfe_es_perf.c | 2 +- modules/fs/fsw/src/cfe_fs_api.c | 4 ++-- modules/tbl/fsw/src/cfe_tbl_task_cmds.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c index b625f520f..0a44ca027 100644 --- a/modules/es/fsw/src/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -627,7 +627,7 @@ CFE_Status_t CFE_ES_WaitForSystemState(uint32 MinSystemState, uint32 TimeOutMill * to be at least the state requested. */ WaitRemaining = TimeOutMilliseconds; - while (CFE_ES_Global.SystemState < MinSystemState) + while (CFE_ES_Global.SystemState < (int)MinSystemState) { /* TBD: Very Crude timing here, but not sure if it matters, * as this is only done during startup, not real work */ diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index b213f7820..aeda8c7e3 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -1033,7 +1033,7 @@ bool CFE_ES_RunAppTableScan(uint32 ElapsedTime, void *Arg) * Decrement the wait timer, if active. * When the timeout value becomes zero, take the action to delete/restart/reload the app */ - if (AppPtr->ControlReq.AppTimerMsec > ElapsedTime) + if (AppPtr->ControlReq.AppTimerMsec > (int64_t)ElapsedTime) { AppPtr->ControlReq.AppTimerMsec -= ElapsedTime; } diff --git a/modules/es/fsw/src/cfe_es_perf.c b/modules/es/fsw/src/cfe_es_perf.c index 6a2e02809..7c29302b9 100644 --- a/modules/es/fsw/src/cfe_es_perf.c +++ b/modules/es/fsw/src/cfe_es_perf.c @@ -457,7 +457,7 @@ bool CFE_ES_RunPerfLogDump(uint32 ElapsedTime, void *Arg) if (BlockSize != 0) { - if (Status != BlockSize) + if (Status != (int)BlockSize) { CFE_ES_FileWriteByteCntErr(State->DataFileName, BlockSize, Status); diff --git a/modules/fs/fsw/src/cfe_fs_api.c b/modules/fs/fsw/src/cfe_fs_api.c index fbd0e54a0..993c318fd 100644 --- a/modules/fs/fsw/src/cfe_fs_api.c +++ b/modules/fs/fsw/src/cfe_fs_api.c @@ -596,7 +596,7 @@ int32 CFE_FS_ParseInputFileName(char *OutputBuffer, const char *InputName, size_ CFE_Status_t CFE_FS_ExtractFilenameFromPath(const char *OriginalPath, char *FileNameOnly) { uint32 i, j; - int StringLength; + size_t StringLength; int DirMarkIdx; int32 ReturnCode; @@ -770,7 +770,7 @@ bool CFE_FS_RunBackgroundFileDump(uint32 ElapsedTime, void *Arg) */ OsStatus = OS_write(State->Fd, RecordPtr, RecordSize); - if (OsStatus != RecordSize) + if (OsStatus != (int64_t)RecordSize) { /* end the file early (cannot set "IsEOF" as this would cause the complete event to be generated too) */ OS_close(State->Fd); diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c index afb4f5536..ea848b64e 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c @@ -735,7 +735,7 @@ CFE_TBL_CmdProcRet_t CFE_TBL_DumpToFile(const char *DumpFilename, const char *Ta /* Output the active table image data to the dump file */ OsStatus = OS_write(FileDescriptor, DumpDataAddr, TblSizeInBytes); - if ((long)OsStatus == TblSizeInBytes) + if ((long)OsStatus == (int64_t)TblSizeInBytes) { if (FileExistedPrev) {