From 49d9cf6d7fd35e76e12ae05a65153efa773d1ff9 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 21 Apr 2020 20:28:22 +0200 Subject: [PATCH] Fix format conversion specifiers for pointers Use %p instead of %x + cast to int. Reported by GCC. --- src/avp/bh_near.c | 4 ++-- src/avp/pvisible.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/avp/bh_near.c b/src/avp/bh_near.c index 6f358e8..48697ae 100644 --- a/src/avp/bh_near.c +++ b/src/avp/bh_near.c @@ -1645,7 +1645,7 @@ static void AlienNearState_Retreat(STRATEGYBLOCK *sbPtr) if (targetModule) { //textprint("Target module is %s\n",targetModule->name); - textprint("Target AI module found, %x.\n",(int)targetModule); + textprint("Target AI module found, %p.\n", targetModule); } else { textprint("Target module is NULL!\n"); } @@ -1829,7 +1829,7 @@ static void AlienNearState_Hunt(STRATEGYBLOCK *sbPtr) if (targetModule) { //textprint("Target module is %s\n",targetModule->name); - textprint("Target AI module for hunt found, %x.\n",(int)targetModule); + textprint("Target AI module for hunt found, %p.\n", targetModule); } else { textprint("Target module is NULL!\n"); } diff --git a/src/avp/pvisible.c b/src/avp/pvisible.c index 32e5942..ae061fd 100644 --- a/src/avp/pvisible.c +++ b/src/avp/pvisible.c @@ -234,7 +234,7 @@ void DoObjectVisibility(STRATEGYBLOCK *sbPtr) module. However, we will do a paranoia check for a null containingModule... */ if(!sbPtr->containingModule) { - textprint("Calling Far EmergencyRelocateObject, On object %x, type %d!\n",(int)sbPtr, sbPtr->I_SBtype); + textprint("Calling Far EmergencyRelocateObject, On object %p, type %d!\n", sbPtr, sbPtr->I_SBtype); IdentifyObject(sbPtr); if(!(EmergencyRelocateObject(sbPtr))) { textprint("Relocate failed!\n"); @@ -430,7 +430,7 @@ void DoObjectVisibility(STRATEGYBLOCK *sbPtr) if(!(newModule)) { /* attempt to relocate object */ - textprint("Calling Near EmergencyRelocateObject, On object %x, type %d!\n",(int)sbPtr, sbPtr->I_SBtype); + textprint("Calling Near EmergencyRelocateObject, On object %p, type %d!\n", sbPtr, sbPtr->I_SBtype); IdentifyObject(sbPtr); if(!(EmergencyRelocateObject(sbPtr))) { textprint("Relocate failed!\n");