From b8d1189091a47753182f128099a6bc910791495b Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Thu, 2 Mar 2006 20:23:07 +0000 Subject: [PATCH] - Use the actual _count parameter passed through the macro This commit was SVN r9189. --- ompi/datatype/dt_add.c | 4 ++-- ompi/datatype/dt_create_dup.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ompi/datatype/dt_add.c b/ompi/datatype/dt_add.c index c00679094c..aabbb4cf44 100644 --- a/ompi/datatype/dt_add.c +++ b/ompi/datatype/dt_add.c @@ -39,9 +39,9 @@ static inline int IMIN( int a, int b ) { return ( a < b ? a : b ); } #define OMPI_DDT_LB_UB_CONT( _count, _disp, _old_lb, _old_ub, _old_extent, _new_lb, _new_ub ) \ { \ - if( 0 == count ) { \ + if( 0 == _count ) { \ _new_lb = (_old_lb) + (_disp); \ - _new_ub = (_old_ub) + (_disp); \ + _new_ub = (_old_ub) + (_disp); \ } else { \ long lower, upper; \ upper = (_disp) + (_old_extent) * ((_count) - 1); \ diff --git a/ompi/datatype/dt_create_dup.c b/ompi/datatype/dt_create_dup.c index fc3d0c99d9..84bb23c569 100644 --- a/ompi/datatype/dt_create_dup.c +++ b/ompi/datatype/dt_create_dup.c @@ -43,6 +43,9 @@ int32_t ompi_ddt_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** ne /* TODO: if the data was commited update the opt_desc field */ if( 0 != oldType->opt_desc.used ) { pdt->opt_desc.desc = malloc( oldType->opt_desc.used * sizeof(dt_elem_desc_t) ); + /* + * Yes, the pdt->opt_desc.length is just the opt_desc.used of the old Type. + */ pdt->opt_desc.length = oldType->opt_desc.used; pdt->opt_desc.used = oldType->opt_desc.used; memcpy( pdt->opt_desc.desc, oldType->opt_desc.desc, oldType->opt_desc.used * sizeof(dt_elem_desc_t) );