Skip to content

Commit 11b872c

Browse files
authored
Merge pull request #11090 from jsquyres/pr/v5.0.x/test-compiler-warning-fixes
v5.0.x: test/datatype/partial.c: fix compiler warnings
2 parents 7705221 + c617784 commit 11b872c

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
@@ -52,7 +53,7 @@ static void show_neighborhood(double* ptr, int how_many, bool show_hex)
5253
printf("\n : ");
5354
for( i = -how_many; i < how_many; i++ ) {
5455
if( 0 == i ) printf(" <");
55-
for( int j = 0; j < sizeof(double); j++ ) {
56+
for( size_t j = 0; j < sizeof(double); j++ ) {
5657
printf("%02x", cptr[i * sizeof(double)+j]);
5758
}
5859
if( 0 == i ) printf("> ");
@@ -71,7 +72,7 @@ static void show_neighborhood(double* ptr, int how_many, bool show_hex)
7172

7273
int main( int argc, char* argv[] )
7374
{
74-
opal_datatype_t* vector;
75+
ompi_datatype_t* vector;
7576
ompi_datatype_t* base;
7677
uint32_t iov_count;
7778
size_t max_data, size, length;
@@ -88,13 +89,13 @@ int main( int argc, char* argv[] )
8889
ompi_datatype_create_vector(TYPE_COUNT, TYPE_BLEN, TYPE_STRIDE, MPI_DOUBLE, &base);
8990
ompi_datatype_create_contiguous(CONT_COUNT, base, &vector);
9091

91-
opal_datatype_commit( vector );
92+
opal_datatype_commit(&vector->super);
9293

9394
ompi_datatype_dump(vector);
9495

95-
opal_datatype_type_size(vector, &size);
96-
opal_datatype_type_extent(vector, &extent);
97-
opal_datatype_type_extent(base, &base_extent);
96+
opal_datatype_type_size(&vector->super, &size);
97+
opal_datatype_type_extent(&vector->super, &extent);
98+
opal_datatype_type_extent(&base->super, &base_extent);
9899

99100
array = (double*)malloc( extent * COUNT );
100101
packed = (double*)malloc( size * COUNT );
@@ -113,7 +114,7 @@ int main( int argc, char* argv[] )
113114
* of the buffered operation.
114115
*/
115116
convertor = opal_convertor_create( opal_local_arch, 0 );
116-
opal_convertor_prepare_for_recv( convertor, vector, COUNT, array );
117+
opal_convertor_prepare_for_recv(convertor, &vector->super, COUNT, array);
117118

118119
for( length = 0; length < (size * COUNT); ) {
119120
iov[0].iov_base = bpacked + length;
@@ -124,7 +125,8 @@ int main( int argc, char* argv[] )
124125
opal_convertor_unpack( convertor, iov, &iov_count, &max_data );
125126
length += max_data;
126127

127-
int idx = 0, checked = 0;
128+
int idx = 0;
129+
size_t checked = 0;
128130
for( int m = 0; m < COUNT; m++ ) {
129131
char* mptr = (char*)array + m * extent;
130132
for( int k = 0; k < CONT_COUNT; k++ ) {

0 commit comments

Comments
 (0)