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 #1330, Move variables declared mid-function to the top #1331

Merged
Merged
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
3 changes: 2 additions & 1 deletion src/tests/time-base-api-test/time-base-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ void TestTimeBaseApi(void)
osal_id_t tb_id[OS_MAX_TIMEBASES];
char timebase_name[OS_MAX_API_NAME + 5];
OS_timebase_prop_t timebase_prop;
int i;

/*
* Test Case For:
Expand All @@ -89,7 +90,7 @@ void TestTimeBaseApi(void)
UtAssert_INT32_EQ(OS_TimeBaseCreate(&time_base_id, timebase_name, 0), OS_ERR_NAME_TOO_LONG);

/* Checking for OS_MAX_TIMEBASES */
for (int i = 0; i < OS_MAX_TIMEBASES; i++)
for (i = 0; i < OS_MAX_TIMEBASES; i++)
{
/* On the final setup pass, while there is still one free slot,
* check attempting to create a duplicate name (index 0) - this
Expand Down
6 changes: 4 additions & 2 deletions src/unit-test-coverage/shared/src/coveragetest-idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,8 @@ void Test_OS_ObjectIDInteger(void)
int32 recordscount = 0;
osal_objtype_t idtype;
char str[OS_MAX_API_NAME];
int i;
int j;

memset(&token, 0, sizeof(token));

Expand All @@ -1181,11 +1183,11 @@ void Test_OS_ObjectIDInteger(void)

UtAssert_True(recordscount < OS_MAX_TOTAL_RECORDS, "All Id types checked");

for (int i = 0; i < recordscount; i++)
for (i = 0; i < recordscount; i++)
{
UtAssert_True(OS_ObjectIdDefined(typesI[i]), "%lu Is defined", OS_ObjectIdToInteger(typesI[i]));

for (int j = 0; j < recordscount; j++)
for (j = 0; j < recordscount; j++)
{
if (i == j)
{
Expand Down