mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- Be clear about the safe 'memset/memcpy' operations on virtual classes.
Since I remember that 'memset/memcpy' is safe in this code, it should be okay to cast to the generic pointer all the 'virtual class' arguments before calling the above functions. Shuts up Clang warnings.
This commit is contained in:
parent
4eb6f74e36
commit
8cab8f180b
3 changed files with 3 additions and 3 deletions
|
@ -2945,7 +2945,7 @@ void FinishDehPatch ()
|
|||
PClass *subclass = RUNTIME_CLASS(ADehackedPickup)->CreateDerivedClass
|
||||
(typeNameBuilder, sizeof(ADehackedPickup));
|
||||
AActor *defaults2 = GetDefaultByType (subclass);
|
||||
memcpy (defaults2, defaults1, sizeof(AActor));
|
||||
memcpy ((void *)defaults2, (void *)defaults1, sizeof(AActor));
|
||||
|
||||
// Make a copy of the replaced class's state labels
|
||||
FStateDefinitions statedef;
|
||||
|
|
|
@ -452,7 +452,7 @@ void FDecalLib::ParseDecal (FScanner &sc)
|
|||
decalNum = GetDecalID (sc);
|
||||
sc.MustGetStringName ("{");
|
||||
|
||||
memset (&newdecal, 0, sizeof(newdecal));
|
||||
memset ((void *)&newdecal, 0, sizeof(newdecal));
|
||||
newdecal.PicNum.SetInvalid();
|
||||
newdecal.ScaleX = newdecal.ScaleY = FRACUNIT;
|
||||
newdecal.RenderFlags = RF_WALLSPRITE;
|
||||
|
|
|
@ -433,7 +433,7 @@ DEFINE_PROPERTY(skip_super, 0, Actor)
|
|||
return;
|
||||
}
|
||||
|
||||
memcpy (defaults, GetDefault<AActor>(), sizeof(AActor));
|
||||
memcpy ((void *)defaults, (void *)GetDefault<AActor>(), sizeof(AActor));
|
||||
if (bag.DropItemList != NULL)
|
||||
{
|
||||
FreeDropItemChain (bag.DropItemList);
|
||||
|
|
Loading…
Reference in a new issue