Silenced lots of warnings pointed out by XCode.

This commit is contained in:
Christoph Oelckers 2020-07-23 16:35:54 +02:00
parent d16d8f0d0e
commit be9094cb97
26 changed files with 89 additions and 180 deletions

View file

@ -1337,33 +1337,6 @@ RESTART:
return 0; return 0;
} }
// Returns:
// 0: all OK
// -1: ID declaration was invalid:
static int32_t S_DefineMusic(const char *ID, const char *name)
{
int32_t sel = MUS_FIRST_SPECIAL;
Bassert(ID != NULL);
if (!Bstrcmp(ID,"intro"))
{
sel = MUS_INTRO;
}
else if (!Bstrcmp(ID,"loading"))
{
sel = MUS_LOADING;
}
else
{
sel = levelGetMusicIdx(ID);
if (sel < 0)
return -1;
}
quoteMgr.InitializeQuote(sel, name);
return 0;
}
static int parsedefinitions_game(scriptfile *, int); static int parsedefinitions_game(scriptfile *, int);

View file

@ -432,7 +432,7 @@ void CDemo::LoadDemoInfo(void)
#if B_BIG_ENDIAN == 1 #if B_BIG_ENDIAN == 1
atf.signature = B_LITTLE32(atf.signature); atf.signature = B_LITTLE32(atf.signature);
atf.nVersion = B_LITTLE16(atf.nVersion); atf.nVersion = B_LITTLE16(atf.nVersion);
#endif, "." #endif
if ((atf.signature == 0x1a4d4544 /* '\x1aMED' */&& atf.nVersion == BloodVersion) if ((atf.signature == 0x1a4d4544 /* '\x1aMED' */&& atf.nVersion == BloodVersion)
|| (atf.signature == 0x1a4d4445 /* '\x1aMDE' */ && atf.nVersion == BYTEVERSION)) || (atf.signature == 0x1a4d4445 /* '\x1aMDE' */ && atf.nVersion == BYTEVERSION))
{ {

View file

@ -416,7 +416,7 @@ void nnExtInitModernStuff(bool bSaveLoad) {
//ThrowError("\nPlayer Control (SPRITE #%d):\n There is no player #%d", pSprite->index, pXSprite->data1); //ThrowError("\nPlayer Control (SPRITE #%d):\n There is no player #%d", pSprite->index, pXSprite->data1);
if (pXSprite->rxID && pXSprite->rxID != kChannelLevelStart) if (pXSprite->rxID && pXSprite->rxID != kChannelLevelStart)
ThrowError("\nPlayer Control (SPRITE #%d) with Link command should have no RX ID!", pSprite->index, pXSprite->data1); ThrowError("\nPlayer Control (SPRITE #%d) with Link command should have no RX ID!", pSprite->index);
if (pXSprite->txID && pXSprite->txID < kChannelUser) if (pXSprite->txID && pXSprite->txID < kChannelUser)
ThrowError("\nPlayer Control (SPRITE #%d):\nTX ID should be in range of %d and %d!", pSprite->index, kChannelUser, kChannelMax); ThrowError("\nPlayer Control (SPRITE #%d):\nTX ID should be in range of %d and %d!", pSprite->index, kChannelUser, kChannelMax);
@ -2506,7 +2506,7 @@ void condError(XSPRITE* pXCond, const char* pzFormat, ...) {
va_list args; va_list args;
va_start(args, pzFormat); va_start(args, pzFormat);
vsprintf(buffer2, pzFormat, args); vsprintf(buffer2, pzFormat, args);
ThrowError(Bstrcat(buffer, buffer2)); ThrowError("%s%s", buffer, buffer2);
} }

View file

@ -403,48 +403,6 @@ int32_t wallfront(int32_t l1, int32_t l2)
return -2; return -2;
} }
//
// spritewallfront (internal)
//
static inline int32_t spritewallfront(tspritetype const * const s, int32_t w)
{
auto const wal = (uwallptr_t)&wall[w];
auto const wal2 = (uwallptr_t)&wall[wal->point2];
const vec2_t v = { wal->x, wal->y };
return dmulscale32(wal2->x - v.x, s->y - v.y, -(s->x - v.x), wal2->y - v.y) >= 0;
}
//
// bunchfront (internal)
//
static inline int32_t bunchfront(int32_t b1, int32_t b2)
{
int b1f = bunchfirst[b1];
int const x1b1 = xb1[b1f];
int const x2b2 = xb2[bunchlast[b2]] + 1;
if (x1b1 >= x2b2)
return -1;
int b2f = bunchfirst[b2];
int const x1b2 = xb1[b2f];
int const x2b1 = xb2[bunchlast[b1]] + 1;
if (x1b2 >= x2b1)
return -1;
if (x1b1 >= x1b2)
{
for (; xb2[b2f] < x1b1; b2f = bunchp2[b2f]) { }
return wallfront(b1f, b2f);
}
for (; xb2[b1f] < x1b2; b1f = bunchp2[b1f]) { }
return wallfront(b1f, b2f);
}
// //
// animateoffs (internal) // animateoffs (internal)
// //

