Fix format conversion specifiers for pointers

Use %p instead of %x + cast to int. Reported by GCC.
This commit is contained in:
Timotej Lazar 2020-04-21 20:28:22 +02:00
parent e7564e9f9d
commit 49d9cf6d7f
2 changed files with 4 additions and 4 deletions

View file

@ -1645,7 +1645,7 @@ static void AlienNearState_Retreat(STRATEGYBLOCK *sbPtr)
if (targetModule) { if (targetModule) {
//textprint("Target module is %s\n",targetModule->name); //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 { } else {
textprint("Target module is NULL!\n"); textprint("Target module is NULL!\n");
} }
@ -1829,7 +1829,7 @@ static void AlienNearState_Hunt(STRATEGYBLOCK *sbPtr)
if (targetModule) { if (targetModule) {
//textprint("Target module is %s\n",targetModule->name); //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 { } else {
textprint("Target module is NULL!\n"); textprint("Target module is NULL!\n");
} }

View file

@ -234,7 +234,7 @@ void DoObjectVisibility(STRATEGYBLOCK *sbPtr)
module. However, we will do a paranoia check for a null containingModule... */ module. However, we will do a paranoia check for a null containingModule... */
if(!sbPtr->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); IdentifyObject(sbPtr);
if(!(EmergencyRelocateObject(sbPtr))) { if(!(EmergencyRelocateObject(sbPtr))) {
textprint("Relocate failed!\n"); textprint("Relocate failed!\n");
@ -430,7 +430,7 @@ void DoObjectVisibility(STRATEGYBLOCK *sbPtr)
if(!(newModule)) if(!(newModule))
{ {
/* attempt to relocate object */ /* 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); IdentifyObject(sbPtr);
if(!(EmergencyRelocateObject(sbPtr))) { if(!(EmergencyRelocateObject(sbPtr))) {
textprint("Relocate failed!\n"); textprint("Relocate failed!\n");