Skip to content

Commit a39c300

Browse files
authored
Merge pull request bfbbdecomp#32 from bluisblu/dev
Set inline to auto
2 parents 8f5d477 + 343b8c6 commit a39c300

File tree

14 files changed

+61
-28
lines changed

14 files changed

+61
-28
lines changed

configure.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@
227227
# dolphin library flags
228228
cflags_dolphin = [
229229
*cflags_base,
230-
"-lang=c",
230+
"-lang=c",
231231
"-fp fmadd",
232232
"-fp_contract off",
233233
"-char signed",
234-
"-str reuse",
234+
"-str reuse",
235235
"-common off",
236236
"-O4,p",
237237
#"-requireprotos"
@@ -240,11 +240,11 @@
240240
# Renderware library flags
241241
cflags_renderware = [
242242
*cflags_base,
243-
"-lang=c",
243+
"-lang=c",
244244
"-fp fmadd",
245245
"-fp_contract off",
246246
"-char signed",
247-
"-str reuse",
247+
"-str reuse",
248248
"-common off",
249249
"-O4,p",
250250
#"-requireprotos"
@@ -265,7 +265,7 @@
265265
"-str reuse,pool,readonly",
266266
"-use_lmw_stmw on",
267267
'-pragma "cpp_extensions on"',
268-
"-inline off",
268+
"-inline auto",
269269
"-gccinc",
270270
"-i include/bink",
271271
"-i include/inline",
@@ -368,15 +368,15 @@ def MatchingFor(*versions):
368368
Object(NonMatching, "SB/Core/x/xModelBlur.cpp"),
369369
Object(NonMatching, "SB/Core/x/xCamera.cpp"),
370370
Object(NonMatching, "SB/Game/zWadNME.cpp"),
371-
Object(NonMatching, "SB/Game/zWad1.cpp"),
371+
Object(NonMatching, "SB/Game/zWad1.cpp"),
372372
Object(NonMatching, "SB/Game/zWad2.cpp"),
373373
Object(NonMatching, "SB/Game/zWad3.cpp"),
374374
Object(NonMatching, "SB/Game/zWadEnt.cpp"),
375375
Object(NonMatching, "SB/Game/zWadHud.cpp"),
376376
Object(NonMatching, "SB/Game/zWadUI.cpp"),
377377
Object(NonMatching, "SB/Game/zMain.cpp"),
378-
Object(NonMatching, "SB/Game/zTalkBox.cpp"),
379-
Object(NonMatching, "SB/Game/zTaskBox.cpp"),
378+
Object(NonMatching, "SB/Game/zTalkBox.cpp", extra_cflags=["-inline off"]),
379+
Object(NonMatching, "SB/Game/zTaskBox.cpp", extra_cflags=["-inline off"]),
380380
Object(NonMatching, "SB/Game/zSmoke.cpp"),
381381
Object(NonMatching, "SB/Game/zSplash.cpp"),
382382
Object(NonMatching, "SB/Game/zExplosion.cpp"),
@@ -398,7 +398,7 @@ def MatchingFor(*versions):
398398
Object(Matching, "SB/Core/gc/iException.cpp"),
399399
Object(NonMatching, "SB/Core/gc/iScrFX.cpp"),
400400
Object(NonMatching, "SB/Core/gc/iARAMTmp.cpp"),
401-
401+
402402
],
403403
},
404404
{
@@ -452,7 +452,7 @@ def MatchingFor(*versions):
452452
[
453453
Object(Matching, "dolphin/src/ar/ar.c"),
454454
Object(Matching, "dolphin/src/ar/arq.c")
455-
]
455+
]
456456
),
457457
DolphinLib(
458458
"ax",
@@ -484,7 +484,7 @@ def MatchingFor(*versions):
484484
"base",
485485
[
486486
Object(Matching, "dolphin/src/base/PPCArch.c")
487-
]
487+
]
488488
),
489489
DolphinLib(
490490
"card",
@@ -519,7 +519,7 @@ def MatchingFor(*versions):
519519
Object(NonMatching, "dolphin/src/dsp/dsp.c"),
520520
Object(Matching, "dolphin/src/dsp/dsp_debug.c"),
521521
Object(NonMatching, "dolphin/src/dsp/dsp_task.c")
522-
]
522+
]
523523
),
524524
DolphinLib(
525525
"dvd",
@@ -562,7 +562,7 @@ def MatchingFor(*versions):
562562
]
563563
),
564564
DolphinLib(
565-
"mix",
565+
"mix",
566566
[
567567
Object(NonMatching, "dolphin/src/mix/mix.c")
568568
]
@@ -683,14 +683,14 @@ def MatchingFor(*versions):
683683
Object(NonMatching, "MSL_C/MSL_Common/strtold.c"),
684684
Object(NonMatching, "MSL_C/MSL_Common/strtoul.c"),
685685
Object(Matching, "MSL_C/MSL_Common/float.c"),
686-
Object(NonMatching, "MSL_C/MSL_Common/char_io.c"),
687-
Object(NonMatching, "MSL_C/MSL_Common/wchar_io.c"),
686+
Object(NonMatching, "MSL_C/MSL_Common/char_io.c"),
687+
Object(NonMatching, "MSL_C/MSL_Common/wchar_io.c"),
688688
Object(NonMatching, "MSL_C/MSL_Common_Embedded/uart_console_io_gcn.c")
689689
]
690690
),
691691
mslLib(
692692
"fdlibm.PPCEABI.H",
693-
[],
693+
[],
694694
[
695695
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_acos.c"),
696696
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_asin.c"),
@@ -747,7 +747,7 @@ def MatchingFor(*versions):
747747
Object(NonMatching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/targimpl.c"),
748748
#Object(NonMatching, "debugger/embedded/MetroTRK/Processor/ppc/Export/targsupp.s"),
749749
Object(Matching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/mpc_7xx_603e.c"),
750-
Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c"),
750+
Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c"),
751751
Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/usr_put.c"),
752752
Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk_glue.c"),
753753
Object(Matching, "debugger/embedded/MetroTRK/Os/dolphin/targcont.c"),

src/SB/Core/gc/iWad.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ static S32 iSG_mc_fclose(st_ISG_MEMCARD_DATA* mcdata)
423423
return iSG_mc_fclose(mcdata, NULL);
424424
}
425425

426+
// Inlining issue
426427
static S32 iSG_mc_fopen(st_ISG_MEMCARD_DATA* mcdata, const char* fname, S32 fsize,
427428
en_ISG_IOMODE mode, en_ASYNC_OPERR* operr)
428429
{
@@ -857,6 +858,7 @@ static S32 iSG_bnr_unpack(st_ISG_TPL_TEXPALETTE* tpl)
857858
return iSG_tpl_unpack(tpl);
858859
}
859860

861+
// Inlining issue
860862
static S32 iSG_load_icondata()
861863
{
862864
g_rawicon = (st_ISG_TPL_TEXPALETTE*)iFileLoad("/SBGCIcon.tpl", NULL, &g_iconsize);
@@ -1516,6 +1518,7 @@ char* iSGFileModDate(st_ISGSESSION* isgdata, const char* fname, S32* sec, S32* m
15161518
return datestr;
15171519
}
15181520

1521+
// Inlining issue
15191522
char* iSGFileModDate(st_ISGSESSION* isgdata, const char* fname)
15201523
{
15211524
return iSGFileModDate(isgdata, fname, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -1559,6 +1562,7 @@ S32 iSGFileSize(st_ISGSESSION* isgdata, const char* fname)
15591562
return ret;
15601563
}
15611564

1565+
// Inlining issue
15621566
S32 iSGTgtHaveRoomStartup(st_ISGSESSION* isgdata, S32 tidx, S32 fsize, const char* dpath,
15631567
const char* fname, S32* bytesNeeded, S32* availOnDisk, S32* needFile)
15641568
{
@@ -1633,6 +1637,7 @@ S32 iSGTgtHaveRoomStartup(st_ISGSESSION* isgdata, S32 tidx, S32 fsize, const cha
16331637
return (count >= 3) ? 0 : is_space;
16341638
}
16351639

1640+
// Inlining issue
16361641
S32 iSGTgtHaveRoom(st_ISGSESSION* isgdata, S32 tidx, S32 fsize, const char* dpath,
16371642
const char* fname, S32* bytesNeeded, S32* availOnDisk, S32* needFile)
16381643
{
@@ -1992,6 +1997,7 @@ S32 iSGShutdown()
19921997
return 1;
19931998
}
19941999

2000+
// Inlining issue
19952001
S32 iSGStartup() // TO-DO - 92%
19962002
{
19972003
if (g_isginit++ != 0)
@@ -2146,6 +2152,7 @@ extern U32 HeapSize;
21462152
extern U32 mem_top_alloc;
21472153
extern U32 mem_base_alloc;
21482154

2155+
// Inlining issue
21492156
void iMemExit()
21502157
{
21512158
free((void*)gMemInfo.DRAM.addr);
@@ -3335,6 +3342,7 @@ void iEnvEndRenderFX(iEnv*)
33353342
}
33363343
}
33373344

3345+
// Inlining issue
33383346
void iEnvRender(iEnv* env, bool)
33393347
{
33403348
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);

src/SB/Core/x/xCamera.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ static void _xCameraUpdate(xCamera* cam, F32 dt)
385385
// lol nope
386386
}
387387

388+
// Inlining issue
388389
void xCameraUpdate(xCamera* cam, F32 dt)
389390
{
390391
S32 i;

src/SB/Core/x/xEnt.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,14 @@ void xEntSceneExit();
232232
void xEntSceneInit();
233233
void xEntSetTimePassed(F32 sec);
234234

235-
inline void xEntHide(xEnt* ent)
235+
// Needs to be [gw] but not inline?
236+
void xEntHide(xEnt* ent)
236237
{
237238
ent->flags &= ~0x1;
238239
}
239240

240-
inline void xEntShow(xEnt* ent)
241+
// Needs to be [gw] but not inline?
242+
void xEntShow(xEnt* ent)
241243
{
242244
ent->flags |= 0x1;
243245
}

src/SB/Core/x/xGrid.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void xGridCheckPosition(xGrid* grid, xVec3* pos, xQCData* qcd, GridEntCallback h
7676
S32 xGridEntIsTooBig(xGrid* grid, const xEnt* ent);
7777
S32 xGridAdd(xGrid* grid, xEnt* ent);
7878

79-
inline xGridBound* xGridIterFirstCell(xGridBound** head, xGridIterator& it)
79+
xGridBound* xGridIterFirstCell(xGridBound** head, xGridIterator& it)
8080
{
8181
xGridBound* cell = *head;
8282

@@ -94,7 +94,7 @@ inline xGridBound* xGridIterFirstCell(xGridBound** head, xGridIterator& it)
9494
return cell;
9595
}
9696

97-
inline xGridBound* xGridIterFirstCell(xGrid* grid, S32 grx, S32 grz, xGridIterator& iter)
97+
xGridBound* xGridIterFirstCell(xGrid* grid, S32 grx, S32 grz, xGridIterator& iter)
9898
{
9999
if (grx < 0 || grx >= grid->nx)
100100
{

src/SB/Core/x/xWad1.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,7 @@ static en_BIO_ASYNC_ERRCODES AsyncReadStatus(st_FILELOADINFO* fli)
11501150
return BFD_AsyncReadStatus(fli);
11511151
}
11521152

1153+
// Inlining issue
11531154
static S32 AsyncIRead(st_FILELOADINFO* fli, S32 offset, char* data, S32 size, S32 n)
11541155
{
11551156
return BFD_AsyncRead(fli, offset, data, size, n, LITTLE_ENDIAN);
@@ -1490,6 +1491,7 @@ static S32 BFD_getLength(tag_xFile* bffp, void* xtradata)
14901491
return iFileGetSize(bffp);
14911492
}
14921493

1494+
// Inlining issue
14931495
st_FILELOADINFO* xBinioLoadCreate(const char* filename, S32)
14941496
{
14951497
st_FILELOADINFO* fli = NULL;
@@ -1844,6 +1846,7 @@ void xAnimPlaySetup(xAnimPlay* play, void* object, xAnimTable* table, xModelInst
18441846
xAnimPlaySetState(play->Single, table->StateList, 0.0f);
18451847
}
18461848

1849+
// Inlining issue
18471850
xAnimPlay* xAnimPoolAlloc(xMemPool* pool, void* object, xAnimTable* table,
18481851
xModelInstance* modelInst)
18491852
{
@@ -1919,7 +1922,7 @@ void xAnimPoolCB(xMemPool* pool, void* data)
19191922
clone->Pool = pool;
19201923
}
19211924

1922-
#define ADD_4_BITS(x) (((x)&1) + (((x) >> 1) & 1) + (((x) >> 2) & 1) + (((x) >> 3) & 1))
1925+
#define ADD_4_BITS(x) (((x) & 1) + (((x) >> 1) & 1) + (((x) >> 2) & 1) + (((x) >> 3) & 1))
19231926
void xAnimPoolInit(xMemPool* pool, U32 count, U32 singles, U32 blendFlags, U32 effectMax)
19241927
{
19251928
effectMax += effectMax & 1;

src/SB/Core/x/xWad2.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,7 @@ static void DrawRing(xFXRing* m)
13111311
// todo: uses int-to-float conversion
13121312
}
13131313

1314+
// Inlining issue
13141315
void xFXRingRender()
13151316
{
13161317
S32 i;
@@ -4711,6 +4712,7 @@ namespace
47114712
ent.pflags = 0x4;
47124713
}
47134714

4715+
// Inlining issue
47144716
void drop_stacked_entity(xEnt& ent)
47154717
{
47164718
ent.pflags = 0x4;
@@ -4745,6 +4747,7 @@ namespace
47454747
}
47464748
} // namespace
47474749

4750+
// Inlining issue
47484751
void xEntUpdate(xEnt* ent, xScene* sc, F32 dt)
47494752
{
47504753
xEntBeginUpdate(ent, sc, dt);

src/SB/Core/x/xWad4.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,13 +608,15 @@ S32 xSGWriteData(st_XSAVEGAME_DATA* xsgdata, st_XSAVEGAME_WRITECONTEXT* wctxt, c
608608
return cnt;
609609
}
610610

611+
// Inlining issue
611612
S32 xSG_cb_leader_load(void*, st_XSAVEGAME_DATA* original_xsgdata, st_XSAVEGAME_READCONTEXT* rctxt,
612613
U32, S32)
613614
{
614615
char fundata[32] = {};
615616
st_XSAVEGAME_LEADER discard = {};
616-
xSGReadData(original_xsgdata, rctxt, discard.gameLabel, sizeof(st_XSAVEGAME_LEADER));
617-
xSGReadData(original_xsgdata, rctxt, fundata, 0x16);
617+
// TODO: Fix last two args in function signature
618+
xSGReadData(original_xsgdata, rctxt, discard.gameLabel, 1, sizeof(st_XSAVEGAME_LEADER));
619+
xSGReadData(original_xsgdata, rctxt, fundata, 1, 0x16);
618620
return 1;
619621
}
620622

@@ -631,8 +633,9 @@ S32 xSG_cb_leader_svproc(void* cltdata, st_XSAVEGAME_DATA* original_xsgdata,
631633
leader.progress = xsg->progress;
632634
leader.thumbIconIdx = xsg->thumbIconIdx;
633635

634-
xSGWriteData(original_xsgdata, wctxt, leader.gameLabel, sizeof(st_XSAVEGAME_LEADER));
635-
xSGWriteData(original_xsgdata, wctxt, fundata, 0x16);
636+
// TODO: Fix last two args in function signature
637+
xSGWriteData(original_xsgdata, wctxt, leader.gameLabel, 1, sizeof(st_XSAVEGAME_LEADER));
638+
xSGWriteData(original_xsgdata, wctxt, fundata, 1, 0x16);
636639
return 1;
637640
}
638641

@@ -885,6 +888,7 @@ S32 xSGSetup(st_XSAVEGAME_DATA* xsgdata, S32 gidx, char* label, S32 progress, iT
885888
return result;
886889
}
887890

891+
// Inlining issue
888892
S32 xSGSetup(st_XSAVEGAME_DATA* xsgdata)
889893
{
890894
return xSGSetup(xsgdata, 0, "nothing", -1, 0, 0);
@@ -1272,6 +1276,7 @@ S32 xSGDone(st_XSAVEGAME_DATA* xsgdata)
12721276
return result;
12731277
}
12741278

1279+
// Inlining issue
12751280
st_XSAVEGAME_DATA* xSGInit(en_SAVEGAME_MODE mode)
12761281
{
12771282
st_XSAVEGAME_DATA* xsgdata = &g_xsgdata;
@@ -2476,6 +2481,7 @@ void PKR_ReadDone(st_PACKER_READ_DATA* pr)
24762481
g_loadlock &= ~(1 << lockid);
24772482
}
24782483

2484+
// Inlining issue
24792485
st_PACKER_READ_DATA* PKR_ReadInit(void* userdata, const char* pkgfile, U32 opts, S32* cltver,
24802486
PKRAssetType* typelist, int)
24812487
{

src/SB/Game/zEnv.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ void zEnvInit(_zEnv* env, xEnvAsset* easset)
140140
}
141141
}
142142

143+
// Inlining issue
143144
void zEnvInit(void* env, void* easset)
144145
{
145146
zEnvInit((_zEnv*)env, (xEnvAsset*)easset);

src/SB/Game/zNMETypeBossDennis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ void zNMEDennis::MeterRender()
2020
{
2121
}
2222

23+
// Inlining issue
2324
void zNMEDennis::RenderHud()
2425
{
2526
zNMEDennis::MeterRender();

0 commit comments

Comments
 (0)