diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dabcb35ef..00322ba6b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,6 +24,9 @@ project(${PROJECT_NAME} VERSION ${HYPRE_VERSION} LANGUAGES C) +# We use C99 by default, but users are free to specify any newer standard version +set(CMAKE_C_STANDARD 99) + if (${HYPRE_SOURCE_DIR} STREQUAL ${HYPRE_BINARY_DIR}) message(FATAL_ERROR "In-place build not allowed! Please use a separate build directory. See the Users Manual or INSTALL file for details.") endif () diff --git a/src/utilities/_hypre_utilities.h b/src/utilities/_hypre_utilities.h index 11f064f5a..2a9ae9080 100644 --- a/src/utilities/_hypre_utilities.h +++ b/src/utilities/_hypre_utilities.h @@ -395,10 +395,8 @@ typedef struct hypre_MatrixStatsArray_struct hypre_printf(" %s\n", msg); #define HYPRE_PRINT_INDENT(n) \ - for (HYPRE_Int __i = 0; __i < n; __i++) \ - { \ - hypre_printf(" "); \ - } + hypre_printf("%*s", (n > 0) ? n : 0, ""); + #define HYPRE_PRINT_SHIFTED_PARAM(n, ...) \ HYPRE_PRINT_INDENT(n) \ diff --git a/src/utilities/matrix_stats.h b/src/utilities/matrix_stats.h index 925610100..e583868ed 100644 --- a/src/utilities/matrix_stats.h +++ b/src/utilities/matrix_stats.h @@ -118,10 +118,8 @@ typedef struct hypre_MatrixStatsArray_struct hypre_printf(" %s\n", msg); #define HYPRE_PRINT_INDENT(n) \ - for (HYPRE_Int __i = 0; __i < n; __i++) \ - { \ - hypre_printf(" "); \ - } + hypre_printf("%*s", (n > 0) ? n : 0, ""); + #define HYPRE_PRINT_SHIFTED_PARAM(n, ...) \ HYPRE_PRINT_INDENT(n) \