本文整理汇总了C++中PolyWord::AsUnsigned方法的典型用法代码示例。如果您正苦于以下问题:C++ PolyWord::AsUnsigned方法的具体用法?C++ PolyWord::AsUnsigned怎么用?C++ PolyWord::AsUnsigned使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolyWord
的用法示例。
在下文中一共展示了PolyWord::AsUnsigned方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetConstantValue
// Store a constant value. Also used with a patch table when importing a saved heap which has
// been exported using the C exporter.
void ScanAddress::SetConstantValue(byte *addressOfConstant, PolyWord p, ScanRelocationKind code)
{
switch (code)
{
case PROCESS_RELOC_DIRECT: // 32 or 64 bit address of target
{
POLYUNSIGNED valu = p.AsUnsigned();
for (unsigned i = 0; i < sizeof(PolyWord); i++)
{
addressOfConstant[i] = (byte)(valu & 255);
valu >>= 8;
}
}
break;
case PROCESS_RELOC_I386RELATIVE: // 32 bit relative address
{
POLYSIGNED newDisp = p.AsCodePtr() - addressOfConstant - 4;
#if (SIZEOF_VOIDP != 4)
ASSERT(newDisp < 0x80000000 && newDisp >= -(POLYSIGNED)0x80000000);
#endif
for (unsigned i = 0; i < 4; i++) {
addressOfConstant[i] = (byte)(newDisp & 0xff);
newDisp >>= 8;
}
}
break;
}
}