View file

@ -382,7 +382,7 @@ int32_t scriptfile_getsymbolvalue(char const *name, int32_t *val)
sscanf(name + 2, "%" PRIx64 "", &x); sscanf(name + 2, "%" PRIx64 "", &x);
if (EDUKE32_PREDICT_FALSE(x > UINT32_MAX)) if (EDUKE32_PREDICT_FALSE(x > UINT32_MAX))
Printf("warning: number 0x%x" PRIx64 " truncated to 32 bits.\n", x); Printf("warning: number 0x%" PRIx64 " truncated to 32 bits.\n", x);
*val = x; *val = x;
return 1; return 1;

View file

@ -181,7 +181,7 @@ class OpenALSoundStream : public SoundStream
ALuint Source; ALuint Source;
std::atomic<bool> Playing; std::atomic<bool> Playing;
bool Looping; //bool Looping;
ALfloat Volume; ALfloat Volume;
bool SetupSource() bool SetupSource()
@ -227,7 +227,7 @@ class OpenALSoundStream : public SoundStream
public: public:
OpenALSoundStream(OpenALSoundRenderer *renderer) OpenALSoundStream(OpenALSoundRenderer *renderer)
: Renderer(renderer), Source(0), Playing(false), Looping(false), Volume(1.0f) : Renderer(renderer), Source(0), Playing(false), Volume(1.0f)
{ {
memset(Buffers, 0, sizeof(Buffers)); memset(Buffers, 0, sizeof(Buffers));
Renderer->AddStream(this); Renderer->AddStream(this);

View file

@ -70,8 +70,8 @@ public:
int GetNamespace() const override { return Namespace; } int GetNamespace() const override { return Namespace; }
int GetFileOffset() { return Position; } int GetFileOffset() override { return Position; }
FileReader *GetReader() FileReader *GetReader() override
{ {
if(!Compressed) if(!Compressed)
{ {
@ -80,7 +80,7 @@ public:
} }
return NULL; return NULL;
} }
int FillCache() int FillCache() override
{ {
if(!Compressed) if(!Compressed)
{ {

View file

@ -46,7 +46,7 @@ public:
// FFont interface // FFont interface
FGameTexture *GetChar(int code, int translation, int *const width, bool *redirected = nullptr) const override; FGameTexture *GetChar(int code, int translation, int *const width, bool *redirected = nullptr) const override;
int GetCharWidth (int code) const; int GetCharWidth (int code) const override;
protected: protected:
FTextureID PicNum; FTextureID PicNum;

View file

@ -56,13 +56,13 @@ protected:
public: public:
FVoxelModel(FVoxel *voxel, bool owned); FVoxelModel(FVoxel *voxel, bool owned);
~FVoxelModel(); ~FVoxelModel();
bool Load(const char * fn, int lumpnum, const char * buffer, int length); bool Load(const char * fn, int lumpnum, const char * buffer, int length) override;
void Initialize(); void Initialize();
virtual int FindFrame(const char * name); virtual int FindFrame(const char * name) override;
virtual void RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int frame, int frame2, double inter, int translation=0); virtual void RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int frame, int frame2, double inter, int translation=0) override;
virtual void AddSkins(uint8_t *hitlist); virtual void AddSkins(uint8_t *hitlist) override;
FTextureID GetPaletteTexture() const { return mPalette; } FTextureID GetPaletteTexture() const { return mPalette; }
void BuildVertexBuffer(FModelRenderer *renderer); void BuildVertexBuffer(FModelRenderer *renderer) override;
float getAspectFactor(float vscale) override; float getAspectFactor(float vscale) override;
}; };

View file

@ -58,7 +58,7 @@ public:
void Swap(); void Swap();
bool IsHWGammaActive() const { return HWGammaActive; } bool IsHWGammaActive() const { return HWGammaActive; }
void SetVSync(bool vsync); void SetVSync(bool vsync) override;
void Draw2D() override; void Draw2D() override;
void PostProcessScene(bool swscene, int fixedcm, float flash, const std::function<void()> &afterBloomDrawEndScene2D) override; void PostProcessScene(bool swscene, int fixedcm, float flash, const std::function<void()> &afterBloomDrawEndScene2D) override;

View file

@ -269,10 +269,10 @@ public:
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override; void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override; bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
virtual void SetValue(void *addr, int val); virtual void SetValue(void *addr, int val) override;
virtual void SetValue(void *addr, double val); virtual void SetValue(void *addr, double val) override;
virtual int GetValueInt(void *addr) const; virtual int GetValueInt(void *addr) const override;
virtual double GetValueFloat(void *addr) const; virtual double GetValueFloat(void *addr) const override;
virtual bool isNumeric() override { return IntCompatible; } virtual bool isNumeric() override { return IntCompatible; }
bool Unsigned; bool Unsigned;
@ -299,10 +299,10 @@ public:
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override; void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override; bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
virtual void SetValue(void *addr, int val); virtual void SetValue(void *addr, int val) override;
virtual void SetValue(void *addr, double val); virtual void SetValue(void *addr, double val) override;
virtual int GetValueInt(void *addr) const; virtual int GetValueInt(void *addr) const override;
virtual double GetValueFloat(void *addr) const; virtual double GetValueFloat(void *addr) const override;
virtual bool isNumeric() override { return true; } virtual bool isNumeric() override { return true; }
protected: protected:
void SetOps(); void SetOps();
@ -410,8 +410,8 @@ public:
reader = r; reader = r;
} }
virtual bool IsMatch(intptr_t id1, intptr_t id2) const; bool IsMatch(intptr_t id1, intptr_t id2) const override;
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const; void GetTypeIDs(intptr_t &id1, intptr_t &id2) const override;
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override; void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override; bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
@ -454,8 +454,8 @@ public:
bool ReadValue(FSerializer &ar, const char *key, void *addr) const override; bool ReadValue(FSerializer &ar, const char *key, void *addr) const override;
void SetPointer(void *base, unsigned offset, TArray<size_t> *special = NULL) override; void SetPointer(void *base, unsigned offset, TArray<size_t> *special = NULL) override;
virtual bool IsMatch(intptr_t id1, intptr_t id2) const; bool IsMatch(intptr_t id1, intptr_t id2) const override;
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const; void GetTypeIDs(intptr_t &id1, intptr_t &id2) const override;
}; };
// Compound types ----------------------------------------------------------- // Compound types -----------------------------------------------------------
@ -478,8 +478,8 @@ public:
unsigned int ElementCount; unsigned int ElementCount;
unsigned int ElementSize; unsigned int ElementSize;
virtual bool IsMatch(intptr_t id1, intptr_t id2) const; bool IsMatch(intptr_t id1, intptr_t id2) const override;
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const; void GetTypeIDs(intptr_t &id1, intptr_t &id2) const override;
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override; void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override; bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
@ -506,8 +506,8 @@ public:
PType *ElementType; PType *ElementType;
PStruct *BackingType; PStruct *BackingType;
virtual bool IsMatch(intptr_t id1, intptr_t id2) const; bool IsMatch(intptr_t id1, intptr_t id2) const override;
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const; void GetTypeIDs(intptr_t &id1, intptr_t &id2) const override;
void WriteValue(FSerializer &ar, const char *key, const void *addr) const override; void WriteValue(FSerializer &ar, const char *key, const void *addr) const override;
bool ReadValue(FSerializer &ar, const char *key, void *addr) const override; bool ReadValue(FSerializer &ar, const char *key, void *addr) const override;
@ -539,8 +539,8 @@ public:
VMFunction *mConstructor = nullptr; VMFunction *mConstructor = nullptr;
VMFunction *mDestructor = nullptr; VMFunction *mDestructor = nullptr;
virtual PField *AddField(FName name, PType *type, uint32_t flags=0); PField *AddField(FName name, PType *type, uint32_t flags=0) override;
virtual PField *AddNativeField(FName name, PType *type, size_t address, uint32_t flags = 0, int bitvalue = 0); PField *AddNativeField(FName name, PType *type, size_t address, uint32_t flags = 0, int bitvalue = 0) override;
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override; void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override; bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;

