Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ jobs:
flags: '-std=gnu99 -w'
- name: GCC 2.95
compiler: g++-2.95
flags: '-fpermissive -w'
flags: '-w'
name: Build (${{ matrix.name }})
runs-on: ubuntu-24.04
steps:
Expand All @@ -408,3 +408,16 @@ jobs:
run: |
sudo mv butterscotch ~/woody
sudo chroot ~/woody /bin/sh --login -c 'make -C /butterscotch NO_COLOR=1 VERBOSE=1 CC="${{ matrix.compiler }} ${{ matrix.flags }}" DESKTOP_BACKEND=sdl1 AUDIO_BACKEND=none SDL1_LIBS='-lSDL' DISABLE_MMD=1'

build-cxx:
name: Build as C++
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libglfw3-dev

- name: Build
run: make CC='g++ -std=gnu++98 -Wall -Wvla -Werror' NO_COLOR=1 VERBOSE=1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The following backends are available for desktop platforms (Windows and POSIX sy
* SDL 3

The following compilers have been tested to successfully build butterscotch, older versions may work but are untested.
* GCC 2.7 through 2.95 in C++ mode, and 3.0 and up in C99 mode
* GCC 2.7 and up in C++ mode, and 3.0 and up in C99 mode
* Clang 1.1 and up
* TinyCC 0.9.27 and up

Expand Down
8 changes: 4 additions & 4 deletions src/audio/miniaudio/ma_audio_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,11 @@ static void maGroupLoad(AudioSystem* audio, int32_t groupIndex) {
char* buf;
if (audioGroupEntry->path == nullptr) {
int sz = snprintf(nullptr, 0, "audiogroup%d.dat", groupIndex);
buf = safeMalloc(sz + 1);
buf = (char *)safeMalloc(sz + 1);
snprintf(buf, sz + 1, "audiogroup%d.dat", groupIndex);
} else {
size_t length = strlen(audioGroupEntry->path);
buf = safeMalloc(length + 1);
buf = (char *)safeMalloc(length + 1);
memcpy(buf, audioGroupEntry->path, length);
buf[length] = '\0';
}
Expand All @@ -707,7 +707,7 @@ static void maGroupLoad(AudioSystem* audio, int32_t groupIndex) {
if (!fileSystem->vtable->fileExists(fileSystem, buf)) {
fprintf(stderr, "Audio: Wanted to load Audio Group %d, but Audio Group %d does not exist in the file system!\n", groupIndex, groupIndex);
free(buf);
DataWin* dw = safeCalloc(1, sizeof(DataWin));
DataWin* dw = (DataWin *)safeCalloc(1, sizeof(DataWin));
arrput(audio->audioGroups, dw);
return;
}
Expand Down Expand Up @@ -800,7 +800,7 @@ static AudioSystemVtable maAudioSystemVtable;
// ===[ Lifecycle ]===

MaAudioSystem* MaAudioSystem_create(DataWin* dataWin) {
MaAudioSystem* ma = safeCalloc(1, sizeof(MaAudioSystem));
MaAudioSystem* ma = (MaAudioSystem *)safeCalloc(1, sizeof(MaAudioSystem));
ma->base.dw = dataWin;
maAudioSystemVtable.init = maInit;
maAudioSystemVtable.destroy = maDestroy;
Expand Down
4 changes: 2 additions & 2 deletions src/audio/openal/al_audio_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ static int32_t maPlaySound(AudioSystem* audio, int32_t soundIndex, int32_t prior
slot->streamSampleRate = (int) info.sample_rate;
slot->streamFormat = (info.channels == 2) ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16;
slot->streamLengthSeconds = stb_vorbis_stream_length_in_seconds(v);
slot->decodeScratch = safeMalloc(AL_STREAM_BUFFER_SAMPLES * info.channels * sizeof(int16_t));
slot->decodeScratch = (int16_t *)safeMalloc(AL_STREAM_BUFFER_SAMPLES * info.channels * sizeof(int16_t));

alGenSources(1, &slot->alSource);
alGenBuffers(AL_STREAM_BUFFER_COUNT, slot->streamBuffers);
Expand Down Expand Up @@ -895,7 +895,7 @@ static AudioSystemVtable AlAudioSystemVtable;
// ===[ Lifecycle ]===

AlAudioSystem* AlAudioSystem_create(void) {
AlAudioSystem* ma = safeCalloc(1, sizeof(AlAudioSystem));
AlAudioSystem* ma = (AlAudioSystem *)safeCalloc(1, sizeof(AlAudioSystem));
AlAudioSystemVtable.init = maInit;
AlAudioSystemVtable.destroy = maDestroy;
AlAudioSystemVtable.update = maUpdate;
Expand Down
4 changes: 2 additions & 2 deletions src/audio/openal/wave.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ WAVFile WAV_ParseFileData(uint8_t const* data) {
data_ptr += 4;

// memcpy so we don't byteswap the original data more than once
file.data = safeMalloc(file.header.data_size);
file.data = (uint8_t *)safeMalloc(file.header.data_size);
memcpy(file.data, data_ptr, file.header.data_size);
file.data_length = file.header.data_size;

Expand All @@ -89,4 +89,4 @@ WAVFile WAV_ParseFileData(uint8_t const* data) {
}

return file;
}
}
2 changes: 1 addition & 1 deletion src/binary_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void BinaryReader_readBytes(BinaryReader* reader, void* dest, size_t count) {
}

uint8_t* BinaryReader_readBytesAt(BinaryReader* reader, size_t offset, size_t count) {
uint8_t* buf = safeMalloc(count);
uint8_t* buf = (uint8_t *)safeMalloc(count);

if (reader->buffer != nullptr) {
if (offset < reader->bufferBase || offset + count > reader->bufferBase + reader->bufferSize) {
Expand Down
Loading
Loading