summaryrefslogtreecommitdiff
path: root/test/pkuuid.cpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-05-07 13:25:36 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-05-07 14:33:26 -0400
commitcc95f28f648ee56a189f733f25efcb986d9f205a (patch)
tree7f48f2308f87e1c69b4ca997ca373964a67ae65a /test/pkuuid.cpp
parent86b9b350c6344e78f0d22bcd054e568130a40b08 (diff)
pk.h: compiler warnings
Diffstat (limited to 'test/pkuuid.cpp')
-rw-r--r--test/pkuuid.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/pkuuid.cpp b/test/pkuuid.cpp
index 35c099f..5755c54 100644
--- a/test/pkuuid.cpp
+++ b/test/pkuuid.cpp
@@ -1,6 +1,4 @@
-#define PK_IMPL_UUID
-#define PK_IMPL_TMR
// #define PK_UUID_CLOCK CLOCK_REALTIME_ALARM
#include "../pkmacros.h"
@@ -37,13 +35,13 @@ print_uuid_v7_breakdown(FILE *f, struct pk_uuid id)
fprintf(f, "\n");
fprintf(f, "var 2 0b");
- fprintf(f, "%.c", (id.uuid[8] & 0x80) ? '1' : '0');
- fprintf(f, "%.c", (id.uuid[8] & 0x40) ? '1' : '0');
+ fprintf(f, "%c", (id.uuid[8] & 0x80) ? '1' : '0');
+ fprintf(f, "%c", (id.uuid[8] & 0x40) ? '1' : '0');
fprintf(f, "\n");
fprintf(f, "rand_b 62 0b");
- fprintf(f, "%.c", (id.uuid[8] & 0x20) ? '1' : '0');
- fprintf(f, "%.c", (id.uuid[8] & 0x10) ? '1' : '0');
+ fprintf(f, "%c", (id.uuid[8] & 0x20) ? '1' : '0');
+ fprintf(f, "%c", (id.uuid[8] & 0x10) ? '1' : '0');
fprintf(f, ", 0x");
fprintf(f, "%.x", (id.uuid[8] & 0x0F));
fprintf(f, "%.2x", id.uuid[9]);
@@ -85,12 +83,12 @@ main(int argc, char *argv[])
id1 = pk_uuid_zed;
id2 = pk_uuid_zed;
equals = id1 == id2;
- fprintf(stdout, "[%s] equals (zed, zed): %b\n", __FILE__, equals);
+ fprintf(stdout, "[%s] equals (zed, zed): %c\n", __FILE__, equals ? '1' : '0');
if (equals != true) exit(1);
id1 = pk_uuid_new_v7();
id2 = pk_uuid_new_v7();
equals = id1 == id2;
- fprintf(stdout, "[%s] equals (rand, rand): %b\n", __FILE__, equals);
+ fprintf(stdout, "[%s] equals (rand, rand): %c\n", __FILE__, equals ? '1' : '0');
if (equals != false) exit(1);
}