Skip to content

Commit dd7cbdd

Browse files
authored
Merge pull request #11080 from jsquyres/pr/fix-some-test-warnings
test/datatype/partial.c: fix compiler warnings
2 parents 37222f7 + 98abc08 commit dd7cbdd

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/datatype/partial.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* reserved.
66
* Copyright (c) 2018 Triad National Security, LLC. All rights
77
* reserved.
8+
* Copyright (c) 2022 Cisco Systems, Inc. All rights reserved
89
* $COPYRIGHT$
910
*
1011
* Additional copyrights may follow
@@ -53,7 +54,7 @@ static void show_neighborhood(double *ptr, int how_many, bool show_hex)
5354
for (i = -how_many; i < how_many; i++) {
5455
if (0 == i)
5556
printf(" <");
56-
for (int j = 0; j < sizeof(double); j++) {
57+
for (size_t j = 0; j < sizeof(double); j++) {
5758
printf("%02x", cptr[i * sizeof(double) + j]);
5859
}
5960
if (0 == i)
@@ -76,7 +77,7 @@ static void show_neighborhood(double *ptr, int how_many, bool show_hex)
7677

7778
int main(int argc, char *argv[])
7879
{
79-
opal_datatype_t *vector;
80+
ompi_datatype_t *vector;
8081
ompi_datatype_t *base;
8182
uint32_t iov_count;
8283
size_t max_data, size, length;
@@ -93,13 +94,13 @@ int main(int argc, char *argv[])
9394
ompi_datatype_create_vector(TYPE_COUNT, TYPE_BLEN, TYPE_STRIDE, MPI_DOUBLE, &base);
9495
ompi_datatype_create_contiguous(CONT_COUNT, base, &vector);
9596

96-
opal_datatype_commit(vector);
97+
opal_datatype_commit(&vector->super);
9798

9899
ompi_datatype_dump(vector);
99100

100-
opal_datatype_type_size(vector, &size);
101-
opal_datatype_type_extent(vector, &extent);
102-
opal_datatype_type_extent(base, &base_extent);
101+
opal_datatype_type_size(&vector->super, &size);
102+
opal_datatype_type_extent(&vector->super, &extent);
103+
opal_datatype_type_extent(&base->super, &base_extent);
103104

104105
array = (double *) malloc(extent * COUNT);
105106
packed = (double *) malloc(size * COUNT);
@@ -118,7 +119,7 @@ int main(int argc, char *argv[])
118119
* of the buffered operation.
119120
*/
120121
convertor = opal_convertor_create(opal_local_arch, 0);
121-
opal_convertor_prepare_for_recv(convertor, vector, COUNT, array);
122+
opal_convertor_prepare_for_recv(convertor, &vector->super, COUNT, array);
122123

123124
for (length = 0; length < (size * COUNT);) {
124125
iov[0].iov_base = bpacked + length;
@@ -129,7 +130,8 @@ int main(int argc, char *argv[])
129130
opal_convertor_unpack(convertor, iov, &iov_count, &max_data);
130131
length += max_data;
131132

132-
int idx = 0, checked = 0;
133+
int idx = 0;
134+
size_t checked = 0;
133135
for (int m = 0; m < COUNT; m++) {
134136
char *mptr = (char *) array + m * extent;
135137
for (int k = 0; k < CONT_COUNT; k++) {

0 commit comments

Comments
 (0)