STYLE: use uintptr_t cast instead of long when reporting addresses

This commit is contained in:
Mark Olesen
2019-04-29 08:15:48 +02:00
committed by Andrew Heather
parent 4a1208ed30
commit 59da4cf56d
20 changed files with 65 additions and 65 deletions

View File

@ -75,8 +75,8 @@ void printTuple2(const Tuple2<word, word>& t)
{
Info<< "tuple: " << t << nl;
Info<< "first @: " << long(t.first().data()) << nl;
Info<< "second @: " << long(t.second().data()) << nl;
Info<< "first @: " << uintptr_t(t.first().data()) << nl;
Info<< "second @: " << uintptr_t(t.second().data()) << nl;
}
@ -85,8 +85,8 @@ void printTuple2(const Pair<word>& t)
{
Info<< "tuple: " << t << nl;
Info<< "first @: " << long(t.first().data()) << nl;
Info<< "second @: " << long(t.second().data()) << nl;
Info<< "first @: " << uintptr_t(t.first().data()) << nl;
Info<< "second @: " << uintptr_t(t.second().data()) << nl;
}
@ -191,30 +191,30 @@ int main()
word word1("hello");
word word2("word");
Info<< "create with " << word1 << " @ " << long(word1.data())
<< " " << word2 << " @ " << long(word2.data()) << nl;
Info<< "create with " << word1 << " @ " << uintptr_t(word1.data())
<< " " << word2 << " @ " << uintptr_t(word2.data()) << nl;
Tuple2<word, word> tup(std::move(word2), std::move(word1));
printTuple2(tup);
Info<< "input is now " << word1 << " @ " << long(word1.data())
<< " " << word2 << " @ " << long(word2.data()) << nl;
Info<< "input is now " << word1 << " @ " << uintptr_t(word1.data())
<< " " << word2 << " @ " << uintptr_t(word2.data()) << nl;
}
{
word word1("hello");
word word2("word");
Info<< "create with " << word1 << " @ " << long(word1.data())
<< " " << word2 << " @ " << long(word2.data()) << nl;
Info<< "create with " << word1 << " @ " << uintptr_t(word1.data())
<< " " << word2 << " @ " << uintptr_t(word2.data()) << nl;
Pair<word> tup(std::move(word2), std::move(word1));
printTuple2(tup);
Info<< "input is now " << word1 << " @ " << long(word1.data())
<< " " << word2 << " @ " << long(word2.data()) << nl;
Info<< "input is now " << word1 << " @ " << uintptr_t(word1.data())
<< " " << word2 << " @ " << uintptr_t(word2.data()) << nl;
}
Info<< "\nEnd\n" << endl;