From a6ad19e72129c3b37bcea5fb72e40202ee743c53 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Wed, 3 Nov 2004 23:52:44 +0000 Subject: [PATCH] Removing some compiler warnings (thanks Jeff for the patch). Now we generate only the usefull functions for moving bytes around. This commit was SVN r3507. --- src/datatype/dt_unpack.c | 106 +++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 42 deletions(-) diff --git a/src/datatype/dt_unpack.c b/src/datatype/dt_unpack.c index 1a23806b99..f3ae58d185 100644 --- a/src/datatype/dt_unpack.c +++ b/src/datatype/dt_unpack.c @@ -383,14 +383,6 @@ static int copy_##TYPENAME( uint32_t count, \ return count; \ } -static int copy_bytes_1( uint32_t count, char* from, uint32_t from_len, long from_extent, char* to, uint32_t to_len, long to_extent ); -static int copy_bytes_2( uint32_t count, char* from, uint32_t from_len, long from_extent, char* to, uint32_t to_len, long to_extent ); -static int copy_bytes_4( uint32_t count, char* from, uint32_t from_len, long from_extent, char* to, uint32_t to_len, long to_extent ); -static int copy_bytes_8( uint32_t count, char* from, uint32_t from_len, long from_extent, char* to, uint32_t to_len, long to_extent ); -static int copy_bytes_12( uint32_t count, char* from, uint32_t from_len, long from_extent, char* to, uint32_t to_len, long to_extent ); -static int copy_bytes_16( uint32_t count, char* from, uint32_t from_len, long from_extent, char* to, uint32_t to_len, long to_extent ); -static int copy_bytes_20( uint32_t count, char* from, uint32_t from_len, long from_extent, char* to, uint32_t to_len, long to_extent ); - #define COPY_CONTIGUOUS_BYTES( TYPENAME, COUNT ) \ static int copy_##TYPENAME##_##COUNT( uint32_t count, \ char* from, uint32_t from_len, long from_extent, \ @@ -443,6 +435,70 @@ COPY_TYPE( 2double, double, 2 ) COPY_TYPE( 2complex_float, ompi_complex_float_t, 2 ) COPY_TYPE( 2complex_double, ompi_complex_double_t, 2 ) +#if OMPI_SIZEOF_FORTRAN_LOGICAL == 1 || SIZEOF_BOOL == 1 +#define REQUIRE_COPY_BYTES_1 1 +#else +#define REQUIRE_COPY_BYTES_1 0 +#endif + +#if OMPI_SIZEOF_FORTRAN_LOGICAL == 2 || SIZEOF_BOOL == 2 +#define REQUIRE_COPY_BYTES_2 1 +#else +#define REQUIRE_COPY_BYTES_2 0 +#endif + +#if OMPI_SIZEOF_FORTRAN_LOGICAL == 4 || SIZEOF_BOOL == 4 +#define REQUIRE_COPY_BYTES_4 1 +#else +#define REQUIRE_COPY_BYTES_4 0 +#endif + +#if (SIZEOF_FLOAT + SIZEOF_INT) == 8 || (SIZEOF_LONG + SIZEOF_INT) == 8 || SIZEOF_BOOL == 8 +#define REQUIRE_COPY_BYTES_8 1 +#else +#define REQUIRE_COPY_BYTES_8 0 +#endif + +#if (SIZEOF_DOUBLE + SIZEOF_INT) == 12 || (SIZEOF_LONG + SIZEOF_INT) == 12 +#define REQUIRE_COPY_BYTES_12 1 +#else +#define REQUIRE_COPY_BYTES_12 0 +#endif + +#if (SIZEOF_LONG_DOUBLE + SIZEOF_INT) == 16 +#define REQUIRE_COPY_BYTES_16 1 +#else +#define REQUIRE_COPY_BYTES_16 0 +#endif + +#if (SIZEOF_LONG_DOUBLE + SIZEOF_INT) == 20 +#define REQUIRE_COPY_BYTES_20 1 +#else +#define REQUIRE_COPY_BYTES_20 0 +#endif + +#if REQUIRE_COPY_BYTES_1 +COPY_CONTIGUOUS_BYTES( bytes, 1 ) +#endif /* REQUIRE_COPY_BYTES_1 */ +#if REQUIRE_COPY_BYTES_2 +COPY_CONTIGUOUS_BYTES( bytes, 2 ) +#endif /* REQUIRE_COPY_BYTES_2 */ +#if REQUIRE_COPY_BYTES_4 +COPY_CONTIGUOUS_BYTES( bytes, 4 ) +#endif /* REQUIRE_COPY_BYTES_4 */ +#if REQUIRE_COPY_BYTES_8 +COPY_CONTIGUOUS_BYTES( bytes, 8 ) +#endif /* REQUIRE_COPY_BYTES_8 */ +#if REQUIRE_COPY_BYTES_12 +COPY_CONTIGUOUS_BYTES( bytes, 12 ) +#endif /* REQUIRE_COPY_BYTES_12 */ +#if REQUIRE_COPY_BYTES_16 +COPY_CONTIGUOUS_BYTES( bytes, 16 ) +#endif /* REQUIRE_COPY_BYTES_16 */ +#if REQUIRE_COPY_BYTES_20 +COPY_CONTIGUOUS_BYTES( bytes, 20 ) +#endif /* REQUIRE_COPY_BYTES_20 */ + conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = { (conversion_fct_t)NULL, /* DT_LOOP */ (conversion_fct_t)NULL, /* DT_END_LOOP */ @@ -470,43 +526,34 @@ conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = { (conversion_fct_t)NULL, /* DT_PACKED */ #if OMPI_SIZEOF_FORTRAN_LOGICAL == 1 (conversion_fct_t)copy_bytes_1, /* DT_LOGIC */ -#define REQUIRE_COPY_BYTES_1 #elif OMPI_SIZEOF_FORTRAN_LOGICAL == 4 (conversion_fct_t)copy_bytes_4, /* DT_LOGIC */ -#define REQUIRE_COPY_BYTES_4 #elif NULL, /* DT_LOGIC */ #endif #if (SIZEOF_FLOAT + SIZEOF_INT) == 8 (conversion_fct_t)copy_bytes_8, /* DT_FLOAT_INT */ -#define REQUIRE_COPY_BYTES_8 #else #error Complete me please #endif #if (SIZEOF_DOUBLE + SIZEOF_INT) == 12 (conversion_fct_t)copy_bytes_12, /* DT_DOUBLE_INT */ -#define REQUIRE_COPY_BYTES_12 #else #error Complete me please #endif #if (SIZEOF_LONG_DOUBLE + SIZEOF_INT) == 12 (conversion_fct_t)copy_bytes_12, /* DT_LONG_DOUBLE_INT */ -#define REQUIRE_COPY_BYTES_12 #elif (SIZEOF_LONG_DOUBLE + SIZEOF_INT) == 16 (conversion_fct_t)copy_bytes_16, /* DT_LONG_DOUBLE_INT */ -#define REQUIRE_COPY_BYTES_16 #elif (SIZEOF_LONG_DOUBLE + SIZEOF_INT) == 20 (conversion_fct_t)copy_bytes_20, /* DT_LONG_DOUBLE_INT */ -#define REQUIRE_COPY_BYTES_20 #else #error Complete me please #endif #if (SIZEOF_LONG + SIZEOF_INT) == 8 (conversion_fct_t)copy_bytes_8, /* DT_LONG_INT */ -#define REQUIRE_COPY_BYTES_8 #elif (SIZEOF_LONG + SIZEOF_INT) == 12 (conversion_fct_t)copy_bytes_12, /* DT_LONG_INT */ -#define REQUIRE_COPY_BYTES_12 #else #error Complete me please #endif @@ -523,41 +570,16 @@ conversion_fct_t ompi_ddt_copy_functions[DT_MAX_PREDEFINED] = { (conversion_fct_t)copy_2complex_double, /* DT_2DOUBLE_COMPLEX */ #if SIZEOF_BOOL == 1 (conversion_fct_t)copy_bytes_1, /* DT_CXX_BOOL */ -#define REQUIRE_COPY_BYTES_1 #elif SIZEOF_BOOL == 4 (conversion_fct_t)copy_bytes_4, /* DT_CXX_BOOL */ -#define REQUIRE_COPY_BYTES_4 #elif SIZEOF_BOOL == 8 (conversion_fct_t)copy_bytes_8, /* DT_CXX_BOOL */ -#define REQUIRE_COPY_BYTES_8 #else #error Complete me please #endif (conversion_fct_t)NULL, /* DT_UNAVAILABLE */ }; -#if defined(REQUIRE_COPY_BYTES_1) -COPY_CONTIGUOUS_BYTES( bytes, 1 ) -#endif /* REQUIRE_COPY_BYTES_1 */ -#if defined(REQUIRE_COPY_BYTES_2) -COPY_CONTIGUOUS_BYTES( bytes, 2 ) -#endif /* REQUIRE_COPY_BYTES_2 */ -#if defined(REQUIRE_COPY_BYTES_4) -COPY_CONTIGUOUS_BYTES( bytes, 4 ) -#endif /* REQUIRE_COPY_BYTES_4 */ -#if defined(REQUIRE_COPY_BYTES_8) -COPY_CONTIGUOUS_BYTES( bytes, 8 ) -#endif /* REQUIRE_COPY_BYTES_8 */ -#if defined(REQUIRE_COPY_BYTES_12) -COPY_CONTIGUOUS_BYTES( bytes, 12 ) -#endif /* REQUIRE_COPY_BYTES_12 */ -#if defined(REQUIRE_COPY_BYTES_16) -COPY_CONTIGUOUS_BYTES( bytes, 16 ) -#endif /* REQUIRE_COPY_BYTES_16 */ -#if defined(REQUIRE_COPY_BYTES_20) -COPY_CONTIGUOUS_BYTES( bytes, 20 ) -#endif /* REQUIRE_COPY_BYTES_20 */ - /* Should we supply buffers to the convertor or can we use directly * the user buffer ? */