View file

@ -77,7 +77,7 @@ protected:
int CopyPixels(FBitmap *bmp, int conversion) override; int CopyPixels(FBitmap *bmp, int conversion) override;
TArray<uint8_t> CreatePalettedPixels(int conversion) override; TArray<uint8_t> CreatePalettedPixels(int conversion) override;
void CopyToBlock(uint8_t *dest, int dwidth, int dheight, FImageSource *source, int xpos, int ypos, int rotate, const uint8_t *translation, int style); void CopyToBlock(uint8_t *dest, int dwidth, int dheight, FImageSource *source, int xpos, int ypos, int rotate, const uint8_t *translation, int style);
void CollectForPrecache(PrecacheInfo &info, bool requiretruecolor); void CollectForPrecache(PrecacheInfo &info, bool requiretruecolor) override;
}; };

View file

@ -302,7 +302,7 @@ CCMD(togglemouseaim)
in_mousemode = !in_mousemode; in_mousemode = !in_mousemode;
if (!silentmouseaimtoggle) if (!silentmouseaimtoggle)
{ {
Printf(PRINT_MEDIUM|PRINT_NOTIFY, in_mousemode? GStrings("TXT_MOUSEAIMON") : GStrings("TXT_MOUSEAIMOFF")); Printf(PRINT_MEDIUM|PRINT_NOTIFY, "%s\n", in_mousemode? GStrings("TXT_MOUSEAIMON") : GStrings("TXT_MOUSEAIMOFF"));
} }
} }

View file

@ -82,7 +82,6 @@ class DAnmPlayer : public DScreenJob
TArray<uint8_t> buffer; TArray<uint8_t> buffer;
int numframes = 0; int numframes = 0;
int curframe = 1; int curframe = 1;
int lastframe = -1;
int frametime = 0; int frametime = 0;
int ototalclock = 0; int ototalclock = 0;
AnimTextures animtex; AnimTextures animtex;
@ -241,7 +240,6 @@ class ScreenJobRunner
int index = -1; int index = -1;
float screenfade; float screenfade;
bool clearbefore; bool clearbefore;
bool skipped = false;
uint64_t startTime = -1; uint64_t startTime = -1;
uint64_t lastTime = -1; uint64_t lastTime = -1;
int actionState; int actionState;

