Skip to content

Commit

Permalink
Fixed the failing build on mingw
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit c48929d
Author: Kayne Ruse <[email protected]>
Date:   Fri Aug 9 23:12:49 2024 +1000

    Update c-cpp.yml

    I'm only going a little bit nuts.

commit 3f65882
Author: Kayne Ruse <[email protected]>
Date:   Fri Aug 9 22:49:18 2024 +1000

    Update c-cpp.yml

    It would be great if this was documented better.

commit d3abeda
Author: Kayne Ruse <[email protected]>
Date:   Fri Aug 9 21:40:39 2024 +1000

    Bumped license date

commit 17bbce9
Author: Kayne Ruse <[email protected]>
Date:   Fri Aug 9 21:33:57 2024 +1000

    Fixed the failing build on mingw

    There seems to be persistent issues with different compilers
    displaying the values of size_t, so I simply cast it to an integer.

commit 843a76d
Author: Kayne Ruse <[email protected]>
Date:   Fri Aug 9 21:17:17 2024 +1000

    Updated CI

commit 08cd89c
Author: Kayne Ruse <[email protected]>
Date:   Fri Aug 9 21:09:03 2024 +1000

    Why did that fail last time?
  • Loading branch information
Ratstail91 committed Aug 9, 2024
1 parent 2ce9a0c commit ea584d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ name: Comprehensive Tests

on:
push:
branches: [ "main", "dev" ]
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
test-valgrind:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install valgrind
run: sudo apt install valgrind
- name: make test (valgrind)
Expand All @@ -21,14 +22,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: make test (sanitized)
run: make test-sanitized

test-mingw32:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: make test (mingw32)
run: make test
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# License

Copyright (c) 2020-2023 Kayne Ruse, KR Game Studios
Copyright (c) 2020-2024 Kayne Ruse, KR Game Studios

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Expand Down
2 changes: 1 addition & 1 deletion source/toy_literal.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ static void printToBuffer(const char* str) {
globalPrintBuffer = TOY_GROW_ARRAY(char, globalPrintBuffer, oldCapacity, globalPrintCapacity);
}

size_t total = snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str ? str : "");
size_t total = snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str ? str : "\0");
globalPrintCount += total;
}

Expand Down
2 changes: 1 addition & 1 deletion source/toy_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void* Toy_private_defaultMemoryAllocator(void* pointer, size_t oldSize, size_t n
void* mem = realloc(pointer, newSize);

if (mem == NULL) {
fprintf(stderr, TOY_CC_ERROR "[internal] Memory allocation error (requested %zu, replacing %zu)\n" TOY_CC_RESET, newSize, oldSize);
fprintf(stderr, TOY_CC_ERROR "[internal] Memory allocation error (requested %d, replacing %d)\n" TOY_CC_RESET, (int)newSize, (int)oldSize);
return NULL;
}

Expand Down

0 comments on commit ea584d8

Please sign in to comment.