1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-24 17:26:41 +00:00

Enable msvc signed/unsigned mismatch warnings and fix remaining cases

This commit is contained in:
fgenesis 2021-01-11 19:27:54 +01:00
parent 812848e382
commit 25696c4436
4 changed files with 8 additions and 18 deletions

View file

@ -66,7 +66,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma warning(disable:4005)
#pragma warning(disable:4305)
#pragma warning(disable:4018) // signed/unsigned mismatch
//#pragma warning(disable:4018) // signed/unsigned mismatch
#pragma warning(disable:4244) // conversion from types with possible loss of data
#pragma warning(disable:4800) // forcing value to bool 'true' or 'false (performance warning)
@ -77,7 +77,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma warning(disable:4127) // conditional expression is constant
#pragma warning(disable:4706) // assignment within conditional expression
#pragma warning(disable:4389) // signed/unsigned mismatch
//#pragma warning(disable:4389) // signed/unsigned mismatch
#pragma warning(disable:4189) // UqqqqSEFUL: local variable is initialized but not referenced
#endif

View file

@ -198,22 +198,13 @@ void ParticleManager::endParticle(Particle *p)
p->reset();
}
void ParticleManager::nextFree(int jump)
void ParticleManager::nextFree(size_t jump)
{
free+=jump;
if (free >= size)
free -= size;
}
void ParticleManager::prevFree(int jump)
{
if(free < jump) {
free = free + size - jump;
} else {
free -= jump;
}
}
void ParticleManager::setFree(size_t free)
{
if (free != ~0UL)
@ -222,8 +213,8 @@ void ParticleManager::setFree(size_t free)
}
}
const int spread = 8;
const int spreadCheck = 128;
static const size_t spread = 8;
static const size_t spreadCheck = 128;
// travel the list until you find an empty or give up
Particle *ParticleManager::stomp()

View file

@ -237,8 +237,7 @@ protected:
size_t numActive;
Particle* stomp();
void nextFree(int f=1);
void prevFree(int f=1);
void nextFree(size_t f=1);
size_t oldFree;

View file

@ -449,7 +449,7 @@ ImageTGA *Texture::TGAloadMem(void *mem, int size)
ByteBuffer bb(mem, size, ByteBuffer::REUSE);
ImageTGA *pImageData = NULL; // This stores our important image data
WORD width = 0, height = 0; // The dimensions of the image
uint16_t width = 0, height = 0; // The dimensions of the image
byte length = 0; // The length in bytes to the pixels
byte imageType = 0; // The image type (RLE, RGB, Alpha...)
byte bits = 0; // The bits per pixel for the image (16, 24, 32)
@ -604,7 +604,7 @@ ImageTGA *Texture::TGAloadMem(void *mem, int size)
byte *pColors = new byte [channels];
// Load in all the pixel data
while(i < width*height)
while(i < size_t(width)*height)
{
// Read in the current color count + 1
bb >> rleID;