Skip to content

Commit

Permalink
Fix #1517, Reformat do/while loop to while (style change only)
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Oct 25, 2022
1 parent be88a07 commit e9f2a78
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions modules/tbl/fsw/src/cfe_tbl_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,24 +484,23 @@ int32 CFE_TBL_GetNextNotification(CFE_TBL_Handle_t TblHandle)
int16 CFE_TBL_FindTableInRegistry(const char *TblName)
{
int16 RegIndx = CFE_TBL_NOT_FOUND;
int16 i = -1;
int16 i = 0;

do
while ((RegIndx == CFE_TBL_NOT_FOUND) && (i < (CFE_PLATFORM_TBL_MAX_NUM_TABLES - 1)))
{
/* Point to next record in the Table Registry */
i++;

/* Check to see if the record is currently being used */
if (!CFE_RESOURCEID_TEST_EQUAL(CFE_TBL_Global.Registry[i].OwnerAppId, CFE_TBL_NOT_OWNED))
/* Check to see if the record is currently being used and perform a case-sensitive name comparison */
if (!CFE_RESOURCEID_TEST_EQUAL(CFE_TBL_Global.Registry[i].OwnerAppId, CFE_TBL_NOT_OWNED) &&
strcmp(TblName, CFE_TBL_Global.Registry[i].Name) == 0)
{
/* Perform a case sensitive name comparison */
if (strcmp(TblName, CFE_TBL_Global.Registry[i].Name) == 0)
{
/* If the names match, then return the index */
RegIndx = i;
}
/* If the names match, then return the index */
RegIndx = i;
}
} while ((RegIndx == CFE_TBL_NOT_FOUND) && (i < (CFE_PLATFORM_TBL_MAX_NUM_TABLES - 1)));
else
{
/* Point to next record in the Table Registry */
i++;
}
}

return RegIndx;
}
Expand Down

0 comments on commit e9f2a78

Please sign in to comment.