View file

@ -159,6 +159,7 @@ public:
}; };
DBaseStatusBar (); DBaseStatusBar ();
virtual ~DBaseStatusBar() = default;
void SetSize(int reltop = 32, int hres = 320, int vres = 200, int hhres = -1, int hvres = -1); void SetSize(int reltop = 32, int hres = 320, int vres = 200, int hhres = -1, int hvres = -1);
void ShowPlayerName (); void ShowPlayerName ();

View file

@ -166,6 +166,7 @@ int ReadFrame(FileReader &fp, uint8_t *palette)
} }
} }
#if 0
static void ServeSample(const char** ptr, uint32_t* length) static void ServeSample(const char** ptr, uint32_t* length)
{ {
//mutex_lock(&mutex); //mutex_lock(&mutex);
@ -183,6 +184,7 @@ static void ServeSample(const char** ptr, uint32_t* length)
//mutex_unlock(&mutex); //mutex_unlock(&mutex);
} }
#endif
void PlayMovie(const char* fileName) void PlayMovie(const char* fileName)
{ {
@ -276,4 +278,5 @@ void PlayMovie(const char* fileName)
inputState.keyGetChar(); inputState.keyGetChar();
} }
} }
END_PS_NS END_PS_NS

View file

@ -695,14 +695,14 @@ public:
for (int i = 0; i < playerswhenstarted; i++) for (int i = 0; i < playerswhenstarted; i++)
{ {
mysnprintf(tempbuf, 32, "%-4ld", i + 1); mysnprintf(tempbuf, 32, "%-4d", i + 1);
MiniText(92 + (i * 23), 80, tempbuf, 0, -1, 3); MiniText(92 + (i * 23), 80, tempbuf, 0, -1, 3);
} }
for (int i = 0; i < playerswhenstarted; i++) for (int i = 0; i < playerswhenstarted; i++)
{ {
int xfragtotal = 0; int xfragtotal = 0;
mysnprintf(tempbuf, 32, "%ld", i + 1); mysnprintf(tempbuf, 32, "%d", i + 1);
MiniText(30, 90 + t, tempbuf, 0); MiniText(30, 90 + t, tempbuf, 0);
MiniText(38, 90 + t, ud.user_name[i], 0, -1, ps[i].palookup); MiniText(38, 90 + t, ud.user_name[i], 0, -1, ps[i].palookup);
@ -712,13 +712,13 @@ public:
int frag = frags[i][y]; int frag = frags[i][y];
if (i == y) if (i == y)
{ {
mysnprintf(tempbuf, 32, "%-4ld", ps[y].fraggedself); mysnprintf(tempbuf, 32, "%-4d", ps[y].fraggedself);
MiniText(92 + (y * 23), 90 + t, tempbuf, 0, -1, 2); MiniText(92 + (y * 23), 90 + t, tempbuf, 0, -1, 2);
xfragtotal -= ps[y].fraggedself; xfragtotal -= ps[y].fraggedself;
} }
else else
{ {
mysnprintf(tempbuf, 32, "%-4ld", frag); mysnprintf(tempbuf, 32, "%-4d", frag);
MiniText(92 + (y * 23), 90 + t, tempbuf, 0); MiniText(92 + (y * 23), 90 + t, tempbuf, 0);
xfragtotal += frag; xfragtotal += frag;
} }
@ -731,7 +731,7 @@ public:
*/ */
} }
mysnprintf(tempbuf, 32, "%-4ld", xfragtotal); mysnprintf(tempbuf, 32, "%-4d", xfragtotal);
MiniText(101 + (8 * 23), 90 + t, tempbuf, 0, -1, 2); MiniText(101 + (8 * 23), 90 + t, tempbuf, 0, -1, 2);
t += 7; t += 7;
@ -747,7 +747,7 @@ public:
int frag = frags[i][y]; int frag = frags[i][y];
yfragtotal += frag; yfragtotal += frag;
} }
mysnprintf(tempbuf, 32, "%-4ld", yfragtotal); mysnprintf(tempbuf, 32, "%-4d", yfragtotal);
MiniText(92 + (y * 23), 96 + (8 * 7), tempbuf, 0, -1, 2); MiniText(92 + (y * 23), 96 + (8 * 7), tempbuf, 0, -1, 2);
} }
@ -784,7 +784,7 @@ public:
void FormatTime(int time, char* tempbuf) void FormatTime(int time, char* tempbuf)
{ {
mysnprintf(tempbuf, 32, "%02ld:%02ld", (time / (26 * 60)) % 60, (time / 26) % 60); mysnprintf(tempbuf, 32, "%02d:%02d", (time / (26 * 60)) % 60, (time / 26) % 60);
} }
void PrintTime(int totalclock) void PrintTime(int totalclock)
@ -838,18 +838,18 @@ public:
bonuscnt++; bonuscnt++;
S_PlaySound(PIPEBOMB_EXPLODE, CHAN_AUTO, CHANF_UI); S_PlaySound(PIPEBOMB_EXPLODE, CHAN_AUTO, CHANF_UI);
} }
mysnprintf(tempbuf, 32, "%-3ld", ps[myconnectindex].actors_killed); mysnprintf(tempbuf, 32, "%-3d", ps[myconnectindex].actors_killed);
GameText((320 >> 2) + 70, 93 + 9, tempbuf, 0); GameText((320 >> 2) + 70, 93 + 9, tempbuf, 0);
if (ud.player_skill > 3) if (ud.player_skill > 3)
{ {
mysnprintf(tempbuf, 32, GStrings("TXT_N_A")); mysnprintf(tempbuf, 32, "%s", GStrings("TXT_N_A"));
GameText((320 >> 2) + 70, 99 + 4 + 9, tempbuf, 0); GameText((320 >> 2) + 70, 99 + 4 + 9, tempbuf, 0);
} }
else else
{ {
if ((ps[myconnectindex].max_actors_killed - ps[myconnectindex].actors_killed) < 0) if ((ps[myconnectindex].max_actors_killed - ps[myconnectindex].actors_killed) < 0)
mysnprintf(tempbuf, 32, "%-3ld", 0); mysnprintf(tempbuf, 32, "%-3d", 0);
else mysnprintf(tempbuf, 32, "%-3ld", ps[myconnectindex].max_actors_killed - ps[myconnectindex].actors_killed); else mysnprintf(tempbuf, 32, "%-3d", ps[myconnectindex].max_actors_killed - ps[myconnectindex].actors_killed);
GameText((320 >> 2) + 70, 99 + 4 + 9, tempbuf, 0); GameText((320 >> 2) + 70, 99 + 4 + 9, tempbuf, 0);
} }
} }

