From 1359b48c9f07df91d466654656a8ddfdc536ef4b Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 30 Apr 2023 03:00:57 +0000 Subject: [PATCH] Turn on -Wdouble-promotion. Why not. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4272 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- Makefile | 1 + src/ssb.tests.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f35b5318..cff224b7 100644 --- a/Makefile +++ b/Makefile @@ -114,6 +114,7 @@ $(APP_OBJS): CFLAGS += \ -Ideps/sqlite \ -Ideps/valgrind \ -Ideps/xopt \ + -Wdouble-promotion \ -Werror BLOWFISH_SOURCES := \ diff --git a/src/ssb.tests.c b/src/ssb.tests.c index 9a32fc56..e355f1cb 100644 --- a/src/ssb.tests.c +++ b/src/ssb.tests.c @@ -542,7 +542,7 @@ void tf_ssb_test_bench(const tf_test_options_t* options) tf_ssb_append_post(ssb0, "Hello, world!"); } clock_gettime(CLOCK_REALTIME, &end_time); - tf_printf("insert = %f seconds\n", (float)(end_time.tv_sec - start_time.tv_sec) + (end_time.tv_nsec - start_time.tv_nsec) / 1e9f); + tf_printf("insert = %f seconds\n", (end_time.tv_sec - start_time.tv_sec) + (end_time.tv_nsec - start_time.tv_nsec) / 1e9); tf_ssb_t* ssb1 = tf_ssb_create(&loop, NULL, ":memory:"); tf_ssb_generate_keys(ssb1); @@ -571,7 +571,7 @@ void tf_ssb_test_bench(const tf_test_options_t* options) } clock_gettime(CLOCK_REALTIME, &end_time); tf_printf("Done.\n"); - tf_printf("replicate = %f seconds\n", (float)(end_time.tv_sec - start_time.tv_sec) + (end_time.tv_nsec - start_time.tv_nsec) / 1e9f); + tf_printf("replicate = %f seconds\n", (end_time.tv_sec - start_time.tv_sec) + (end_time.tv_nsec - start_time.tv_nsec) / 1e9); tf_ssb_send_close(ssb1); tf_ssb_server_close(ssb0);