Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1332, Resolve compiler warnings re. signedness comparisons #2247

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,27 +627,27 @@
* 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 */
if (WaitRemaining > CFE_PLATFORM_ES_STARTUP_SYNC_POLL_MSEC)
{
WaitTime = CFE_PLATFORM_ES_STARTUP_SYNC_POLL_MSEC;
}
else if (WaitRemaining > 0)
{
WaitTime = WaitRemaining;
}
else
{
Status = CFE_ES_OPERATION_TIMED_OUT;
break;
}

OS_TaskDelay(WaitTime);
WaitRemaining -= WaitTime;
}

Check warning

Code scanning / CodeQL-coding-standard

Unbounded loop Warning

The loop counter MinSystemState is not always decremented in the loop body.
The loop counter SystemState is not always incremented in the loop body.

return Status;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions modules/fs/fsw/src/cfe_fs_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/fsw/src/cfe_tbl_task_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Loading