printStack, ptscotchDecomp: Correct integer type used to hold memory addresses

This commit is contained in:
Henry
2015-05-14 18:48:35 +01:00
parent 51a1c73f39
commit 7dbf92450e
2 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,17 +91,17 @@ void printSourceFileAndLine
// Convert offset into .so into offset into executable.
void *addr;
sscanf(myAddress.c_str(), "%p",&addr);
sscanf(myAddress.c_str(), "%p", &addr);
Dl_info info;
dladdr(addr, &info);
unsigned long offset = ulong(info.dli_fbase);
uintptr_t offset = uintptr_t(info.dli_fbase);
IStringStream addressStr(address.substr(2));
long addressValue = ReadHex<long>(addressStr);
long relativeAddress = addressValue-offset;
uintptr_t addressValue = ReadHex<uintptr_t>(addressStr);
intptr_t relativeAddress = addressValue - offset;
// Reconstruct hex word from address
OStringStream nStream;

View File

@ -566,10 +566,10 @@ Foam::label Foam::ptscotchDecomp::decompose
{
Pout<< "SCOTCH_dgraphBuild with:" << nl
<< "xadjSize-1 : " << xadjSize-1 << nl
<< "xadj : " << long(xadj) << nl
<< "velotab : " << long(velotab.begin()) << nl
<< "xadj : " << uintptr_t(xadj) << nl
<< "velotab : " << uintptr_t(velotab.begin()) << nl
<< "adjncySize : " << adjncySize << nl
<< "adjncy : " << long(adjncy) << nl
<< "adjncy : " << uintptr_t(adjncy) << nl
<< endl;
}