From 1f629ee7f829760b5aca0ea1f5a7898d25e8c1b0 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 15 Oct 2015 17:29:18 +0200 Subject: [PATCH] examples: - output format warnings fixed --- examples/H5/query.c | 8 ++++---- examples/H5Fed/Makefile.am | 11 ++++++++++- examples/H5Fed/tetmesh_adjacencies.c | 2 +- examples/H5Fed/tetmesh_read.c | 2 +- examples/H5Fed/tetmesh_read_tags.c | 10 +++++----- examples/H5Fed/trimesh_adjacencies.c | 2 +- examples/H5Fed/trimesh_read.c | 2 +- examples/H5Part/read_canonicalview.c | 2 +- examples/H5Part/read_core_vfd.c | 2 +- examples/H5Part/read_setnparticles.c | 2 +- examples/H5Part/read_setview.c | 4 ++-- 11 files changed, 28 insertions(+), 19 deletions(-) diff --git a/examples/H5/query.c b/examples/H5/query.c index 3be407d..658b75b 100644 --- a/examples/H5/query.c +++ b/examples/H5/query.c @@ -48,7 +48,7 @@ print_query_result ( h5_int64_t type, h5_int64_t dim ) { - printf ("\t%-6lld %-30s %-15s %-10lld\n", i, name, type2string(type), dim); + printf ("\t%-6lld %-30s %-15s %-10lld\n", (long long)i, name, type2string(type), (long long)dim); } void @@ -61,7 +61,7 @@ query_file_attribs ( // query # of file attributes h5_int64_t n = H5GetNumFileAttribs (f); - printf ("\tNumber of file attributes: %lld\n", n); + printf ("\tNumber of file attributes: %lld\n", (long long)n); // output name and type of all file attribute print_header (n); @@ -85,7 +85,7 @@ query_step_attribs ( // query # of step attributes h5_int64_t n = H5GetNumStepAttribs (f); - printf ("\tNumber of step attributes: %lld\n", n); + printf ("\tNumber of step attributes: %lld\n", (long long)n); // output name and type of all step attribute print_header (n); @@ -108,7 +108,7 @@ query_file ( // query # of steps, if > 0: go to first step, query and output step attribs h5_int64_t n = H5GetNumSteps (f); - printf ("\tNumber of steps: %lld\n", n); + printf ("\tNumber of steps: %lld\n", (long long)n); if (n > 0) { // go to first step diff --git a/examples/H5Fed/Makefile.am b/examples/H5Fed/Makefile.am index 0717cb8..8139859 100644 --- a/examples/H5Fed/Makefile.am +++ b/examples/H5Fed/Makefile.am @@ -1,4 +1,13 @@ -AM_CPPFLAGS += -I${abs_top_builddir}/src/include +# +# Copyright (c) 2006-2015, The Regents of the University of California, +# through Lawrence Berkeley National Laboratory (subject to receipt of any +# required approvals from the U.S. Dept. of Energy) and the Paul Scherrer +# Institut (Switzerland). All rights reserved.! +# +# License: see file COPYING in top level of source distribution. +# + +AM_CPPFLAGS += -I${abs_top_srcdir}/src/include FFLAGS += -cpp $(AM_CPPFLAGS) AM_LDFLAGS += -L${abs_top_builddir}/src/h5core/.libs diff --git a/examples/H5Fed/tetmesh_adjacencies.c b/examples/H5Fed/tetmesh_adjacencies.c index ed9e0f1..cd16a34 100644 --- a/examples/H5Fed/tetmesh_adjacencies.c +++ b/examples/H5Fed/tetmesh_adjacencies.c @@ -522,7 +522,7 @@ traverse_mesh ( Timer* timer = Timer_.new(); /* open mesh and get number of levels */ - printf (" Opening mesh with id %lld\n", mesh_id); + printf (" Opening mesh with id %lld\n", (long long)mesh_id); H5FedOpenTetrahedralMeshByIndex (f, mesh_id, &mesh); h5_size_t num_levels = H5FedGetNumLevels (mesh); printf (" Number of levels in mesh: %lld\n", (long long)num_levels); diff --git a/examples/H5Fed/tetmesh_read.c b/examples/H5Fed/tetmesh_read.c index 3d6213c..568e945 100644 --- a/examples/H5Fed/tetmesh_read.c +++ b/examples/H5Fed/tetmesh_read.c @@ -305,7 +305,7 @@ traverse_mesh ( timer->start(timer); /* open mesh and get number of levels */ - printf (" Opening mesh with id %lld\n", mesh_id); + printf (" Opening mesh with id %lld\n", (long long)mesh_id); H5FedOpenTetrahedralMeshByIndex (f, mesh_id, &mesh); timer->stop(timer); printf (" %fsec\n", timer->elapsed(timer)); diff --git a/examples/H5Fed/tetmesh_read_tags.c b/examples/H5Fed/tetmesh_read_tags.c index 4b94b34..ad6cbbd 100644 --- a/examples/H5Fed/tetmesh_read_tags.c +++ b/examples/H5Fed/tetmesh_read_tags.c @@ -111,7 +111,7 @@ traverse_vertices ( } if (dumpit) { printf (" (%llx, %llx, %llx) |", - tval[0], tval[1], tval[2]); + (long long)tval[0], (long long)tval[1], (long long)tval[2]); } num_entities_tagged++; if (tval[0] != local_id || @@ -172,7 +172,7 @@ traverse_edges ( continue; // not tagged if (dumpit) { printf (" (%llx, %llx, %llx) |", - tval[0], tval[1], tval[2]); + (long long)tval[0], (long long)tval[1], (long long)tval[2]); } num_entities_tagged++; @@ -236,7 +236,7 @@ traverse_triangles ( continue; // not tagged if (dumpit) { printf (" (%llx, %llx, %llx) |", - tval[0], tval[1], tval[2]); + (long long)tval[0], (long long)tval[1], (long long)tval[2]); } num_entities_tagged++; @@ -298,7 +298,7 @@ traverse_tets ( continue; // not tagged if (dumpit) { printf (" (%llx, %llx, %llx) |", - tval[0], tval[1], tval[2]); + (long long)tval[0], (long long)tval[1], (long long)tval[2]); } num_entities_tagged++; @@ -350,7 +350,7 @@ traverse_mesh ( Timer* timer = Timer_.new(); timer->start(timer); /* open mesh and get number of levels */ - printf (" Opening mesh with id %lld\n", mesh_id); + printf (" Opening mesh with id %lld\n", (long long)mesh_id); H5FedOpenTetrahedralMeshByIndex (f, mesh_id, &mesh); timer->stop(timer); printf (" %fsec\n", timer->elapsed(timer)); diff --git a/examples/H5Fed/trimesh_adjacencies.c b/examples/H5Fed/trimesh_adjacencies.c index bfd535c..60a109f 100644 --- a/examples/H5Fed/trimesh_adjacencies.c +++ b/examples/H5Fed/trimesh_adjacencies.c @@ -283,7 +283,7 @@ traverse_mesh ( ) { h5t_mesh_t* m; /* open mesh and get number of levels */ - printf (" Opening mesh with id %lld\n", mesh_id); + printf (" Opening mesh with id %lld\n", (long long)mesh_id); H5FedOpenTriangleMeshByIndex (f, mesh_id, &m); h5_size_t num_levels = H5FedGetNumLevels (m); printf (" Number of levels in mesh: %lld\n", (long long)num_levels); diff --git a/examples/H5Fed/trimesh_read.c b/examples/H5Fed/trimesh_read.c index e4c968c..c237d9e 100644 --- a/examples/H5Fed/trimesh_read.c +++ b/examples/H5Fed/trimesh_read.c @@ -214,7 +214,7 @@ traverse_mesh ( ) { h5t_mesh_t* m; /* open mesh and get number of levels */ - printf (" Opening mesh with id %lld\n", mesh_id); + printf (" Opening mesh with id %lld\n", (long long)mesh_id); H5FedOpenTriangleMeshByIndex (f, mesh_id, &m); h5_size_t num_levels = H5FedGetNumLevels (m); printf (" Number of levels in mesh: %lld\n", (long long)num_levels); diff --git a/examples/H5Part/read_canonicalview.c b/examples/H5Part/read_canonicalview.c index c4a5245..0ccc2cf 100644 --- a/examples/H5Part/read_canonicalview.c +++ b/examples/H5Part/read_canonicalview.c @@ -37,7 +37,7 @@ main ( // set canonical view H5PartSetCanonicalView (file); h5_int64_t num_particles = H5PartGetNumParticles (file); - printf ("[proc %d]: particles in view: %lld\n", comm_rank, num_particles); + printf ("[proc %d]: particles in view: %lld\n", comm_rank, (long long)num_particles); // read and print data h5_int32_t* data = calloc (num_particles, sizeof (*data)); diff --git a/examples/H5Part/read_core_vfd.c b/examples/H5Part/read_core_vfd.c index aa58025..4ad44ff 100644 --- a/examples/H5Part/read_core_vfd.c +++ b/examples/H5Part/read_core_vfd.c @@ -45,7 +45,7 @@ main ( // with core cfd we read the hole file on all cores! h5_int64_t num_particles = H5PartGetNumParticles (file); - printf ("[proc %d]: particles in view: %lld\n", comm_rank, num_particles); + printf ("[proc %d]: particles in view: %lld\n", comm_rank, (long long)num_particles); // read and print data h5_int32_t* data = calloc (num_particles, sizeof (*data)); diff --git a/examples/H5Part/read_setnparticles.c b/examples/H5Part/read_setnparticles.c index 1fff7d6..533f821 100644 --- a/examples/H5Part/read_setnparticles.c +++ b/examples/H5Part/read_setnparticles.c @@ -40,7 +40,7 @@ main ( if (comm_rank+1 == comm_size) num_particles += num_particles_total % comm_size; - printf ("[proc %d]: particles in view: %lld\n", comm_rank, num_particles); + printf ("[proc %d]: particles in view: %lld\n", comm_rank, (long long)num_particles); printf ("[proc %d]: total number of particles: %lld\n", comm_rank, (long long unsigned)num_particles_total); diff --git a/examples/H5Part/read_setview.c b/examples/H5Part/read_setview.c index ec86a5a..f0f5fd9 100644 --- a/examples/H5Part/read_setview.c +++ b/examples/H5Part/read_setview.c @@ -55,7 +55,7 @@ main ( // setting end = start - 1 forces the selection of zero particles! h5_int64_t end = start + num_particles - 1; - printf ("[proc %d]: set view to [%lld..%lld]\n", comm_rank, start, end); + printf ("[proc %d]: set view to [%lld..%lld]\n", comm_rank, (long long)start, (long long)end); H5PartSetView (file, start, end); // read and print data @@ -63,7 +63,7 @@ main ( H5PartReadDataInt32 (file, "data", data); for (int i = 0; i < num_particles; i++) { printf ("[proc %d]: global index = %lld; local index = %d, value = %d\n", - comm_rank, start+i, i, data[i]); + comm_rank, (long long)(start+i), i, data[i]); } // cleanup