From 8c92dc2e76dc1b3dd55fb0cb7f3d804afa0efa18 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Mon, 30 Mar 2015 16:43:26 +0200 Subject: [PATCH] Fix indentation issues --- benchs/bench_gmio/main.c | 8 ++++---- benchs/bench_occ/main.cpp | 23 ++++++++++------------- benchs/commons/bench_tools.c | 22 +++++++++++----------- src/gmio_core/buffer.h | 1 - src/gmio_core/memory.h | 8 +++++--- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/benchs/bench_gmio/main.c b/benchs/bench_gmio/main.c index 19eb743..8c745e7 100644 --- a/benchs/bench_gmio/main.c +++ b/benchs/bench_gmio/main.c @@ -5,16 +5,16 @@ typedef struct my_igeom { - uint32_t facet_count; + uint32_t facet_count; } my_igeom_t; static void dummy_process_triangle(void* cookie, uint32_t triangle_id, const gmio_stl_triangle_t* triangle) { - my_igeom_t* my_igeom = (my_igeom_t*)(cookie); - if (my_igeom != NULL) - ++(my_igeom->facet_count); + my_igeom_t* my_igeom = (my_igeom_t*)(cookie); + if (my_igeom != NULL) + ++(my_igeom->facet_count); } static void bench_gmio_stl_read(const char* filepath) diff --git a/benchs/bench_occ/main.cpp b/benchs/bench_occ/main.cpp index 6c723ae..df9a7af 100644 --- a/benchs/bench_occ/main.cpp +++ b/benchs/bench_occ/main.cpp @@ -10,34 +10,31 @@ static void bench_occ_RWStl_ReadFile(const char* filepath) { - RWStl::ReadFile(OSD_Path(filepath)); + RWStl::ReadFile(OSD_Path(filepath)); } static void bench_gmio_stl_read(const char* filepath) { gmio_buffer_t buffer = gmio_buffer_malloc(256 * 1024); - Handle_StlMesh_Mesh mesh = new StlMesh_Mesh; gmio_stl_mesh_creator_t mesh_creator = gmio_stl_occmesh_creator(mesh); - int error = gmio_stl_read_file(filepath, &buffer, &mesh_creator); if (error != GMIO_NO_ERROR) printf("GeomIO error: 0x%X\n", error); - gmio_buffer_deallocate(&buffer); } int main(int argc, char** argv) { - if (argc > 1) { - benchmark(&bench_occ_RWStl_ReadFile, - "RWStl::ReadFile()", - argc - 1, argv + 1); + if (argc > 1) { + benchmark(&bench_occ_RWStl_ReadFile, + "RWStl::ReadFile()", + argc - 1, argv + 1); - benchmark(&bench_gmio_stl_read, - "gmio_stl_read()", - argc - 1, argv + 1); - } + benchmark(&bench_gmio_stl_read, + "gmio_stl_read()", + argc - 1, argv + 1); + } - return 0; + return 0; } diff --git a/benchs/commons/bench_tools.c b/benchs/commons/bench_tools.c index 4f7ec81..41e9b19 100644 --- a/benchs/commons/bench_tools.c +++ b/benchs/commons/bench_tools.c @@ -4,22 +4,22 @@ float elapsed_secs(clock_t start_tick) { - return (float)((clock() - start_tick) / (float)CLOCKS_PER_SEC); + return (float)((clock() - start_tick) / (float)CLOCKS_PER_SEC); } void benchmark( void (*func)(const char*), const char* title, int argc, char** argv) { - const clock_t start_tick = clock(); - int iarg; + const clock_t start_tick = clock(); + int iarg; - if (func == NULL) - return; + if (func == NULL) + return; - printf("Bench %s ...\n", title); - for (iarg = 0; iarg < argc; ++iarg) { - printf(" Read file %s ...\n", argv[iarg]); - (*func)(argv[iarg]); - } - printf("\n %s exec time: %.2fs\n", title, elapsed_secs(start_tick)); + printf("Bench %s ...\n", title); + for (iarg = 0; iarg < argc; ++iarg) { + printf(" Read file %s ...\n", argv[iarg]); + (*func)(argv[iarg]); + } + printf("\n %s exec time: %.2fs\n", title, elapsed_secs(start_tick)); } diff --git a/src/gmio_core/buffer.h b/src/gmio_core/buffer.h index a270644..ee5dd0c 100644 --- a/src/gmio_core/buffer.h +++ b/src/gmio_core/buffer.h @@ -35,7 +35,6 @@ struct gmio_buffer /*! Optional pointer on function that deallocates the memory block \p ptr */ void (*deallocate_func)(void* ptr); - }; typedef struct gmio_buffer gmio_buffer_t; diff --git a/src/gmio_core/memory.h b/src/gmio_core/memory.h index c7657a8..ed9394a 100644 --- a/src/gmio_core/memory.h +++ b/src/gmio_core/memory.h @@ -18,10 +18,12 @@ #include -/*! Type alias for "pointer on function that allocates memory" (like standard malloc()) */ +/*! Type alias for "pointer on function that allocates memory" (like standard + * malloc()) */ typedef void* (*gmio_malloc_func_t)(size_t); -/*! Type alias for "pointer on function that frees memory" (like standard free()) */ -typedef void (*gmio_free_func_t)(void*); +/*! Type alias for "pointer on function that frees memory" (like standard + * free()) */ +typedef void (*gmio_free_func_t)(void*); #endif /* GMIO_MEMORY_H */