Commit 4a6b3931 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Move loop index declaration into for.

parent 96b02ee1
......@@ -103,9 +103,7 @@ int main(void) {
double ref_dst_data[] = {1,3,5};
size_t i;
for (i = 0; i < sizeof(dst_data) / sizeof(dst_data[0]); ++i)
for (size_t i = 0; i < sizeof(dst_data) / sizeof(dst_data[0]); ++i)
if (ref_dst_data[i] != dst_data[i])
PUT_ERR("error in xt_redist_s_exchange\n");
......@@ -173,10 +171,8 @@ int main(void) {
double ref_dst_data[3][3] = {{1,3,5},{6,8,10},{11,13,15}};
int i, j;
for (i = 0; i < 3; ++i)
for (j = 0; j < 3; ++j)
for (size_t i = 0; i < 3; ++i)
for (size_t j = 0; j < 3; ++j)
if (ref_dst_data[i][j] != ((double *)dst_data_p[i])[j])
PUT_ERR("error in xt_redist_s_exchange\n");
}
......
......@@ -111,9 +111,7 @@ int main(void) {
double ref_dst_data[] = {1,3,5};
size_t i;
for (i = 0; i < sizeof(dst_data) / sizeof(dst_data[0]); ++i)
for (size_t i = 0; i < sizeof(dst_data) / sizeof(dst_data[0]); ++i)
if (ref_dst_data[i] != dst_data[i])
PUT_ERR("error in xt_redist_s_exchange\n");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment