From 56748d5f57dae4ec1825272674e68f893ac0b45c Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Fri, 10 Nov 2006 05:11:02 +0000 Subject: [PATCH] Correctly initialize the unpack buffer. This commit was SVN r12529. --- test/datatype/ddt_test.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/datatype/ddt_test.c b/test/datatype/ddt_test.c index c17188c6d7..7657eb5e3f 100644 --- a/test/datatype/ddt_test.c +++ b/test/datatype/ddt_test.c @@ -431,7 +431,7 @@ static int test_upper( unsigned int length ) ptr = (char*)inbuf; /* copy upper matrix in the array simulating the input buffer */ for( i = 0; i < length; i++ ) { - uint32_t pos = i * length; + uint32_t pos = i * length + i; for( j = i; j < length; j++, pos++ ) { *inbuf = mat1[pos]; inbuf++; @@ -886,9 +886,8 @@ static int local_copy_with_convertor( ompi_datatype_t* pdt, int count, int chunk ptemp = malloc( chunk ); { - int i; - for( i = 0; i < (count * extent); i++ ) - ((char*)psrc)[i] = i % 128 + 32; + int i = 0; + for( ; i < (count * extent); ((char*)psrc)[i] = i % 128 + 32, i++ ); } memset( pdst, 0, count * extent );