less trivial stuff

- fix one bound-checking line
- rewrite two lines in astub.c to potentially not overflow an int16
- make tiletovox[] an array of int16's

git-svn-id: https://svn.eduke32.com/eduke32@2266 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-01-19 21:57:46 +00:00
parent 2e1e2345af
commit cd89fce9aa
4 changed files with 5 additions and 5 deletions

View file

@ -387,7 +387,7 @@ extern int32_t dommxoverlay, novoxmips;
extern float debug1, debug2;
extern int32_t tiletovox[MAXTILES];
extern int16_t tiletovox[MAXTILES];
extern int32_t usevoxels, voxscale[MAXVOXELS];
#ifdef USE_OPENGL

View file

@ -77,7 +77,7 @@ static void drawpixel_safe(void *s, char a)
}
//void loadvoxel(int32_t voxindex) { UNREFERENCED_PARAMATER(voxindex); }
int32_t tiletovox[MAXTILES];
int16_t tiletovox[MAXTILES];
int32_t usevoxels = 1;
//#define kloadvoxel loadvoxel

View file

@ -5723,8 +5723,8 @@ static void Keys3d(void)
while (!tilesizx[AIMED_SELOVR_PICNUM] || !tilesizy[AIMED_SELOVR_PICNUM] || j)
{
AIMED_SELOVR_PICNUM += i+MAXTILES;
AIMED_SELOVR_PICNUM %= MAXTILES;
i += AIMED_SELOVR_PICNUM + MAXTILES;
AIMED_SELOVR_PICNUM = i % MAXTILES;
j = 0;
}

View file

@ -309,7 +309,7 @@ static inline int32_t G_GetTeamPalette(int32_t team)
{
int8_t pal[] = { 3, 10, 11, 12 };
if (team > (int32_t)(sizeof(pal)/sizeof(pal[0])) || team < 0)
if ((unsigned)team >= (sizeof(pal)/sizeof(pal[0])))
return 0;
return pal[team];