summaryrefslogtreecommitdiff
path: root/test/pkmacros.cpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-01-10 10:08:05 -0500
committerJonathan Bradley <jcb@pikum.xyz>2025-01-10 10:08:05 -0500
commit79e040d203e63ec79bb124215dcd1e940f7b676c (patch)
tree23c11c6911b99161d0063e63122d9dd15485e1ed /test/pkmacros.cpp
parent74fb835d28f2a4e604a32fd292bb3060a832a1db (diff)
pk.h: handle gcc compiler warnings; breaking changes
Diffstat (limited to 'test/pkmacros.cpp')
-rw-r--r--test/pkmacros.cpp32
1 files changed, 16 insertions, 16 deletions
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_T>(MyConstexprTSI_16_MAX)));
PK_LOGV_INF(PK_TO_BIN_PAT_32"\n", PK_TO_BIN_32(static_cast<MyConstexprTSI_32_T>(MyConstexprTSI_32_MAX)));
PK_LOGV_INF(PK_TO_BIN_PAT_64"\n", PK_TO_BIN_64(static_cast<MyConstexprTSI_64_T>(MyConstexprTSI_64_MAX)));
- PK_LOGV_INF("tsi_test_operators 08: %b\n", tsi_test_operators<MyTSI_8, MyTSI_8_T>());
- PK_LOGV_INF("tsi_test_operators 16: %b\n", tsi_test_operators<MyTSI_16, MyTSI_16_T>());
- PK_LOGV_INF("tsi_test_operators 32: %b\n", tsi_test_operators<MyTSI_32, MyTSI_32_T>());
- PK_LOGV_INF("tsi_test_operators 64: %b\n", tsi_test_operators<MyTSI_64, MyTSI_64_T>());
- PK_LOGV_INF("tsi_test_operators c08: %b\n", tsi_test_operators<MyConstexprTSI_8, MyConstexprTSI_8_T>());
- PK_LOGV_INF("tsi_test_operators c16: %b\n", tsi_test_operators<MyConstexprTSI_16, MyConstexprTSI_16_T>());
- PK_LOGV_INF("tsi_test_operators c32: %b\n", tsi_test_operators<MyConstexprTSI_32, MyConstexprTSI_32_T>());
- PK_LOGV_INF("tsi_test_operators c64: %b\n", tsi_test_operators<MyConstexprTSI_64, MyConstexprTSI_64_T>());
+ PK_LOGV_INF("tsi_test_operators 08: %s\n", tsi_test_operators<MyTSI_8, MyTSI_8_T>() ? "true" : "false");
+ PK_LOGV_INF("tsi_test_operators 16: %s\n", tsi_test_operators<MyTSI_16, MyTSI_16_T>() ? "true" : "false");
+ PK_LOGV_INF("tsi_test_operators 32: %s\n", tsi_test_operators<MyTSI_32, MyTSI_32_T>() ? "true" : "false");
+ PK_LOGV_INF("tsi_test_operators 64: %s\n", tsi_test_operators<MyTSI_64, MyTSI_64_T>() ? "true" : "false");
+ PK_LOGV_INF("tsi_test_operators c08: %s\n", tsi_test_operators<MyConstexprTSI_8, MyConstexprTSI_8_T>() ? "true" : "false");
+ PK_LOGV_INF("tsi_test_operators c16: %s\n", tsi_test_operators<MyConstexprTSI_16, MyConstexprTSI_16_T>() ? "true" : "false");
+ PK_LOGV_INF("tsi_test_operators c32: %s\n", tsi_test_operators<MyConstexprTSI_32, MyConstexprTSI_32_T>() ? "true" : "false");
+ PK_LOGV_INF("tsi_test_operators c64: %s\n", tsi_test_operators<MyConstexprTSI_64, MyConstexprTSI_64_T>() ? "true" : "false");
constexpr bool b1 = tsi_test_operators_constexpr<MyConstexprTSI_8, MyConstexprTSI_8_T>();
constexpr bool b2 = tsi_test_operators_constexpr<MyConstexprTSI_16, MyConstexprTSI_16_T>();
constexpr bool b3 = tsi_test_operators_constexpr<MyConstexprTSI_32, MyConstexprTSI_32_T>();
constexpr bool b4 = tsi_test_operators_constexpr<MyConstexprTSI_64, MyConstexprTSI_64_T>();
- 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;