Changed: Replaced display of pointers using %d or %X by %p

This commit is contained in:
kervala 2011-03-28 17:32:49 +02:00
parent 2723c28412
commit fd2e0977fe
12 changed files with 53 additions and 53 deletions

View file

@ -117,7 +117,7 @@ bool CCoarseMeshBuild::buildBitmap (const std::vector<CCoarseMeshDesc>& coarseMe
else
{
// Build a name
name+=toString ("%d",(ptrdiff_t)texture);
name+=toString ("%p", texture);
}
}
@ -477,7 +477,7 @@ void CCoarseMeshBuild::remapCoordinates (const std::vector<CCoarseMeshDesc>& coa
else
{
// Build a name
name+=toString ("%d",(ptrdiff_t)texture);
name+=toString ("%p", texture);
}
}

View file

@ -2305,13 +2305,13 @@ void CParticleSystem::dumpHierarchy()
CPSLocated *loc = dynamic_cast<CPSLocated *>(_ProcessVect[k]);
if (loc)
{
nlinfo("Located k : %s @%x", loc->getName().c_str(), (ptrdiff_t) loc);
nlinfo("Located k : %s @%p", loc->getName().c_str(), loc);
for(uint l = 0; l < loc->getNbBoundObjects(); ++l)
{
CPSEmitter *emitter = dynamic_cast<CPSEmitter *>(loc->getBoundObject(l));
if (emitter)
{
nlinfo(" emitter %s : emit %s @%x", emitter->getName().c_str(), emitter->getEmittedType() ? emitter->getEmittedType()->getName().c_str() : "none", (ptrdiff_t) emitter->getEmittedType());
nlinfo(" emitter %s : emit %s @%p", emitter->getName().c_str(), emitter->getEmittedType() ? emitter->getEmittedType()->getName().c_str() : "none", emitter->getEmittedType());
}
}
}

View file

