Core/Misc: Partial revert of 2292025 (Core/Misc: Replaced some macro definitions with inline functions)

- That code is 4.3.4 and wasn't supposed to be pushed to master
This commit is contained in:
Spp
2013-01-02 15:20:38 +01:00
parent 601fcc5612
commit 8968dbc5a9

View File

@@ -187,13 +187,12 @@ bool IS_GROUP_GUID(uint64 guid)
uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h) uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h)
{ {
return uint64(uint64(l) | (uint64(e) << 32) | (uint64(h) << (h == HIGHGUID_CORPSE) ? 48 : 52)); return uint64(uint64(l) | (uint64(e) << 24) | (uint64(h) << 48));
} }
uint32 GUID_HIPART(uint64 guid) uint32 GUID_HIPART(uint64 guid)
{ {
uint32 t = ((uint64(guid) >> 48) & 0x0000FFFF); return (uint32)((uint64(guid) >> 48) & 0x0000FFFF);
return (t == HIGHGUID_CORPSE) ? t : ((t >> 4) & 0x00000FFF);
} }
uint32 GUID_ENPART(uint64 x) uint32 GUID_ENPART(uint64 x)
@@ -205,8 +204,9 @@ uint32 GUID_ENPART(uint64 x)
uint32 GUID_LOPART(uint64 x) uint32 GUID_LOPART(uint64 x)
{ {
// _GUID_LOPART_3 and _GUID_LOPART_2 were both equal to PAIR64_LOPART return IsGuidHaveEnPart(x)
return PAIR64_LOPART(x); ? ((uint32)(x & UI64LIT(0x00000000FFFFFFFF)))
: ((uint32)(x & UI64LIT(0x0000000000FFFFFF)));
} }
bool IsGuidHaveEnPart(uint64 guid) bool IsGuidHaveEnPart(uint64 guid)