View file

@ -285,14 +285,14 @@ public:
for (int i = 0; i < playerswhenstarted; i++) for (int i = 0; i < playerswhenstarted; i++)
{ {
mysnprintf(tempbuf, 32, "%-4ld", i + 1); mysnprintf(tempbuf, 32, "%-4d", i + 1);
MiniText(92 + (i * 23), 80, tempbuf, 0); MiniText(92 + (i * 23), 80, tempbuf, 0);
} }
for (int i = 0; i < playerswhenstarted; i++) for (int i = 0; i < playerswhenstarted; i++)
{ {
int xfragtotal = 0; int xfragtotal = 0;
mysnprintf(tempbuf, 32, "%ld", i + 1); mysnprintf(tempbuf, 32, "%d", i + 1);
MiniText(30, 90 + t, tempbuf, 0); MiniText(30, 90 + t, tempbuf, 0);
MiniText(38, 90 + t, ud.user_name[i], 0, -1, ps[i].palookup); MiniText(38, 90 + t, ud.user_name[i], 0, -1, ps[i].palookup);
@ -302,13 +302,13 @@ public:
int frag = frags[i][y]; int frag = frags[i][y];
if (i == y) if (i == y)
{ {
mysnprintf(tempbuf, 32, "%-4ld", ps[y].fraggedself); mysnprintf(tempbuf, 32, "%-4d", ps[y].fraggedself);
MiniText(92 + (y * 23), 90 + t, tempbuf, 0); MiniText(92 + (y * 23), 90 + t, tempbuf, 0);
xfragtotal -= ps[y].fraggedself; xfragtotal -= ps[y].fraggedself;
} }
else else
{ {
mysnprintf(tempbuf, 32, "%-4ld", frag); mysnprintf(tempbuf, 32, "%-4d", frag);
MiniText(92 + (y * 23), 90 + t, tempbuf, 0); MiniText(92 + (y * 23), 90 + t, tempbuf, 0);
xfragtotal += frag; xfragtotal += frag;
} }
@ -321,7 +321,7 @@ public:
*/ */
} }
mysnprintf(tempbuf, 32, "%-4ld", xfragtotal); mysnprintf(tempbuf, 32, "%-4d", xfragtotal);
MiniText(101 + (8 * 23), 90 + t, tempbuf, 0); MiniText(101 + (8 * 23), 90 + t, tempbuf, 0);
t += 7; t += 7;
@ -337,7 +337,7 @@ public:
int frag = frags[i][y]; int frag = frags[i][y];
yfragtotal += frag; yfragtotal += frag;
} }
mysnprintf(tempbuf, 32, "%-4ld", yfragtotal); mysnprintf(tempbuf, 32, "%-4d", yfragtotal);
MiniText(92 + (y * 23), 96 + (8 * 7), tempbuf, 0); MiniText(92 + (y * 23), 96 + (8 * 7), tempbuf, 0);
} }
@ -380,7 +380,7 @@ public:
void FormatTime(int time, char* tempbuf) void FormatTime(int time, char* tempbuf)
{ {
mysnprintf(tempbuf, 32, "%02ld:%02ld", (time / (26 * 60)) % 60, (time / 26) % 60); mysnprintf(tempbuf, 32, "%02d:%02d", (time / (26 * 60)) % 60, (time / 26) % 60);
} }
void PrintTime(int totalclock) void PrintTime(int totalclock)
@ -430,18 +430,18 @@ public:
bonuscnt++; bonuscnt++;
S_PlaySound(442, CHAN_AUTO, CHANF_UI); S_PlaySound(442, CHAN_AUTO, CHANF_UI);
} }
mysnprintf(tempbuf, 32, "%-3ld", ps[myconnectindex].actors_killed); mysnprintf(tempbuf, 32, "%-3d", ps[myconnectindex].actors_killed);
BigText(231, 112, tempbuf, -1); BigText(231, 112, tempbuf, -1);
if (ud.player_skill > 3) if (ud.player_skill > 3)
{ {
mysnprintf(tempbuf, 32, GStrings("TXT_N_A")); mysnprintf(tempbuf, 32, "%s", GStrings("TXT_N_A"));
BigText(231, 128, tempbuf, -1); BigText(231, 128, tempbuf, -1);
} }
else else
{ {
if ((ps[myconnectindex].max_actors_killed - ps[myconnectindex].actors_killed) < 0) if ((ps[myconnectindex].max_actors_killed - ps[myconnectindex].actors_killed) < 0)
mysnprintf(tempbuf, 32, "%-3ld", 0); mysnprintf(tempbuf, 32, "%-3d", 0);
else mysnprintf(tempbuf, 32, "%-3ld", ps[myconnectindex].max_actors_killed - ps[myconnectindex].actors_killed); else mysnprintf(tempbuf, 32, "%-3d", ps[myconnectindex].max_actors_killed - ps[myconnectindex].actors_killed);
BigText(231, 128, tempbuf, -1); BigText(231, 128, tempbuf, -1);
} }
} }

View file

@ -2781,7 +2781,7 @@ void handle_se14(int i, bool checkstat, int RPG, int JIBS6)
if (s->owner == -1) if (s->owner == -1)
{ {
I_Error("Could not find any locators for SE# 6 and 14 with a hitag of %ld.", t[3]); I_Error("Could not find any locators for SE# 6 and 14 with a hitag of %d.", t[3]);
} }
int j = ldist(&sprite[s->owner], s); int j = ldist(&sprite[s->owner], s);

View file

@ -257,11 +257,11 @@ void ConCompiler::ReportError(int error)
fn, line_number, parsebuf); fn, line_number, parsebuf);
break; break;
case ERROR_CLOSEBRACKET: case ERROR_CLOSEBRACKET:
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found more '}' than '{' before '%s'.\n", Printf(TEXTCOLOR_RED " * ERROR! (%s, line %d) Found more '}' than '{' before '%s'.\n",
fn, line_number, parsebuf); fn, line_number, parsebuf);
break; break;
case ERROR_NOENDSWITCH: case ERROR_NOENDSWITCH:
Printf(TEXTCOLOR_RED " * ERROR!%s(%s, line %d) Did not find endswitch before '%s'.\n", Printf(TEXTCOLOR_RED " * ERROR! (%s, line %d) Did not find endswitch before '%s'.\n",
fn, line_number, parsebuf); fn, line_number, parsebuf);
break; break;
@ -815,15 +815,15 @@ int ConCompiler::parsecommand()
if (strlen(parselabel) > (MAXVARLABEL - 1)) if (strlen(parselabel) > (MAXVARLABEL - 1))
{ {
warningcount++; warningcount++;
Printf(TEXTCOLOR_RED " * WARNING.(%s, line %d) Variable Name '%s' too int (max is %d)\n", fn, line_number, parselabel, MAXVARLABEL - 1); Printf(TEXTCOLOR_RED " * WARNING.(%s, line %d) Variable Name '%s' too int (max is %d)\n", fn, line_number, parselabel.GetChars(), MAXVARLABEL - 1);
return 0; return 0;
} }
int res = AddGameVar(parselabel, j, lnum & (~(GAMEVAR_FLAG_DEFAULT | GAMEVAR_FLAG_SECRET))); int res = AddGameVar(parselabel, j, lnum & (~(GAMEVAR_FLAG_DEFAULT | GAMEVAR_FLAG_SECRET)));
if (res < 0) if (res < 0)
{ {
errorcount++; errorcount++;
if (res == -1) Printf(TEXTCOLOR_RED " * ERROR.(%s, line %d) Duplicate game variable definition '%s'.\n", fn, line_number, parselabel); if (res == -1) Printf(TEXTCOLOR_RED " * ERROR.(%s, line %d) Duplicate game variable definition '%s'.\n", fn, line_number, parselabel.GetChars());
else if (res == -2) Printf(TEXTCOLOR_RED " * ERROR.(%s, line %d) '%s' maximum number of game variables exceeded.\n", fn, line_number, parselabel); else if (res == -2) Printf(TEXTCOLOR_RED " * ERROR.(%s, line %d) '%s' maximum number of game variables exceeded.\n", fn, line_number, parselabel.GetChars());
return 0; return 0;
} }
@ -890,7 +890,7 @@ int ConCompiler::parsecommand()
if (labels[i].compare(parselabel) == 0) if (labels[i].compare(parselabel) == 0)
{ {
warningcount++; warningcount++;
Printf(TEXTCOLOR_RED " * WARNING.(%s, line %d) Duplicate move '%s' ignored.\n", fn, line_number, parselabel); Printf(TEXTCOLOR_RED " * WARNING.(%s, line %d) Duplicate move '%s' ignored.\n", fn, line_number, parselabel.GetChars());
break; break;
} }
if (i == labels.Size()) if (i == labels.Size())
@ -1016,7 +1016,7 @@ int ConCompiler::parsecommand()
if (lnum >= 0) if (lnum >= 0)
{ {
warningcount++; warningcount++;
Printf(TEXTCOLOR_RED " * WARNING.(%s, line %d) Duplicate ai '%s' ignored.\n", fn, line_number, parselabel); Printf(TEXTCOLOR_RED " * WARNING.(%s, line %d) Duplicate ai '%s' ignored.\n", fn, line_number, parselabel.GetChars());
} }
else appendlabeladdress(LABEL_AI); else appendlabeladdress(LABEL_AI);
@ -1056,7 +1056,7 @@ int ConCompiler::parsecommand()
if (lnum >= 0) if (lnum >= 0)
{ {
warningcount++; warningcount++;
Printf(TEXTCOLOR_RED " * WARNING.(%s, line %d) Duplicate event '%s' ignored.\n", fn, line_number, parselabel); Printf(TEXTCOLOR_RED " * WARNING.(%s, line %d) Duplicate event '%s' ignored.\n", fn, line_number, parselabel.GetChars());
} }
else appendlabeladdress(LABEL_ACTION); else appendlabeladdress(LABEL_ACTION);
@ -1628,7 +1628,7 @@ int ConCompiler::parsecommand()
k = popscriptvalue(); k = popscriptvalue();
if (k >= MAXQUOTES) if (k >= MAXQUOTES)
{ {
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Quote number exceeds limit of %d.\n", line_number, MAXQUOTES); Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Quote number exceeds limit of %d.\n", fn, line_number, MAXQUOTES);
errorcount++; errorcount++;
} }
@ -1679,14 +1679,14 @@ int ConCompiler::parsecommand()
case concmd_endevent: case concmd_endevent:
if (parsing_event == 0) if (parsing_event == 0)
{ {
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found 'endevent' without defining 'onevent'.\n", line_number); Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found 'endevent' without defining 'onevent'.\n", fn, line_number);
errorcount++; errorcount++;
} }
// else // else
{ {
if (num_squigilly_brackets > 0) if (num_squigilly_brackets > 0)
{ {
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found more '{' than '}' before 'endevent'.\n", line_number); Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found more '{' than '}' before 'endevent'.\n", fn, line_number);
errorcount++; errorcount++;
} }
parsing_event = 0; parsing_event = 0;
@ -1698,14 +1698,14 @@ int ConCompiler::parsecommand()
case concmd_enda: case concmd_enda:
if (parsing_actor == 0) if (parsing_actor == 0)
{ {
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found 'enda' without defining 'actor'.\n", line_number); Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found 'enda' without defining 'actor'.\n", fn, line_number);
errorcount++; errorcount++;
} }
// else // else
{ {
if (num_squigilly_brackets > 0) if (num_squigilly_brackets > 0)
{ {
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found more '{' than '}' before 'enda'.\n", line_number); Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found more '{' than '}' before 'enda'.\n", fn, line_number);
errorcount++; errorcount++;
} }
parsing_actor = 0; parsing_actor = 0;

View file

@ -666,7 +666,7 @@ int ParseState::parse(void)
break; break;
case concmd_debug: case concmd_debug:
insptr++; insptr++;
Printf("%ld\n",*insptr); Printf("%d\n",*insptr);
insptr++; insptr++;
break; break;
case concmd_endofgame: case concmd_endofgame:
@ -1346,7 +1346,7 @@ int ParseState::parse(void)
{ {
DPrintf(DMSG_NOTIFY, " (Global)"); DPrintf(DMSG_NOTIFY, " (Global)");
} }
DPrintf(DMSG_NOTIFY, " =%ld", GetGameVarID(*insptr, g_i, g_p)); DPrintf(DMSG_NOTIFY, " =%d", GetGameVarID(*insptr, g_i, g_p));
insptr++; insptr++;
break; break;
} }
@ -1588,8 +1588,8 @@ int ParseState::parse(void)
break; break;
default: default:
Printf(TEXTCOLOR_RED "Unrecognized PCode of %ld in parse. Killing current sprite.\n",*insptr); Printf(TEXTCOLOR_RED "Unrecognized PCode of %d in parse. Killing current sprite.\n",*insptr);
Printf(TEXTCOLOR_RED "Offset=%0lX\n",insptr-ScriptCode.Data()); Printf(TEXTCOLOR_RED "Offset=%0X\n",int(insptr-ScriptCode.Data()));
killit_flag = 1; killit_flag = 1;
break; break;
} }

View file

@ -155,7 +155,7 @@ void nonsharedkeys(void)
{ {
if (SHIFTS_IS_PRESSED) if (SHIFTS_IS_PRESSED)
{ {
Printf(PRINT_NOTIFY, *CombatMacros[taunt - 1]); Printf(PRINT_NOTIFY, "%s", **CombatMacros[taunt - 1]);
//Net_SendTaunt(taunt); //Net_SendTaunt(taunt);
return; return;
} }
@ -715,30 +715,6 @@ enum
MAXVELMOTO = 120, MAXVELMOTO = 120,
}; };
//---------------------------------------------------------------------------
//
// This one's from VoidSW, not EDuke32
//
//---------------------------------------------------------------------------
static fix16_t GetDeltaQ16Angle(fix16_t ang1, fix16_t ang2)
{
// Look at the smaller angle if > 1024 (180 degrees)
if (fix16_abs(ang1 - ang2) > fix16_from_int(1024))
{
if (ang1 <= fix16_from_int(1024))
ang1 += fix16_from_int(2048);
if (ang2 <= fix16_from_int(1024))
ang2 += fix16_from_int(2048);
}
//if (ang1 - ang2 == -fix16_from_int(1024))
// return(fix16_from_int(1024));
return ang1 - ang2;
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// handles the input bits // handles the input bits

View file

@ -552,7 +552,7 @@ bool checkhitswitch_d(int snum, int w, int switchtype)
x = headspritestat[3]; x = headspritestat[3];
while (x >= 0) while (x >= 0)
{ {
if (((sprite[x].hitag) == lotag)) if (sprite[x].hitag == lotag)
{ {
switch (sprite[x].lotag) switch (sprite[x].lotag)
{ {

View file

@ -826,7 +826,7 @@ bool checkhitswitch_r(int snum, int w, int switchtype)
x = headspritestat[3]; x = headspritestat[3];
while (x >= 0) while (x >= 0)
{ {
if (((sprite[x].hitag) == lotag)) if (sprite[x].hitag == lotag)
{ {
switch (sprite[x].lotag) switch (sprite[x].lotag)
{ {

View file

@ -533,7 +533,7 @@ void initwaterdrip(int j, int i)
auto sp = &sprite[i]; auto sp = &sprite[i];
int sect = sp->sectnum; int sect = sp->sectnum;
auto t = hittype[i].temp_data; auto t = hittype[i].temp_data;
if (j >= 0 && sprite[j].statnum == 10 || sprite[j].statnum == 1) if (j >= 0 && (sprite[j].statnum == 10 || sprite[j].statnum == 1))
{ {
sp->shade = 32; sp->shade = 32;
if (sprite[j].pal != 1) if (sprite[j].pal != 1)
@ -971,7 +971,7 @@ void spawneffector(int i)
} }
if (j == MAXSPRITES) if (j == MAXSPRITES)
{ {
I_Error("Found lonely Sector Effector (lotag 0) at (%ld,%ld)\n", sp->x, sp->y); I_Error("Found lonely Sector Effector (lotag 0) at (%d,%d)\n", sp->x, sp->y);
} }
sp->owner = j; sp->owner = j;
} }
@ -987,7 +987,7 @@ void spawneffector(int i)
tempwallptr++; tempwallptr++;
if (tempwallptr > 2047) if (tempwallptr > 2047)
{ {
I_Error("Too many moving sectors at (%ld,%ld).\n", wall[s].x, wall[s].y); I_Error("Too many moving sectors at (%d,%d).\n", wall[s].x, wall[s].y);
} }
} }
if (sp->lotag == 30 || sp->lotag == 6 || sp->lotag == 14 || sp->lotag == 5) if (sp->lotag == 30 || sp->lotag == 6 || sp->lotag == 14 || sp->lotag == 5)
@ -1018,7 +1018,7 @@ void spawneffector(int i)
if (j == 0) if (j == 0)
{ {
I_Error("Subway found no zero'd sectors with locators\nat (%ld,%ld).\n", sp->x, sp->y); I_Error("Subway found no zero'd sectors with locators\nat (%d,%d).\n", sp->x, sp->y);
} }
sp->owner = -1; sp->owner = -1;

View file

@ -702,8 +702,8 @@ int spawn_d(int j, int pn)
} }
else { // Twentieth Anniversary World Tour addition else { // Twentieth Anniversary World Tour addition
if ((sp->pal == 1 && ud.multimode > 1) // Single-game Only if ((sp->pal == 1 && ud.multimode > 1) // Single-game Only
|| (sp->pal == 2 && (ud.multimode == 1 || ud.multimode > 1 && ud.coop != 1)) // Co-op Only || (sp->pal == 2 && (ud.multimode == 1 || (ud.multimode > 1 && ud.coop != 1))) // Co-op Only
|| (sp->pal == 3 && (ud.multimode == 1 || ud.multimode > 1 && ud.coop == 1))) // Dukematch Only || (sp->pal == 3 && (ud.multimode == 1 || (ud.multimode > 1 && ud.coop == 1)))) // Dukematch Only
{ {
sp->xrepeat = sp->yrepeat = 0; sp->xrepeat = sp->yrepeat = 0;
changespritestat(i, 5); changespritestat(i, 5);