This commit is contained in:
Christoph Oelckers 2016-02-05 23:16:06 +01:00
commit 1201ad0366
6 changed files with 18 additions and 16 deletions

View file

@ -35,6 +35,8 @@
#ifndef AUTOSEGS_H #ifndef AUTOSEGS_H
#define AUTOSEGS_H #define AUTOSEGS_H
#include "doomtype.h"
#define REGMARKER(x) (x) #define REGMARKER(x) (x)
typedef void * const REGINFO; typedef void * const REGINFO;
typedef void * NCREGINFO; typedef void * NCREGINFO;
@ -73,11 +75,11 @@ class FAutoSegIterator
} }
Probe = Head; Probe = Head;
} }
NCREGINFO operator*() const NCREGINFO operator*() const NO_SANITIZE
{ {
return *Probe; return *Probe;
} }
FAutoSegIterator &operator++() FAutoSegIterator &operator++() NO_SANITIZE
{ {
do do
{ {

View file

@ -1986,7 +1986,7 @@ END_POINTERS
// //
//========================================================================== //==========================================================================
static int STACK_ARGS cregcmp (const void *a, const void *b) static int STACK_ARGS cregcmp (const void *a, const void *b) NO_SANITIZE
{ {
const PClass *class1 = *(const PClass **)a; const PClass *class1 = *(const PClass **)a;
const PClass *class2 = *(const PClass **)b; const PClass *class2 = *(const PClass **)b;

View file

@ -113,6 +113,16 @@ typedef TMap<int, PClassActor *> FClassMap;
#define NOVTABLE #define NOVTABLE
#endif #endif
#if defined(__clang__)
#if defined(__has_feature) && __has_feature(address_sanitizer))
#define NO_SANITIZE __attribute__((no_sanitize("address")))
#else
#define NO_SANITIZE
#endif
#else
#define NO_SANITIZE
#endif
#include "basictypes.h" #include "basictypes.h"
// Bounding box coordinate storage. // Bounding box coordinate storage.

View file

@ -182,7 +182,7 @@ void FName::NameManager::InitBuckets ()
// Register built-in names. 'None' must be name 0. // Register built-in names. 'None' must be name 0.
for (size_t i = 0; i < countof(PredefinedNames); ++i) for (size_t i = 0; i < countof(PredefinedNames); ++i)
{ {
assert((NULL == FindName(PredefinedNames[i], true)) && "Predefined name already inserted"); assert((0 == FindName(PredefinedNames[i], true)) && "Predefined name already inserted");
FindName (PredefinedNames[i], false); FindName (PredefinedNames[i], false);
} }
} }

View file

@ -3777,7 +3777,7 @@ int P_ExecuteSpecial(int num,
int arg4, int arg4,
int arg5) int arg5)
{ {
if (num >= 0 && num < countof(LineSpecials)) if (num >= 0 && num < (int)countof(LineSpecials))
{ {
return LineSpecials[num](line, activator, backSide, arg1, arg2, arg3, arg4, arg5); return LineSpecials[num](line, activator, backSide, arg1, arg2, arg3, arg4, arg5);
} }

View file

@ -2763,11 +2763,6 @@ int OWallMost (short *mostbuf, fixed_t z, const FWallCoords *wallc)
} }
#endif #endif
#endif #endif
if (mostbuf[ix1] < 0) mostbuf[ix1] = 0;
else if (mostbuf[ix1] > viewheight) mostbuf[ix1] = (short)viewheight;
if (mostbuf[ix2-1] < 0) mostbuf[ix2-1] = 0;
else if (mostbuf[ix2-1] > viewheight) mostbuf[ix2-1] = (short)viewheight;
return bad; return bad;
} }
@ -2921,11 +2916,6 @@ int WallMost (short *mostbuf, const secplane_t &plane, const FWallCoords *wallc)
qinterpolatedown16short (&mostbuf[ix1], ix2-ix1, y + centeryfrac,yinc); qinterpolatedown16short (&mostbuf[ix1], ix2-ix1, y + centeryfrac,yinc);
} }
if (mostbuf[ix1] < 0) mostbuf[ix1] = 0;
else if (mostbuf[ix1] > viewheight) mostbuf[ix1] = (short)viewheight;
if (mostbuf[ix2-1] < 0) mostbuf[ix2-1] = 0;
else if (mostbuf[ix2-1] > viewheight) mostbuf[ix2-1] = (short)viewheight;
return bad; return bad;
} }