- fixed the noisiest value truncation warnings after shortly re-enabling them in the compiler, plus a few places where the warning pointed to incorrect code.

This commit is contained in:
Christoph Oelckers 2020-09-26 11:59:24 +02:00
parent 696610fbc5
commit 3210dd5782
8 changed files with 21 additions and 19 deletions

View file

@ -6214,7 +6214,7 @@ spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType)
pXThing->data2 = 0; pXThing->data2 = 0;
pXThing->data3 = 0; pXThing->data3 = 0;
pXThing->data4 = 318; pXThing->data4 = 318;
pXThing->targetX = gFrameClock+180.0; pXThing->targetX = gFrameClock+180;
pXThing->locked = 1; pXThing->locked = 1;
pXThing->state = 1; pXThing->state = 1;
pXThing->triggerOnce = 0; pXThing->triggerOnce = 0;
@ -6226,7 +6226,7 @@ spritetype * actSpawnThing(int nSector, int x, int y, int z, int nThingType)
pXThing->data2 = 0; pXThing->data2 = 0;
pXThing->data3 = 0; pXThing->data3 = 0;
pXThing->data4 = 318; pXThing->data4 = 318;
pXThing->targetX = gFrameClock+180.0; pXThing->targetX = gFrameClock+180;
pXThing->locked = 1; pXThing->locked = 1;
pXThing->state = 1; pXThing->state = 1;
pXThing->triggerOnce = 0; pXThing->triggerOnce = 0;

View file

@ -1563,8 +1563,8 @@ void dudeLeechOperate(spritetype* pSprite, XSPRITE* pXSprite, EVENT event)
int nMissileType = kMissileLifeLeechAltNormal + (pXSprite->data3 ? 1 : 0); int nMissileType = kMissileLifeLeechAltNormal + (pXSprite->data3 ? 1 : 0);
int t2; int t2;
if (!pXSprite->data3) t2 = 120 / 10.0; if (!pXSprite->data3) t2 = 120 / 10;
else t2 = (3 * 120) / 10.0; else t2 = (3 * 120) / 10;
spritetype * pMissile = actFireMissile(pSprite, 0, z1, dx, dy, dz, nMissileType); spritetype * pMissile = actFireMissile(pSprite, 0, z1, dx, dy, dz, nMissileType);
if (pMissile) if (pMissile)

View file

