Skip to content

Commit 6e0f541

Browse files
committed
Fix #1330, Move variables declared mid-function to the top
1 parent c6916b9 commit 6e0f541

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/tests/time-base-api-test/time-base-api-test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ void TestTimeBaseApi(void)
7474
osal_id_t tb_id[OS_MAX_TIMEBASES];
7575
char timebase_name[OS_MAX_API_NAME + 5];
7676
OS_timebase_prop_t timebase_prop;
77+
int i;
7778

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

9192
/* Checking for OS_MAX_TIMEBASES */
92-
for (int i = 0; i < OS_MAX_TIMEBASES; i++)
93+
for (i = 0; i < OS_MAX_TIMEBASES; i++)
9394
{
9495
/* On the final setup pass, while there is still one free slot,
9596
* check attempting to create a duplicate name (index 0) - this

src/unit-test-coverage/shared/src/coveragetest-idmap.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,8 @@ void Test_OS_ObjectIDInteger(void)
11571157
int32 recordscount = 0;
11581158
osal_objtype_t idtype;
11591159
char str[OS_MAX_API_NAME];
1160+
int i;
1161+
int j;
11601162

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

@@ -1181,11 +1183,11 @@ void Test_OS_ObjectIDInteger(void)
11811183

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

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

1188-
for (int j = 0; j < recordscount; j++)
1190+
for (j = 0; j < recordscount; j++)
11891191
{
11901192
if (i == j)
11911193
{

0 commit comments

Comments
 (0)