Skip to content

Commit 0000b86

Browse files
authored
Win mac fixes (Attnam#668)
* Update build-msys2-nonwizard.yml Install mingw-w64-i686-pcre * Update build-msys2-wizmode.yml Install mingw-w64-i686-pcre * Update error.cpp * Update rawbit.cpp * Update message.cpp * Update item.cpp rm sprintf * Update game.cpp rm sprintf * Update game.cpp * Update cmdcraft.cpp * Update whandler.cpp * Update game.cpp Add forgotten comma * Mac hdiutil resource busy workaround Mit komplementen: fredowski/osxbundler@67d668c * Specify release artifact filename more explicitly Various updates to 3rd party yaml versions * Bump actions/checkout to v4 * Update build-osx-wizmode.yml
1 parent 6fb35db commit 0000b86

File tree

11 files changed

+27
-16
lines changed

11 files changed

+27
-16
lines changed

.github/workflows/build-msys2-nonwizard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ jobs:
88
run:
99
shell: msys2 {0}
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
- uses: msys2/setup-msys2@v2
1313
with:
1414
msystem: MINGW32
1515
release: false
1616
update: false
17-
install: git mingw-w64-i686-gcc make mingw-w64-i686-cmake mingw-w64-i686-libpng mingw-w64-i686-SDL2 mingw-w64-i686-SDL2_mixer
17+
install: git mingw-w64-i686-gcc make mingw-w64-i686-cmake mingw-w64-i686-libpng mingw-w64-i686-SDL2 mingw-w64-i686-SDL2_mixer mingw-w64-i686-pcre
1818
- name: CI-Build
1919
run: |
2020
cd D:/a/ivan/ivan

.github/workflows/build-msys2-wizmode.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ jobs:
88
run:
99
shell: msys2 {0}
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
- uses: msys2/setup-msys2@v2
1313
with:
1414
msystem: MINGW32
1515
release: false
1616
update: false
17-
install: git mingw-w64-i686-gcc make mingw-w64-i686-cmake mingw-w64-i686-libpng mingw-w64-i686-SDL2 mingw-w64-i686-SDL2_mixer
17+
install: git mingw-w64-i686-gcc make mingw-w64-i686-cmake mingw-w64-i686-libpng mingw-w64-i686-SDL2 mingw-w64-i686-SDL2_mixer mingw-w64-i686-pcre
1818
- name: Get tag name, print
1919
shell: bash
2020
run: |
@@ -39,10 +39,10 @@ jobs:
3939

4040
# Attention: you perform the release step when you push a tag, neat huh?
4141
- name: Release
42-
uses: softprops/action-gh-release@v1
42+
uses: softprops/action-gh-release@v2
4343
if: startsWith(github.ref, 'refs/tags/')
4444
with:
45-
files: ${{ github.workspace }}\*.zip
45+
files: ${{ github.workspace }}\IVAN-${{env.RELEASE_VERSION}}-win.zip
4646
env:
4747
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4848
#GITHUB_REPOSITORY: attnam/ivan

.github/workflows/build-osx-wizmode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
key="$(grep -o "'https://[^']*'" ci/osx/requirements.sh | openssl dgst -sha256 -hex)"
4747
echo "CACHE_KEY=${key#* }" >> $GITHUB_ENV
4848
- name: Reuse cached files
49-
uses: actions/cache@v2
49+
uses: actions/cache@v4
5050
with:
5151
path: |
5252
~/Thirdparty/Frameworks

FeLib/Source/error.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void globalerrorhandler::Abort(cchar* Format, ...)
123123

124124
va_list AP;
125125
va_start(AP, Format);
126-
vsprintf(Buffer, Format, AP);
126+
vsnprintf(Buffer, sizeof(Buffer), Format, AP);
127127
va_end(AP);
128128

129129
strcat(Buffer, BugMsg);