@ -472,10 +472,11 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
if (cl_interpolate && TestBitString(gInterpolateSprite, nSprite) && !(pTSprite->flags&512)) if (cl_interpolate && TestBitString(gInterpolateSprite, nSprite) && !(pTSprite->flags&512))
{ {
LOCATION *pPrevLoc = &gPrevSpriteLoc[nSprite]; LOCATION *pPrevLoc = &gPrevSpriteLoc[nSprite];
pTSprite->x = interpolate(pPrevLoc->x, pTSprite->x, gInterpolate); int iInterpolate = (int)gInterpolate;
pTSprite->y = interpolate(pPrevLoc->y, pTSprite->y, gInterpolate); pTSprite->x = interpolate(pPrevLoc->x, pTSprite->x, iInterpolate);
pTSprite->z = interpolate(pPrevLoc->z, pTSprite->z, gInterpolate); pTSprite->y = interpolate(pPrevLoc->y, pTSprite->y, iInterpolate);
pTSprite->ang = pPrevLoc->ang+mulscale16(((pTSprite->ang-pPrevLoc->ang+1024)&2047)-1024, gInterpolate); pTSprite->z = interpolate(pPrevLoc->z, pTSprite->z, iInterpolate);
pTSprite->ang = pPrevLoc->ang+mulscale16(((pTSprite->ang-pPrevLoc->ang+1024)&2047)-1024, iInterpolate);
} }
int nAnim = 0; int nAnim = 0;
switch (picanm[nTile].extra & 7) { switch (picanm[nTile].extra & 7) {

View file

@ -1209,7 +1209,7 @@ template bool ParseDrawTextureTags<VMVa_List>(F2DDrawer* drawer, FGameTexture *i
static void VirtualToRealCoords(F2DDrawer *drawer, double Width, double Height, double &x, double &y, double &w, double &h, static void VirtualToRealCoords(F2DDrawer *drawer, double Width, double Height, double &x, double &y, double &w, double &h,
double vwidth, double vheight, bool vbottom, bool handleaspect) double vwidth, double vheight, bool vbottom, bool handleaspect)
{ {
float myratio = handleaspect ? ActiveRatio (Width, Height) : (4.0f / 3.0f); float myratio = float(handleaspect ? ActiveRatio (Width, Height) : (4.0 / 3.0));
// if 21:9 AR, map to 16:9 for all callers. // if 21:9 AR, map to 16:9 for all callers.
// this allows for black bars and stops the stretching of fullscreen images // this allows for black bars and stops the stretching of fullscreen images

View file

@ -57,7 +57,8 @@ struct picanm_t
void Clear() void Clear()
{ {
extra = sf = num = 0; extra = sf = 0;
num = 0;
} }
}; };
picanm_t tileConvertAnimFormat(int32_t const picanmdisk, int* lo, int* to); picanm_t tileConvertAnimFormat(int32_t const picanmdisk, int* lo, int* to);
@ -451,25 +452,25 @@ extern PicAnm picanm;
inline int tileWidth(int num) inline int tileWidth(int num)
{ {
assert(num < MAXTILES); assert(num < MAXTILES);
return TileFiles.tiledata[num].texture->GetDisplayWidth(); return (int)TileFiles.tiledata[num].texture->GetDisplayWidth();
} }
inline int tileHeight(int num) inline int tileHeight(int num)
{ {
assert(num < MAXTILES); assert(num < MAXTILES);
return TileFiles.tiledata[num].texture->GetDisplayHeight(); return (int)TileFiles.tiledata[num].texture->GetDisplayHeight();
} }
inline int tileLeftOffset(int num) inline int tileLeftOffset(int num)
{ {
assert(num < MAXTILES); assert(num < MAXTILES);
return TileFiles.tiledata[num].texture->GetDisplayLeftOffset(); return (int)TileFiles.tiledata[num].texture->GetDisplayLeftOffset();
} }
inline int tileTopOffset(int num) inline int tileTopOffset(int num)
{ {
assert(num < MAXTILES); assert(num < MAXTILES);
return TileFiles.tiledata[num].texture->GetDisplayTopOffset(); return (int)TileFiles.tiledata[num].texture->GetDisplayTopOffset();
} }
inline int widthBits(int num) inline int widthBits(int num)

View file

@ -46,7 +46,7 @@ enum PRSFlags
struct PolymostRenderState struct PolymostRenderState
{ {
int vindex, vcount, primtype; int vindex, vcount, primtype;
float Shade; int Shade;
float ShadeDiv = 62.f; float ShadeDiv = 62.f;
float VisFactor = 128.f; float VisFactor = 128.f;
int Flags = 0; int Flags = 0;

View file

@ -50,9 +50,9 @@ class FileStream
kSeekEnd = SEEK_END kSeekEnd = SEEK_END
}; };
int32_t Seek(int32_t offset, SeekDirection dir = kSeekStart) { return file.Seek(offset, (FileReader::ESeek) dir); } int32_t Seek(int32_t offset, SeekDirection dir = kSeekStart) { return (int)file.Seek(offset, (FileReader::ESeek) dir); }
int32_t Skip(int32_t offset) { return Seek(offset, kSeekCurrent); } int32_t Skip(int32_t offset) { return (int)Seek(offset, kSeekCurrent); }
int32_t GetPosition() { return file.Tell(); } int32_t GetPosition() { return (int)file.Tell(); }
private: private:
FileReader file; FileReader file;

View file

@ -50,7 +50,7 @@ constexpr enable_if_t<!std::is_pointer<T>::value, size_t> SAVE_SIZEOF(T const &
} }
#define SAVE_CODE(s) (void*)(s) #define SAVE_CODE(s) (void*)(s)
#define SAVE_DATA(s) { (void*)&(s), SAVE_SIZEOF(s) } #define SAVE_DATA(s) { (void*)&(s), (int)SAVE_SIZEOF(s) }
#define NUM_SAVEABLE_ITEMS(x) countof(x) #define NUM_SAVEABLE_ITEMS(x) countof(x)