- reverted a few of Zzombo's changes.

This commit is contained in:
Christoph Oelckers 2015-02-07 17:02:46 +01:00
parent 4e2763e5fa
commit 7789975b6c
5 changed files with 24 additions and 24 deletions

View file

@ -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);
}
}

View file

@ -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"))

View file

@ -577,17 +577,17 @@ CCMD (summonfoe)
TMap<FName, DamageTypeDefinition> 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)
{

View file

@ -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);
};

View file

@ -416,10 +416,10 @@ typedef unsigned int hash_t;
template<class KT> 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<class VT> 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)