From 2e7bf3211683a899f33b53d70ab6de8d70672ea2 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 28 Nov 2012 23:40:35 +0100 Subject: [PATCH 1/1] Fix printf statements. --- teshsuite/smpi/mpich-test/pt2pt/structlb.c | 14 +++++++------- teshsuite/smpi/mpich-test/pt2pt/testtypes.c | 6 +++--- teshsuite/smpi/mpich-test/pt2pt/typelb.c | 9 +++++---- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/teshsuite/smpi/mpich-test/pt2pt/structlb.c b/teshsuite/smpi/mpich-test/pt2pt/structlb.c index a28d29532e..4e54094ec7 100644 --- a/teshsuite/smpi/mpich-test/pt2pt/structlb.c +++ b/teshsuite/smpi/mpich-test/pt2pt/structlb.c @@ -23,8 +23,8 @@ int main( int argc, char **argv) MPI_Type_ub(tmptype, &ub); MPI_Type_extent(tmptype, &extent); #ifdef DEBUG - printf("tmptype: size: %d lb: %ld ub: %ld ex: %ld\n", size, lb, ub, - extent); + printf("tmptype: size: %d lb: %ld ub: %ld ex: %ld\n", + size, (long)lb, (long)ub, (long)extent); #endif blockcnt[0] = 1; @@ -38,13 +38,13 @@ int main( int argc, char **argv) MPI_Type_ub(newtype, &ub); MPI_Type_extent(newtype, &extent); #ifdef DEBUG - printf("newtype: size: %ld lb: %ld ub: %ld ex: %d\n", size, lb, ub, - extent); + printf("newtype: size: %d lb: %ld ub: %ld ex: %ld\n", + size, (long)lb, (long)ub, (long)extent); #endif if (size != 1 || lb != 2 || ub != 3 || extent != 1) { - printf ("lb = %ld (should be 2), ub = %ld (should be 3) extent = %ld should be 1, size = %d (should be 1)\n", lb, ub, extent, size) ; - } - else { + printf("lb = %ld (should be 2), ub = %ld (should be 3) extent = %ld should be 1, size = %d (should be 1)\n", + (long)lb, (long)ub, (long)extent, size); + } else { printf( " No Errors\n" ); } MPI_Type_free(&tmptype); diff --git a/teshsuite/smpi/mpich-test/pt2pt/testtypes.c b/teshsuite/smpi/mpich-test/pt2pt/testtypes.c index be041816e3..c87788ecaa 100644 --- a/teshsuite/smpi/mpich-test/pt2pt/testtypes.c +++ b/teshsuite/smpi/mpich-test/pt2pt/testtypes.c @@ -11,21 +11,21 @@ int main( int argc, char **argv ) MPI_Type_extent(MPI_INT, &i_extent); - printf("MPI_Type_extent (MPI_INT) = %ld\n", i_extent); + printf("MPI_Type_extent (MPI_INT) = %ld\n", (long)i_extent); MPI_Type_size(MPI_INT, &i_size); printf("MPI_Type_size (MPI_INT) = %d\n", i_size); MPI_Type_extent(MPI_UNSIGNED, &i_extent); - printf("MPI_Type_extent (MPI_UNSIGNED) = %ld\n", i_extent); + printf("MPI_Type_extent (MPI_UNSIGNED) = %ld\n", (long)i_extent); MPI_Type_size(MPI_UNSIGNED, &i_size); printf("MPI_Type_size (MPI_UNSIGNED) = %d\n", i_size); #if defined(HAVE_LONG_DOUBLE) MPI_Type_extent(MPI_LONG_DOUBLE, &i_extent); - printf("MPI_Type_extent (MPI_LONG_DOUBLE) = %ld\n", i_extent); + printf("MPI_Type_extent (MPI_LONG_DOUBLE) = %ld\n", (long)i_extent); MPI_Type_size(MPI_LONG_DOUBLE, &i_size); printf("MPI_Type_size (MPI_LONG_DOUBLE) = %d\n", i_size); diff --git a/teshsuite/smpi/mpich-test/pt2pt/typelb.c b/teshsuite/smpi/mpich-test/pt2pt/typelb.c index 1da6964e6f..edcb2bb149 100644 --- a/teshsuite/smpi/mpich-test/pt2pt/typelb.c +++ b/teshsuite/smpi/mpich-test/pt2pt/typelb.c @@ -26,13 +26,14 @@ main( int argc, char **argv) /* Check that the results are correct */ #ifdef DEBUG - printf("lb=%ld, ub=%ld, extent=%ld\n", lb, ub, extent); + printf("lb=%ld, ub=%ld, extent=%ld\n", + (long)lb, (long)ub, (long)extent); printf("Should be lb=4, ub=5, extent=1\n"); #endif if (lb != 4 || ub != 5 || extent != 1) { - printf ("lb = %ld (should be 4), ub = %ld (should be 5) extent = %ld should be 1\n", lb, ub, extent) ; - } - else { + printf("lb = %ld (should be 4), ub = %ld (should be 5) extent = %ld should be 1\n", + (long)lb, (long)ub, (long)extent) ; + } else { printf( " No Errors\n" ); } -- 2.20.1