Skip to content

Commit

Permalink
- fixed some GCC warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Jun 1, 2022
1 parent 077aa6b commit da30b6f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 28 deletions.
26 changes: 19 additions & 7 deletions bin/windows/zmusic/include/zmusic.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ typedef struct SoundStreamInfo_
typedef enum SampleType_
{
SampleType_UInt8,
SampleType_Int16
SampleType_Int16,
SampleType_Float32
} SampleType;

typedef enum ChannelConfig_
Expand All @@ -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,
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -419,4 +431,4 @@ typedef const ZMusicMidiOutDevice *(*pfn_ZMusic_GetMidiDevices)(int *pAmount);



#endif
#endif
2 changes: 1 addition & 1 deletion src/common/engine/i_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions src/gamedata/d_dehacked.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/playsim/d_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class FPlayerClass
{
public:
FPlayerClass ();
FPlayerClass (const FPlayerClass &other);
FPlayerClass (const FPlayerClass &other) = default;
~FPlayerClass ();

bool CheckSkin (int skin);
Expand Down
7 changes: 0 additions & 7 deletions src/playsim/p_user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,6 @@ FPlayerClass::FPlayerClass ()
Flags = 0;
}

FPlayerClass::FPlayerClass (const FPlayerClass &other)
{
Type = other.Type;
Flags = other.Flags;
Skins = other.Skins;
}

FPlayerClass::~FPlayerClass ()
{
}
Expand Down

0 comments on commit da30b6f

Please sign in to comment.