diff --git a/Makefile b/Makefile index 7364f5af..58b2ff96 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ ifeq ($(WINDOWS), 1) LIBS += -lkernel32 endif -CXXFLAGS += `sdl2-config --cflags` `pkg-config freetype2 --cflags` -MMD -MP -MF $@.d +CXXFLAGS += -std=c++03 `sdl2-config --cflags` `pkg-config freetype2 --cflags` -MMD -MP -MF $@.d LIBS += `sdl2-config --static-libs` `pkg-config freetype2 --libs` ifeq ($(STATIC), 1) diff --git a/src/Draw.cpp b/src/Draw.cpp index 5df2c57a..0bb33158 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -602,5 +602,5 @@ void EndTextObject() { //Destroy font UnloadFont(gFont); - gFont = nullptr; + gFont = NULL; } diff --git a/src/Input.cpp b/src/Input.cpp index d4d3ede3..ab861da6 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -1,5 +1,6 @@ #include "Input.h" +#include #include #include @@ -21,7 +22,7 @@ void ReleaseDirectInput() { SDL_QuitSubSystem(SDL_INIT_JOYSTICK); SDL_JoystickClose(joystick); - joystick = nullptr; + joystick = NULL; } } diff --git a/src/Main.cpp b/src/Main.cpp index 8e994364..7cab660a 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -445,7 +445,7 @@ bool SystemTask() //Handle window events bool focusGained = true; - while (SDL_PollEvent(nullptr) || !focusGained) + while (SDL_PollEvent(NULL) || !focusGained) { SDL_Event event; SDL_WaitEvent(&event); diff --git a/src/Organya.cpp b/src/Organya.cpp index 71be9854..b959a5b4 100644 --- a/src/Organya.cpp +++ b/src/Organya.cpp @@ -1,5 +1,6 @@ #include "Organya.h" +#include #include #include @@ -470,14 +471,14 @@ void LoadOrganya(const char *name) for (int j = 0; j < 16; j++) { //The first note from is NULL if (info.tdata[j].note_num == 0) { - info.tdata[j].note_list = nullptr; + info.tdata[j].note_list = NULL; continue; } //Make note list np = info.tdata[j].note_p; info.tdata[j].note_list = info.tdata[j].note_p; - np->from = nullptr; + np->from = NULL; np->to = (np + 1); np++; @@ -489,7 +490,7 @@ void LoadOrganya(const char *name) //The last note to is NULL np--; - np->to = nullptr; + np->to = NULL; //Set note properties np = info.tdata[j].note_p; //X position @@ -585,7 +586,7 @@ void SetOrganyaFadeout() } //Org timer -SDL_Thread *OrganyaTimer = nullptr; +SDL_Thread *OrganyaTimer = NULL; bool bEndTimer = false; int OrganyaPlayTimer(void *ptr) @@ -631,7 +632,7 @@ void OrganyaEndTimer() { bEndTimer = true; //Tell thread to end SDL_WaitThread(OrganyaTimer, NULL); //Wait for thread to end - OrganyaTimer = nullptr; + OrganyaTimer = NULL; } //Start and end organya diff --git a/src/Sound.cpp b/src/Sound.cpp index 79c7a432..001ad8ac 100644 --- a/src/Sound.cpp +++ b/src/Sound.cpp @@ -62,7 +62,7 @@ SOUNDBUFFER::~SOUNDBUFFER() delete[] data; //Remove from buffer list - for (SOUNDBUFFER **soundBuffer = &soundBuffers; *soundBuffer != nullptr; soundBuffer = &(*soundBuffer)->next) + for (SOUNDBUFFER **soundBuffer = &soundBuffers; *soundBuffer != NULL; soundBuffer = &(*soundBuffer)->next) { if (*soundBuffer == this) { @@ -85,10 +85,10 @@ void SOUNDBUFFER::Lock(uint8_t **outBuffer, size_t *outSize) { SDL_LockAudioDevice(audioDevice); - if (outBuffer != nullptr) + if (outBuffer != NULL) *outBuffer = data; - if (outSize != nullptr) + if (outSize != NULL) *outSize = size; } @@ -114,7 +114,7 @@ void SOUNDBUFFER::SetFrequency(uint32_t dwFrequency) float MillibelToVolume(int32_t lVolume) { //Volume is in hundredths of decibels, from 0 to -10000 - lVolume = clamp(lVolume, (decltype(lVolume))-10000, (decltype(lVolume))0); + lVolume = clamp(lVolume, (int32_t)-10000, (int32_t)0); return pow(10.0, lVolume / 2000.0); } @@ -209,7 +209,7 @@ void AudioCallback(void *userdata, uint8_t *stream, int len) } //Mix sounds to primary buffer - for (SOUNDBUFFER *sound = soundBuffers; sound != nullptr; sound = sound->next) + for (SOUNDBUFFER *sound = soundBuffers; sound != NULL; sound = sound->next) sound->Mix(buffer, samples); }