mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
Fixed signed/unsigned mismatch in comparisons
No more 'comparison of integers of different signs' warnings reported by GCC/Clang
This commit is contained in:
parent
e0540c6b37
commit
9ed2da176e
12 changed files with 22 additions and 22 deletions
|
@ -302,9 +302,9 @@ static void PrepareSectorData()
|
|||
static void PrepareTransparentDoors(sector_t * sector)
|
||||
{
|
||||
bool solidwall=false;
|
||||
int notextures=0;
|
||||
int nobtextures=0;
|
||||
int selfref=0;
|
||||
unsigned int notextures=0;
|
||||
unsigned int nobtextures=0;
|
||||
unsigned int selfref=0;
|
||||
sector_t * nextsec=NULL;
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
|
|
@ -125,7 +125,7 @@ int gl_CheckSpriteGlow(sector_t *sector, int lightlevel, const DVector3 &pos)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (c != -1)
|
||||
else if (uint32(-1) != c)
|
||||
{
|
||||
bottomglowcolor[0] = c.r / 255.f;
|
||||
bottomglowcolor[1] = c.g / 255.f;
|
||||
|
@ -171,7 +171,7 @@ bool gl_GetWallGlow(sector_t *sector, float *topglowcolor, float *bottomglowcolo
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (c != -1)
|
||||
else if (uint32(-1) != c)
|
||||
{
|
||||
topglowcolor[0] = c.r / 255.f;
|
||||
topglowcolor[1] = c.g / 255.f;
|
||||
|
@ -195,7 +195,7 @@ bool gl_GetWallGlow(sector_t *sector, float *topglowcolor, float *bottomglowcolo
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (c != -1)
|
||||
else if (uint32(-1) != c)
|
||||
{
|
||||
bottomglowcolor[0] = c.r / 255.f;
|
||||
bottomglowcolor[1] = c.g / 255.f;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "v_palette.h"
|
||||
#include "r_data/colormaps.h"
|
||||
|
||||
extern DWORD gl_fixedcolormap;
|
||||
extern int gl_fixedcolormap;
|
||||
|
||||
struct lightlist_t;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ inline bool gl_isWhite(PalEntry color)
|
|||
return color.r + color.g + color.b == 3*0xff;
|
||||
}
|
||||
|
||||
extern DWORD gl_fixedcolormap;
|
||||
extern int gl_fixedcolormap;
|
||||
|
||||
inline bool gl_isFullbright(PalEntry color, int lightlevel)
|
||||
{
|
||||
|
|
|
@ -323,7 +323,7 @@ void FGLRenderer::UpdateCameraExposure()
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
// Find the average value:
|
||||
for (int i = 0; i + 1 < mBuffers->ExposureLevels.Size(); i++)
|
||||
for (unsigned int i = 0; i + 1 < mBuffers->ExposureLevels.Size(); i++)
|
||||
{
|
||||
const auto &level = mBuffers->ExposureLevels[i];
|
||||
const auto &next = mBuffers->ExposureLevels[i + 1];
|
||||
|
|
|
@ -448,7 +448,7 @@ void FGLRenderBuffers::CreateExposureLevels(int width, int height)
|
|||
|
||||
void FGLRenderBuffers::CreateEyeBuffers(int eye)
|
||||
{
|
||||
if (mEyeFBs.Size() > eye)
|
||||
if (mEyeFBs.Size() > unsigned(eye))
|
||||
return;
|
||||
|
||||
GLint activeTex, textureBinding, frameBufferBinding;
|
||||
|
@ -457,7 +457,7 @@ void FGLRenderBuffers::CreateEyeBuffers(int eye)
|
|||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &textureBinding);
|
||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &frameBufferBinding);
|
||||
|
||||
while (mEyeFBs.Size() <= eye)
|
||||
while (mEyeFBs.Size() <= unsigned(eye))
|
||||
{
|
||||
GLuint texture = Create2DTexture("EyeTexture", GL_RGBA16F, mWidth, mHeight);
|
||||
mEyeTextures.Push(texture);
|
||||
|
|
|
@ -88,7 +88,7 @@ extern int viewpitch;
|
|||
extern bool NoInterpolateView;
|
||||
extern bool r_showviewer;
|
||||
|
||||
DWORD gl_fixedcolormap;
|
||||
int gl_fixedcolormap;
|
||||
area_t in_area;
|
||||
TArray<BYTE> currentmapsection;
|
||||
int camtexcount;
|
||||
|
|
|
@ -1245,7 +1245,7 @@ void GLWall::ClipFFloors(seg_t * seg, F3DFloor * ffloor, sector_t * frontsector,
|
|||
{
|
||||
TArray<F3DFloor *> & frontffloors = frontsector->e->XFloor.ffloors;
|
||||
|
||||
int flags = ffloor->flags & (FF_SWIMMABLE | FF_TRANSLUCENT);
|
||||
const unsigned int flags = ffloor->flags & (FF_SWIMMABLE | FF_TRANSLUCENT);
|
||||
|
||||
for (unsigned int i = 0; i < frontffloors.Size(); i++)
|
||||
{
|
||||
|
|
|
@ -143,7 +143,7 @@ void FGLDebug::SetupBreakpointMode()
|
|||
|
||||
void FGLDebug::UpdateLoggingLevel()
|
||||
{
|
||||
int level = gl_debug_level;
|
||||
const GLenum level = gl_debug_level;
|
||||
if (level != mCurrentLevel)
|
||||
{
|
||||
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_HIGH, 0, nullptr, level > 0);
|
||||
|
|
|
@ -285,7 +285,7 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla
|
|||
if (translation <= 0) translation = -translation;
|
||||
else
|
||||
{
|
||||
alphatrans = (gl.legacyMode && translation == TRANSLATION(TRANSLATION_Standard, 8));
|
||||
alphatrans = (gl.legacyMode && DWORD(translation) == TRANSLATION(TRANSLATION_Standard, 8));
|
||||
translation = GLTranslationPalette::GetInternalTranslation(translation);
|
||||
}
|
||||
|
||||
|
|
|
@ -3088,7 +3088,7 @@ line_t** linebuffer;
|
|||
static void P_GroupLines (bool buildmap)
|
||||
{
|
||||
cycle_t times[16];
|
||||
int* linesDoneInEachSector;
|
||||
unsigned int* linesDoneInEachSector;
|
||||
int i;
|
||||
int total;
|
||||
line_t* li;
|
||||
|
@ -3156,7 +3156,7 @@ static void P_GroupLines (bool buildmap)
|
|||
times[3].Clock();
|
||||
linebuffer = new line_t *[total];
|
||||
line_t **lineb_p = linebuffer;
|
||||
linesDoneInEachSector = new int[numsectors];
|
||||
linesDoneInEachSector = new unsigned int[numsectors];
|
||||
memset (linesDoneInEachSector, 0, sizeof(int)*numsectors);
|
||||
|
||||
for (sector = sectors, i = 0; i < numsectors; i++, sector++)
|
||||
|
|
|
@ -1695,7 +1695,7 @@ public:
|
|||
sec->ceilingplane.set(n.X, n.Y, n.Z, cp[3]);
|
||||
}
|
||||
|
||||
if (lightcolor == -1 && fadecolor == -1 && desaturation == -1 && fogdensity == -1)
|
||||
if (lightcolor == uint32(-1) && fadecolor == uint32(-1) && desaturation == -1 && fogdensity == -1)
|
||||
{
|
||||
// [RH] Sectors default to white light with the default fade.
|
||||
// If they are outside (have a sky ceiling), they use the outside fog.
|
||||
|
@ -1714,8 +1714,8 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
if (lightcolor == -1) lightcolor = PalEntry(255,255,255);
|
||||
if (fadecolor == -1)
|
||||
if (uint32(-1) == lightcolor) lightcolor = PalEntry(255,255,255);
|
||||
if (uint32(-1) == fadecolor)
|
||||
{
|
||||
if (level.outsidefog != 0xff000000 && (sec->GetTexture(sector_t::ceiling) == skyflatnum || (sec->special & 0xff) == Sector_Outside))
|
||||
fadecolor = level.outsidefog;
|
||||
|
|
Loading…
Reference in a new issue