@ -1300,12 +1300,12 @@ void CRenderTrav::debugWaterModelMemory(const char *tag, bool dumpList)
{
// Before crash, do some log
nlwarning("******* WaterModelList crash after %s", tag);
nlwarning("Current: Ptr:%x. List:%x/%x", (ptrdiff_t)dmp.Address, (ptrdiff_t)dmp.ClippedPolyBegin, (ptrdiff_t)dmp.ClippedPolyEnd);
nlwarning("Current: Ptr:%p. List:%p/%p", dmp.Address, dmp.ClippedPolyBegin, dmp.ClippedPolyEnd);
// Log also the list bkuped (to do comparisons)
for(uint i=0;i<_DebugWaterModelList.size();i++)
{
CWaterModelDump &bkup= _DebugWaterModelList[i];
nlwarning("List%02d: Ptr:%x. Array:%x/%x", i, (ptrdiff_t)bkup.Address, (ptrdiff_t)bkup.ClippedPolyBegin, (ptrdiff_t)bkup.ClippedPolyEnd);
nlwarning("List%02d: Ptr:%p. Array:%p/%p", i, bkup.Address, bkup.ClippedPolyBegin, bkup.ClippedPolyEnd);
}
// crash (assert not stop for clearness)

View file

@ -188,8 +188,8 @@ void CForm::read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const cha
if ( ((const char*)node->name == NULL) || (strcmp ((const char*)node->name, "FORM") != 0) )
{
// Make an error message
warning (true, "read", "XML Syntax error in block line %d, node (%s) should be FORM.",
(ptrdiff_t)node->content, node->name);
warning (true, "read", "XML Syntax error in block line %p, node (%s) should be FORM.",
node->content, node->name);
}
// Get first struct node
@ -197,8 +197,8 @@ void CForm::read (xmlNodePtr node, CFormLoader &loader, CFormDfn *dfn, const cha
if (child == NULL)
{
// Throw exception
warning (true, "read", "Syntax error in block line %d, node (%s) should have a STRUCT child node.",
(ptrdiff_t)node->content, node->name);
warning (true, "read", "Syntax error in block line %p, node (%s) should have a STRUCT child node.",
node->content, node->name);
}
// Read the struct

View file

@ -115,7 +115,7 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const
if ( ((const char*)root->name == NULL) || (strcmp ((const char*)root->name, "DFN") != 0) )
{
// Throw exception
warning (true, "read", "XML Syntax error in block line %d, node (%s) should be DFN.", (ptrdiff_t)root->content, root->name);
warning (true, "read", "XML Syntax error in block line %p, node (%s) should be DFN.", root->content, root->name);
}
// Count the parent
@ -147,8 +147,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const
else
{
// Throw exception
warning (true, "read", "XML Syntax error in block (%s) line %d, aguments Name not found.",
parent->name, (ptrdiff_t)parent->content);
warning (true, "read", "XML Syntax error in block (%s) line %p, aguments Name not found.",
parent->name, parent->content);
}
// Next parent
@ -230,8 +230,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const
if ((Entries[childNumber].Type == NULL) && !forceLoad)
{
// Throw exception
warning (true, "read", "In XML block (%s) line %d, file not found %s.",
child->name, (ptrdiff_t)child->content, Entries[childNumber].Filename.c_str ());
warning (true, "read", "In XML block (%s) line %p, file not found %s.",
child->name, child->content, Entries[childNumber].Filename.c_str ());
}
// Read the default value
@ -247,8 +247,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const
else
{
// Throw exception
warning (true, "read", "XML In block (%s) line %d, no filename found for the .typ file.",
child->name, (ptrdiff_t)child->content, Entries[childNumber].Filename.c_str ());
warning (true, "read", "XML In block (%s) line %p, no filename found for the .typ file.",
child->name, child->content);
}
}
else if (stricmp (typeName, "Dfn") == 0)
@ -264,15 +264,15 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const
if ((Entries[childNumber].Dfn == NULL) && !forceLoad)
{
// Throw exception
warning (true, "read", "XML In block (%s) line %d, file not found %s.",
child->name, (ptrdiff_t)child->content, Entries[childNumber].Filename.c_str ());
warning (true, "read", "XML In block (%s) line %p, file not found %s.",
child->name, child->content, Entries[childNumber].Filename.c_str ());
}
}
else
{
// Throw exception
warning (true, "read", "XML In block (%s) line %d, no filename found for the .typ file.",
child->name, (ptrdiff_t)child->content, Entries[childNumber].Filename.c_str ());
warning (true, "read", "XML In block (%s) line %p, no filename found for the .typ file.",
child->name, child->content);
}
}
else if (stricmp (typeName, "DfnPointer") == 0)
@ -282,8 +282,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const
else
{
// Throw exception
warning (true, "read", "XML Syntax error in block (%s) line %d, element has not a valid type name attribut \"Type = %s\".",
child->name, (ptrdiff_t)child->content, typeName);
warning (true, "read", "XML Syntax error in block (%s) line %p, element has not a valid type name attribut \"Type = %s\".",
child->name, child->content, typeName);
}
// Delete the value
@ -292,8 +292,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const
else
{
// Throw exception
warning (true, "read", "XML Syntax error in block (%s) line %d, element has no type name attribut \"Type = [Type][Dfn][DfnPointer]\".",
child->name, (ptrdiff_t)child->content);
warning (true, "read", "XML Syntax error in block (%s) line %p, element has no type name attribut \"Type = [Type][Dfn][DfnPointer]\".",
child->name, child->content);
}
// Get the array attrib
@ -310,8 +310,8 @@ void CFormDfn::read (xmlNodePtr root, CFormLoader &loader, bool forceLoad, const
else
{
// Throw exception
warning (true, "read", "XML Syntax error in block (%s) line %d, aguments Name not found.",
root->name, (ptrdiff_t)root->content);
warning (true, "read", "XML Syntax error in block (%s) line %p, aguments Name not found.",
root->name, root->content);
}
// Next child

View file

@ -1904,8 +1904,8 @@ void CFormElmStruct::read (xmlNodePtr node, CFormLoader &loader, const CFormDfn
else
{
// Make a warning message
warning (false, "read", "In block line %d, node (%s) type in DFN have changed.",
(ptrdiff_t)child->content, child->name);
warning (false, "read", "In block line %p, node (%s) type in DFN have changed.",
child->content, child->name);
}
}
else
@ -1917,8 +1917,8 @@ void CFormElmStruct::read (xmlNodePtr node, CFormLoader &loader, const CFormDfn
}
// Throw exception
warning (true, "read", "XML Syntax error in block line %d, node (%s) name should be STRUCT, ATOM or ARRAY.",
(ptrdiff_t)child->content, child->name);
warning (true, "read", "XML Syntax error in block line %p, node (%s) name should be STRUCT, ATOM or ARRAY.",
child->content, child->name);
}
}
@ -2199,8 +2199,8 @@ void CFormElmVirtualStruct::read (xmlNodePtr node, CFormLoader &loader, CForm *f
else
{
// Throw exception
warning (true, "read", "XML Syntax error in virtual struct in block line %d, should have a DfnName property.",
(ptrdiff_t)node->content, node->name);
warning (true, "read", "XML Syntax error in virtual struct in block line %p, should have a DfnName property.",
node->content);
}
// Read the parent

View file

@ -123,8 +123,8 @@ void CFileHeader::read (xmlNodePtr root)
xmlFree ((void*)value);
// Throw exception
warning (true, "read", "XML Syntax error in TYPE block line %d, the Version argument is invalid.",
(ptrdiff_t)root->content);
warning (true, "read", "XML Syntax error in TYPE block line %p, the Version argument is invalid.",
root->content);
}
// Delete the value
@ -173,8 +173,8 @@ void CFileHeader::read (xmlNodePtr root)
xmlFree ((void*)value);
// Throw exception
warning (true, "read", "XML Syntax error in TYPE block line %d, the State argument is invalid.",
(ptrdiff_t)root->content);
warning (true, "read", "XML Syntax error in TYPE block line %p, the State argument is invalid.",
root->content);
}
// Delete the value