FeLib/Source/rawbit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ void rawbitmap::Printf(bitmap* Bitmap, v2 Pos, packcol16 Color, cchar* Format, .
423423

424424
va_list AP;
425425
va_start(AP, Format);
426-
vsprintf(Buffer, Format, AP);
426+
vsnprintf(Buffer, sizeof(Buffer), Format, AP);
427427
va_end(AP);
428428

429429
fontcache::const_iterator Iterator = FontCache.find(Color);
@@ -467,7 +467,7 @@ void rawbitmap::PrintfUnshaded(bitmap* Bitmap, v2 Pos, packcol16 Color, cchar* F
467467

468468
va_list AP;
469469
va_start(AP, Format);
470-
vsprintf(Buffer, Format, AP);
470+
vsnprintf(Buffer, sizeof(Buffer), Format, AP);
471471
va_end(AP);
472472

473473
fontcache::const_iterator Iterator = FontCache.find(Color);

FeLib/Source/whandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ void ShowFPS(){ //TODO still flickers sometimes cuz of silhouette?
340340
static v2 v2Margin(iMargin,iMargin);
341341
static char c[100];
342342

343-
sprintf(c,"FPS:ls=%.1f,insta=%.1f",globalwindowhandler::GetFPS(false),globalwindowhandler::GetFPS(true));
343+
snprintf(c, sizeof(c), "FPS:ls=%.1f,insta=%.1f", globalwindowhandler::GetFPS(false), globalwindowhandler::GetFPS(true));
344344
int iDistX = strlen(c)*8 + 10 + 100; // +10 to look good, + 100 cuz of silhouette area
345345
v2 v2Pos = RES-v2(iDistX,RES.Y)+v2Margin;
346346
v2 v2Size(iDistX, 8+iMargin*2);

Main/Source/cmdcraft.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3057,7 +3057,7 @@ void updateCraftDesc(){
30573057
float fSkill=craftcore::CraftSkill(PLAYER); //TODO should this dynamic value show too where stats are?
30583058
festring fsSkill="Crafting Proficiency: "; // It's actually different from skills, so don't call it a skill.
30593059
static char cSkill[20];
3060-
sprintf(cSkill, "%.1f",fSkill);
3060+
snprintf(cSkill, sizeof(cSkill), "%.1f",fSkill);
30613061
fsSkill<<cSkill;
30623062

30633063
festring fsDesc=fsSkill;

Main/Source/game.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ void game::InitScript()
371371
for (int f = 0; f <= 99; f++) //additional dungeon files
372372
{
373373
char bnum[32];
374-
sprintf(bnum, "Script/dungeon_%02d.dat", f);
374+
snprintf(bnum, sizeof(bnum), "Script/dungeon_%02d.dat", f);
375375
inputfile ifl(game::GetDataDir()+bnum, &game::GetGlobalValueMap(), false);
376376
if (ifl.IsOpen())
377377
{
@@ -5866,7 +5866,7 @@ truth game::ValidateCustomCmdKey(int iNewKey, int iIgnoreIndex, bool bMoveKeys)
58665866
festring IntToHexStr(int i)
58675867
{
58685868
static char hexbuf[100];
5869-
sprintf(hexbuf, "0x%04X", i);
5869+
snprintf(hexbuf, sizeof(hexbuf), "0x%04X", i);
58705870
festring fs;fs=hexbuf;
58715871
return fs;
58725872
}

Main/Source/item.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ void item::AddInventoryEntry(ccharacter*, festring& Entry, int Amount, truth Sho
869869
Entry << " " << GetVolume() * Amount << "cm3"; //the item can be seen therefore it's volume guessed already
870870
if(GetSecondaryMaterial()==NULL){ //simple items like ingots sticks etc
871871
static char density[20];
872-
sprintf(density, "%.1f", GetWeight()/(float)GetVolume());
872+
snprintf(density, sizeof(density), "%.1f", GetWeight()/(float)GetVolume());
873873
Entry << " " << density << "g/cm3"; //the item can be seen and weighted already so this just helps avoiding having to mentally calc density for every item
874874
if(game::WizardModeIsActive()) //TODO || Char-> possess item <materialmanual*>
875875
Entry << " " << GetStrengthValue() << "str"; //this is special info tho.

Main/Source/message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void msgsystem::AddMessage(cchar* Format, ...)
5353

5454
va_list AP;
5555
va_start(AP, Format);
56-
vsprintf(Message, Format, AP);
56+
vsnprintf(Message, sizeof(Message), Format, AP);
5757
va_end(AP);
5858

5959
festring Buffer(Message);

0 commit comments

Comments
 (0)