HLLib: bypass strict-aliasing rules using union
Suppress the strict-aliasing warning by accessing the FourCC array via a union.
This commit is contained in:
parent
d2fdc13491
commit
57e6a9b5bb
|
@ -443,7 +443,9 @@ hlBool CVBSPFile::GetItemAttributeInternal(const CDirectoryItem *pItem, HLPackag
|
|||
}
|
||||
case HL_VBSP_ITEM_FOUR_CC:
|
||||
{
|
||||
hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], *(hlUInt *)this->pHeader->lpLumps[uiID].lpFourCC, hlTrue);
|
||||
union { const hlChar *c; const hlUInt *u; } fourCC;
|
||||
fourCC.c = this->pHeader->lpLumps[uiID].lpFourCC;
|
||||
hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], *fourCC.u, hlTrue);
|
||||
return hlTrue;
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue