- fixed some GCC warnings

This commit is contained in:
Christoph Oelckers 2022-05-19 09:43:10 +02:00
parent 748ab46e1c
commit 97dd6f5e9b
5 changed files with 22 additions and 28 deletions

View file

@ -67,7 +67,8 @@ typedef struct SoundStreamInfo_
typedef enum SampleType_
{
SampleType_UInt8,
SampleType_Int16
SampleType_Int16,
SampleType_Float32
} SampleType;
typedef enum ChannelConfig_
@ -76,6 +77,15 @@ typedef enum ChannelConfig_
ChannelConfig_Stereo
} ChannelConfig;
typedef struct SoundStreamInfoEx_
{
int mBufferSize; // If mBufferSize is 0, the song doesn't use streaming but plays through a different interface.
int mSampleRate;
SampleType mSampleType;
ChannelConfig mChannelConfig;
} SoundStreamInfoEx;
typedef enum EIntConfigKey_
{
zmusic_adl_chips_count,
@ -264,14 +274,14 @@ typedef struct ZMusicConfigurationSetting_
#ifndef ZMUSIC_INTERNAL
#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(ZMUSIC_STATIC)
#define DLL_IMPORT _declspec(dllimport)
#else // !_MSC_VER
#else
#define DLL_IMPORT
#endif // _MSC_VER
#endif
// Note that the internal 'class' definitions are not C compatible!
typedef struct { int zm1; } *ZMusic_MidiSource;
typedef struct { int zm2; } *ZMusic_MusicStream;
typedef struct _ZMusic_MidiSource_Struct { int zm1; } *ZMusic_MidiSource;
typedef struct _ZMusic_MusicStream_Struct { int zm2; } *ZMusic_MusicStream;
struct SoundDecoder;
#endif
@ -319,6 +329,7 @@ extern "C"
DLL_IMPORT void ZMusic_VolumeChanged(ZMusic_MusicStream song);
DLL_IMPORT zmusic_bool ZMusic_WriteSMF(ZMusic_MidiSource source, const char* fn, int looplimit);
DLL_IMPORT void ZMusic_GetStreamInfo(ZMusic_MusicStream song, SoundStreamInfo *info);
DLL_IMPORT void ZMusic_GetStreamInfoEx(ZMusic_MusicStream song, SoundStreamInfoEx *info);
// Configuration interface. The return value specifies if a music restart is needed.
// RealValue should be written back to the CVAR or whatever other method the client uses to store configuration state.
DLL_IMPORT zmusic_bool ChangeMusicSettingInt(EIntConfigKey key, ZMusic_MusicStream song, int value, int* pRealValue);
@ -406,6 +417,7 @@ typedef zmusic_bool (*pfn_ZMusic_IsMIDI)(ZMusic_MusicStream song);
typedef void (*pfn_ZMusic_VolumeChanged)(ZMusic_MusicStream song);
typedef zmusic_bool (*pfn_ZMusic_WriteSMF)(ZMusic_MidiSource source, const char* fn, int looplimit);
typedef void (*pfn_ZMusic_GetStreamInfo)(ZMusic_MusicStream song, SoundStreamInfo *info);
typedef void (*pfn_ZMusic_GetStreamInfoEx)(ZMusic_MusicStream song, SoundStreamInfoEx *info);
typedef zmusic_bool (*pfn_ChangeMusicSettingInt)(EIntConfigKey key, ZMusic_MusicStream song, int value, int* pRealValue);
typedef zmusic_bool (*pfn_ChangeMusicSettingFloat)(EFloatConfigKey key, ZMusic_MusicStream song, float value, float* pRealValue);
typedef zmusic_bool (*pfn_ChangeMusicSettingString)(EStringConfigKey key, ZMusic_MusicStream song, const char* value);
@ -419,4 +431,4 @@ typedef const ZMusicMidiOutDevice *(*pfn_ZMusic_GetMidiDevices)(int *pAmount);
#endif
#endif

View file

@ -1040,7 +1040,7 @@ void I_NetMessage(const char* text, ...)
va_list argptr;
va_start(argptr, text);
str.VFormat(format, argptr);
str.VFormat(text, argptr);
va_end(argptr);
fprintf(stderr, "\r%-40s\n", str.GetChars());
#endif

View file

@ -1227,25 +1227,14 @@ static int PatchThing (int thingy)
}
else if (linelen == 16 && stricmp(Line1, "infighting group") == 0)
{
if (val < 0)
{
Printf("Infighting groups must be >= 0 (check your dehacked)\n");
val = 0;
}
type->ActorInfo()->infighting_group = val;
}
else if (linelen == 16 && stricmp(Line1, "projectile group") == 0)
{
if (val < 0) val = -1;
type->ActorInfo()->projectile_group = val;
}
else if (linelen == 12 && stricmp(Line1, "splash group") == 0)
{
if (val < 0)
{
Printf("Splash groups must be >= 0 (check your dehacked)\n");
val = 0;
}
type->ActorInfo()->splash_group = val;
}
else if (linelen == 10 && stricmp(Line1, "fast speed") == 0)
@ -1289,7 +1278,7 @@ static int PatchThing (int thingy)
0xffff8000, // 8 - Orange
};
if (val < 0 || val > 8) val = 0;
if (val > 8) val = 0;
unsigned color = bloodcolor[val];
info->BloodColor = color;
info->BloodTranslation = val == 0? 0 : TRANSLATION(TRANSLATION_Blood, CreateBloodTranslation(color));

View file

@ -161,7 +161,7 @@ class FPlayerClass
{
public:
FPlayerClass ();
FPlayerClass (const FPlayerClass &other);
FPlayerClass (const FPlayerClass &other) = default;
~FPlayerClass ();
bool CheckSkin (int skin);

View file

@ -159,13 +159,6 @@ FPlayerClass::FPlayerClass ()
Flags = 0;
}
FPlayerClass::FPlayerClass (const FPlayerClass &other)
{
Type = other.Type;
Flags = other.Flags;
Skins = other.Skins;
}
FPlayerClass::~FPlayerClass ()
{
}