diff --git a/src/d_net.cpp b/src/d_net.cpp index bf56895f6..b984799f6 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2048,7 +2048,7 @@ void FDynamicBuffer::SetData (const BYTE *data, int len) m_BufferLen = (len + 255) & ~255; m_Data = (BYTE *)M_Realloc (m_Data, m_BufferLen); } - if (data) + if (data != NULL) { m_Len = len; memcpy (m_Data, data, len); @@ -2056,7 +2056,6 @@ void FDynamicBuffer::SetData (const BYTE *data, int len) else { m_Len = 0; - M_Free((void *)data); } } diff --git a/src/decallib.cpp b/src/decallib.cpp index 79c961099..4da7ba92c 100644 --- a/src/decallib.cpp +++ b/src/decallib.cpp @@ -762,6 +762,7 @@ void FDecalLib::ParseSlider (FScanner &sc) } else if (sc.Compare ("DistX")) { + sc.MustGetFloat (); // must remain to avoid breaking definitions that accidentally used DistX Printf ("DistX in slider decal %s is unsupported\n", sliderName.GetChars()); } else if (sc.Compare ("DistY")) diff --git a/src/info.cpp b/src/info.cpp index 1da057fe2..e26ac3b8e 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -577,17 +577,17 @@ CCMD (summonfoe) TMap GlobalDamageDefinitions; -void DamageTypeDefinition::Apply(FName const &type) +void DamageTypeDefinition::Apply(FName type) { GlobalDamageDefinitions[type] = *this; } -DamageTypeDefinition *DamageTypeDefinition::Get(FName const &type) +DamageTypeDefinition *DamageTypeDefinition::Get(FName type) { return GlobalDamageDefinitions.CheckKey(type); } -bool DamageTypeDefinition::IgnoreArmor(FName const &type) +bool DamageTypeDefinition::IgnoreArmor(FName type) { DamageTypeDefinition *dtd = Get(type); if (dtd) return dtd->NoArmor; @@ -609,7 +609,7 @@ bool DamageTypeDefinition::IgnoreArmor(FName const &type) // //========================================================================== -int DamageTypeDefinition::ApplyMobjDamageFactor(int damage, FName const &type, DmgFactors const * const factors) +int DamageTypeDefinition::ApplyMobjDamageFactor(int damage, FName type, DmgFactors const * const factors) { if (factors) { diff --git a/src/info.h b/src/info.h index 0a6326c9a..19f03670d 100644 --- a/src/info.h +++ b/src/info.h @@ -225,9 +225,9 @@ public: NoArmor = false; } - static DamageTypeDefinition *Get(FName const &type); - static bool IgnoreArmor(FName const &type); - static int ApplyMobjDamageFactor(int damage, FName const &type, DmgFactors const * const factors); + static DamageTypeDefinition *Get(FName type); + static bool IgnoreArmor(FName type); + static int ApplyMobjDamageFactor(int damage, FName type, DmgFactors const * const factors); }; diff --git a/src/tarray.h b/src/tarray.h index 790692e45..d32a688df 100644 --- a/src/tarray.h +++ b/src/tarray.h @@ -416,10 +416,10 @@ typedef unsigned int hash_t; template struct THashTraits { // Returns the hash value for a key. - hash_t Hash(const KT &key) { return (hash_t)(intptr_t)key; } + hash_t Hash(const KT key) { return (hash_t)(intptr_t)key; } // Compares two keys, returning zero if they are the same. - int Compare(const KT &left, const KT &right) { return left != right; } + int Compare(const KT left, const KT right) { return left != right; } }; template struct TValueTraits @@ -547,12 +547,12 @@ public: // //======================================================================= - VT &operator[] (const KT &key) + VT &operator[] (const KT key) { return GetNode(key)->Pair.Value; } - const VT &operator[] (const KT &key) const + const VT &operator[] (const KT key) const { return GetNode(key)->Pair.Value; } @@ -566,13 +566,13 @@ public: // //======================================================================= - VT *CheckKey (const KT &key) + VT *CheckKey (const KT key) { Node *n = FindKey(key); return n != NULL ? &n->Pair.Value : NULL; } - const VT *CheckKey (const KT &key) const + const VT *CheckKey (const KT key) const { const Node *n = FindKey(key); return n != NULL ? &n->Pair.Value : NULL; @@ -591,7 +591,7 @@ public: // //======================================================================= - VT &Insert(const KT &key, const VT &value) + VT &Insert(const KT key, const VT &value) { Node *n = FindKey(key); if (n != NULL) @@ -614,7 +614,7 @@ public: // //======================================================================= - void Remove(const KT &key) + void Remove(const KT key) { DelKey(key); } @@ -649,13 +649,13 @@ protected: hash_t Size; /* must be a power of 2 */ hash_t NumUsed; - const Node *MainPosition(const KT &k) const + const Node *MainPosition(const KT k) const { HashTraits Traits; return &Nodes[Traits.Hash(k) & (Size - 1)]; } - Node *MainPosition(const KT &k) + Node *MainPosition(const KT k) { HashTraits Traits; return &Nodes[Traits.Hash(k) & (Size - 1)]; @@ -736,7 +736,7 @@ protected: ** ** The Value field is left unconstructed. */ - Node *NewKey(const KT &key) + Node *NewKey(const KT key) { Node *mp = MainPosition(key); if (!mp->IsNil()) @@ -775,7 +775,7 @@ protected: return mp; } - void DelKey(const KT &key) + void DelKey(const KT key) { Node *mp = MainPosition(key), **mpp; HashTraits Traits; @@ -814,7 +814,7 @@ protected: } } - Node *FindKey(const KT &key) + Node *FindKey(const KT key) { HashTraits Traits; Node *n = MainPosition(key); @@ -825,7 +825,7 @@ protected: return n == NULL || n->IsNil() ? NULL : n; } - const Node *FindKey(const KT &key) const + const Node *FindKey(const KT key) const { HashTraits Traits; const Node *n = MainPosition(key); @@ -836,7 +836,7 @@ protected: return n == NULL || n->IsNil() ? NULL : n; } - Node *GetNode(const KT &key) + Node *GetNode(const KT key) { Node *n = FindKey(key); if (n != NULL)