From 79e040d203e63ec79bb124215dcd1e940f7b676c Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Fri, 10 Jan 2025 10:08:05 -0500 Subject: pk.h: handle gcc compiler warnings; breaking changes --- test/pkmacros.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'test/pkmacros.cpp') diff --git a/test/pkmacros.cpp b/test/pkmacros.cpp index 5e5377f..8edcbfd 100644 --- a/test/pkmacros.cpp +++ b/test/pkmacros.cpp @@ -136,8 +136,8 @@ int main(int argc, char *argv[]) // MISC { - PK_LOGV_INF("PK_HAS_FLAG 000: %b\n", PK_HAS_FLAG(0xFF, 5)); - PK_LOGV_INF("PK_HAS_FLAG 001: %b\n", PK_HAS_FLAG(0x0F, 5)); + PK_LOGV_INF("PK_HAS_FLAG 000: %s\n", PK_HAS_FLAG(0xFF, 5) ? "true" : "false"); + PK_LOGV_INF("PK_HAS_FLAG 001: %s\n", PK_HAS_FLAG(0x0F, 5) ? "true" : "false"); PK_LOGV_INF("PK_CLAMP 000: %i\n", PK_CLAMP(0, -10, 10)); PK_LOGV_INF("PK_CLAMP 001: %i\n", PK_CLAMP(-20, -10, 10)); PK_LOGV_INF("PK_CLAMP 002: %i\n", PK_CLAMP(20, -10, 10)); @@ -154,9 +154,9 @@ int main(int argc, char *argv[]) { bool b = false; if IS_CONSTRUCTIBLE(sdc) b = true; - fprintf(stdout, "class sdc IS_CONSTRUCTIBLE: %b\n", b); + fprintf(stdout, "class sdc IS_CONSTRUCTIBLE: %s\n", b ? "true" : "false"); if IS_DESTRUCTIBLE(sdc) b = false; - fprintf(stdout, "class sdc IS_DESTRUCTIBLE: %b\n", b); + fprintf(stdout, "class sdc IS_DESTRUCTIBLE: %s\n", b ? "true" : "false"); } // TypeSafeInt @@ -169,22 +169,22 @@ int main(int argc, char *argv[]) PK_LOGV_INF(PK_TO_BIN_PAT_16"\n", PK_TO_BIN_16(static_cast(MyConstexprTSI_16_MAX))); PK_LOGV_INF(PK_TO_BIN_PAT_32"\n", PK_TO_BIN_32(static_cast(MyConstexprTSI_32_MAX))); PK_LOGV_INF(PK_TO_BIN_PAT_64"\n", PK_TO_BIN_64(static_cast(MyConstexprTSI_64_MAX))); - PK_LOGV_INF("tsi_test_operators 08: %b\n", tsi_test_operators()); - PK_LOGV_INF("tsi_test_operators 16: %b\n", tsi_test_operators()); - PK_LOGV_INF("tsi_test_operators 32: %b\n", tsi_test_operators()); - PK_LOGV_INF("tsi_test_operators 64: %b\n", tsi_test_operators()); - PK_LOGV_INF("tsi_test_operators c08: %b\n", tsi_test_operators()); - PK_LOGV_INF("tsi_test_operators c16: %b\n", tsi_test_operators()); - PK_LOGV_INF("tsi_test_operators c32: %b\n", tsi_test_operators()); - PK_LOGV_INF("tsi_test_operators c64: %b\n", tsi_test_operators()); + PK_LOGV_INF("tsi_test_operators 08: %s\n", tsi_test_operators() ? "true" : "false"); + PK_LOGV_INF("tsi_test_operators 16: %s\n", tsi_test_operators() ? "true" : "false"); + PK_LOGV_INF("tsi_test_operators 32: %s\n", tsi_test_operators() ? "true" : "false"); + PK_LOGV_INF("tsi_test_operators 64: %s\n", tsi_test_operators() ? "true" : "false"); + PK_LOGV_INF("tsi_test_operators c08: %s\n", tsi_test_operators() ? "true" : "false"); + PK_LOGV_INF("tsi_test_operators c16: %s\n", tsi_test_operators() ? "true" : "false"); + PK_LOGV_INF("tsi_test_operators c32: %s\n", tsi_test_operators() ? "true" : "false"); + PK_LOGV_INF("tsi_test_operators c64: %s\n", tsi_test_operators() ? "true" : "false"); constexpr bool b1 = tsi_test_operators_constexpr(); constexpr bool b2 = tsi_test_operators_constexpr(); constexpr bool b3 = tsi_test_operators_constexpr(); constexpr bool b4 = tsi_test_operators_constexpr(); - PK_LOGV_INF("TypeSafeInt_constexpr_08: %b\n", b1); - PK_LOGV_INF("TypeSafeInt_constexpr_16: %b\n", b2); - PK_LOGV_INF("TypeSafeInt_constexpr_32: %b\n", b3); - PK_LOGV_INF("TypeSafeInt_constexpr_64: %b\n", b4); + PK_LOGV_INF("TypeSafeInt_constexpr_08: %s\n", b1 ? "true" : "false"); + PK_LOGV_INF("TypeSafeInt_constexpr_16: %s\n", b2 ? "true" : "false"); + PK_LOGV_INF("TypeSafeInt_constexpr_32: %s\n", b3 ? "true" : "false"); + PK_LOGV_INF("TypeSafeInt_constexpr_64: %s\n", b4 ? "true" : "false"); } return 0; -- cgit v1.2.3