View file

@ -110,8 +110,8 @@ void CType::read (xmlNodePtr root)
if ( ((const char*)root->name == NULL) || (strcmp ((const char*)root->name, "TYPE") != 0) )
{
// Throw exception
warning2 (true, "read", "XML Syntax error in block line %d, node (%s) should be TYPE.",
(ptrdiff_t)root->content, root->name);
warning2 (true, "read", "XML Syntax error in block line %p, node (%s) should be TYPE.",
root->content, root->name);
}
// Read the type
@ -138,8 +138,8 @@ void CType::read (xmlNodePtr root)
xmlFree ((void*)value);
// Throw exception
warning2 (true, "read", "XML Syntax error in TYPE block line %d, the Type value is unknown (%s).",
(ptrdiff_t)root->content, valueStr.c_str ());
warning2 (true, "read", "XML Syntax error in TYPE block line %p, the Type value is unknown (%s).",
root->content, valueStr.c_str ());
}
// Delete the value
@ -148,8 +148,8 @@ void CType::read (xmlNodePtr root)
else
{
// Throw exception
warning2 (true, "read", "XML Syntax error in TYPE block line %d, the Type argument was not found.",
(ptrdiff_t)root->content);
warning2 (true, "read", "XML Syntax error in TYPE block line %p, the Type argument was not found.",
root->content);
}
// Read the UI
@ -256,8 +256,8 @@ void CType::read (xmlNodePtr root)
xmlFree ((void*)label);
// Throw exception
warning2 (true, "read", "XML Syntax error in DEFINITION block line %d, the Value argument was not found.",
(ptrdiff_t)childPtr->content);
warning2 (true, "read", "XML Syntax error in DEFINITION block line %p, the Value argument was not found.",
childPtr->content);
}
// Delete the value
@ -266,8 +266,8 @@ void CType::read (xmlNodePtr root)
else
{
// Throw exception
warning2 (true, "read", "XML Syntax error in DEFINITION block line %d, the Label argument was not found.",
(ptrdiff_t)childPtr->content);
warning2 (true, "read", "XML Syntax error in DEFINITION block line %p, the Label argument was not found.",
childPtr->content);
}
// One more

View file

@ -530,7 +530,7 @@ void CLigoConfig::syntaxError (const char *filename, xmlNodePtr xmlNode, const c
vsnprintf( buffer, 1024, format, args );
va_end( args );
errorMessage ("(%s), node (%s), line (%d) :\n%s", filename, xmlNode->name, (ptrdiff_t)xmlNode->content, buffer);
errorMessage ("(%s), node (%s), line (%p) :\n%s", filename, xmlNode->name, xmlNode->content, buffer);
}
// ***************************************************************************

View file

@ -59,7 +59,7 @@ void XMLError (xmlNodePtr xmlNode, const char *filename, const char *format, ...
vsnprintf( buffer, 1024, format, args );
va_end( args );
Error (filename, "node (%s), line (%d) : %s", xmlNode->name, (ptrdiff_t)xmlNode->content, buffer);
Error (filename, "node (%s), line (%p) : %s", xmlNode->name, xmlNode->content, buffer);
}

View file

@ -734,10 +734,10 @@ public:
str = "<NoModule>";
}
char tmp[32];
sprintf (tmp, "!0x%X", addr);
sprintf (tmp, "!0x%p", addr);
str += tmp;
//}
str +=" DEBUG:"+toString("0x%08X", addr);
str +=" DEBUG:"+toString("0x%p", addr);
//
@ -925,7 +925,7 @@ public:
if(*addr == NULL)
sprintf (tmp, "<NULL>");
else
sprintf (tmp, "0x%X", *addr);
sprintf (tmp, "0x%p", *addr);
}
}

View file

@ -97,7 +97,7 @@ static string getFuncInfo (DWORD_TYPE funcAddr, DWORD_TYPE stackAddr)
if (stop==0 && (parse[i] == ',' || parse[i] == ')'))
{
char tmp[32];
sprintf (tmp, "=0x%X", *((ULONG*)(stackAddr) + 2 + pos++));
sprintf (tmp, "=0x%p", *((ULONG*)(stackAddr) + 2 + pos++));
str += tmp;
}
str += parse[i];