1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-01-11 05:39:04 +00:00

Add a helper function voidp to silence GCC warnings about %p.

We must fully qualify calls to `hr::voidp` because the expression
`voidp(x)` is ambiguous or worse. "/usr/include/zconf.h" defines
`voidp` in the global namespace as a typedef for `void*`.
We don't want an unsafe functional-style cast to `void*`;
we want to call our nice safe helper function. So we qualify the name.
This commit is contained in:
Arthur O'Dwyer
2020-02-22 21:48:46 -05:00
parent 13bf666e29
commit 7a706478dc
10 changed files with 53 additions and 48 deletions

View File

@@ -2629,7 +2629,7 @@ EX namespace dragon {
}
if(cmode & sm::MAP) return c;
if(!history::includeHistory) {
printf("dragon bug #3 (%p -> %p)\n", cor, c);
printf("dragon bug #3 (%p -> %p)\n", hr::voidp(cor), hr::voidp(c));
dragbugs = true;
}
c->monst = moDragonHead; return c;
@@ -3119,7 +3119,7 @@ EX namespace prairie {
forCellEx(c2, c) forCellEx(c3, c2)
if(barrierhept(c3)) barclose++;
printf("c = %p bc = %d\n", c, barclose);
printf("c = %p bc = %d\n", hr::voidp(c), barclose);
raiseBuggyGeneration(c, "could not set river fval");
}