Skip to content

Commit

Permalink
Fix some warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
tx00100xt committed Nov 22, 2023
1 parent 90ecfd3 commit e4e99db
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 23 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ endif()
# Set up some sanity stuff...
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME MATCHES "GNU")
set(LINUX TRUE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-reorder -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-unused-function -Wno-format")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-unused-function -Wno-format")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(FREEBSD TRUE)
endif()
if(APPLE)
Expand Down
3 changes: 1 addition & 2 deletions SamTFE/Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ endif()
###############################################################
###############################################################

# Set up some sanity stuff...
# Set up some sanity stuff...
# Note:
# "-rpath,$ORIGIN" allows you not to use LD_LIBRARY_PATH and is well suited for local installation
Expand All @@ -140,7 +139,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-unused-function -Wno-format")
set(RPATH_SETTINGS "-rpath,$ORIGIN")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable -Wno-uninitialized -Wno-unused-function -Wno-format")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-enum-constexpr-conversion -Wno-unused-but-set-variable -Wno-uninitialized -Wno-unused-function -Wno-format")
set(FREEBSD TRUE)
Expand Down
5 changes: 3 additions & 2 deletions SamTFE/Sources/Engine/Graphics/ImageInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct TGAHeader
UBYTE IdLength;
UBYTE ColorMapType;
UBYTE ImageType;
UBYTE ColorMapSpec[5];
UBYTE ColorMapSpec[5]; // #### 5 ... strm>>t.ColorMapSpec[5]; ????
UWORD Xorigin;
UWORD Yorigin;
UWORD Width;
Expand All @@ -121,7 +121,8 @@ static __forceinline CTStream &operator>>(CTStream &strm, TGAHeader &t) {
strm>>t.IdLength;
strm>>t.ColorMapType;
strm>>t.ImageType;
strm>>t.ColorMapSpec[5];
//strm>>t.ColorMapSpec[5]; // #### not correct
strm.Read_t(t.ColorMapSpec, sizeof (t.ColorMapSpec));
strm>>t.Xorigin;
strm>>t.Yorigin;
strm>>t.Width;
Expand Down
2 changes: 2 additions & 0 deletions SamTFE/Sources/Entities/Common/HUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ static int qsort_CompareDeaths( const void *ppPEN0, const void *ppPEN1) {
else return 0;
}

#ifndef NDEBUG
static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
CPlayer &en0 = **(CPlayer**)ppPEN0;
CPlayer &en1 = **(CPlayer**)ppPEN1;
Expand All @@ -258,6 +259,7 @@ static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
else if( sl0>sl1) return -1;
else return 0;
}
#endif // NDEBUG

// prepare color transitions
static void PrepareColorTransitions( COLOR colFine, COLOR colHigh, COLOR colMedium, COLOR colLow,
Expand Down
2 changes: 2 additions & 0 deletions SamTFE/Sources/EntitiesMP/Common/HUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ static int qsort_CompareFrags( const void *ppPEN0, const void *ppPEN1) {
else return -qsort_CompareDeaths(ppPEN0, ppPEN1);
}

#ifndef NDEBUG
static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
CPlayer &en0 = **(CPlayer**)ppPEN0;
CPlayer &en1 = **(CPlayer**)ppPEN1;
Expand All @@ -294,6 +295,7 @@ static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
else if( sl0>sl1) return -1;
else return 0;
}
#endif // NDEBUG

// prepare color transitions
static void PrepareColorTransitions( COLOR colFine, COLOR colHigh, COLOR colMedium, COLOR colLow,
Expand Down
14 changes: 8 additions & 6 deletions SamTFE/Sources/amp11lib/amp3dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ void ampegdecoder::jointstereo(grsistruct &si, float (*xr)[576], int *scalefacl)

int sfb;
int sfbhigh=22;
int _tmpsfb=0;
if (si.blocktype==2)
{
int sfblow=si.mixedblock?3:0;
Expand All @@ -1035,10 +1036,10 @@ void ampegdecoder::jointstereo(grsistruct &si, float (*xr)[576], int *scalefacl)
if (sfb>3)
sfbhigh=0;
int v=7;
for (sfb=sfb; sfb<13; sfb++)
for (_tmpsfb=sfb; _tmpsfb<13; _tmpsfb++)
{
v=(sfb==12)?v:scalefacs[sfb*3+j];
for (i=bis[sfb]+j; i<bis[sfb+1]; i+=3)
v=(_tmpsfb==12)?v:scalefacs[_tmpsfb*3+j];
for (i=bis[_tmpsfb]+j; i<bis[_tmpsfb+1]; i+=3)
ispos[i]=v;
}
}
Expand All @@ -1050,13 +1051,14 @@ void ampegdecoder::jointstereo(grsistruct &si, float (*xr)[576], int *scalefacl)
if (i<bil[sfb])
break;
int v=7;
for (sfb=sfb; sfb<sfbhigh; sfb++)
for (_tmpsfb=sfb; _tmpsfb<sfbhigh; _tmpsfb++)
{
v=(sfb==21)?v:scalefacl[sfb];
for (i=bil[sfb]; i<bil[sfb+1]; i++)
v=(_tmpsfb==21)?v:scalefacl[_tmpsfb];
for (i=bil[_tmpsfb]; i<bil[_tmpsfb+1]; i++)
ispos[i]=v;
}


int msstereo=hdrmodeext&2;
for (i=0; i<max; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion SamTSE/Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reorder -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-unused-function -Wno-format")
set(RPATH_SETTINGS "-rpath,$ORIGIN")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable -Wno-uninitialized -Wno-unused-function -Wno-format")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-enum-constexpr-conversion -Wno-unused-but-set-variable -Wno-uninitialized -Wno-unused-function -Wno-format")
set(FREEBSD TRUE)
Expand Down
5 changes: 3 additions & 2 deletions SamTSE/Sources/Engine/Graphics/ImageInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct TGAHeader
UBYTE IdLength;
UBYTE ColorMapType;
UBYTE ImageType;
UBYTE ColorMapSpec[5];
UBYTE ColorMapSpec[5]; // #### 5 ... strm>>t.ColorMapSpec[5]; ????
UWORD Xorigin;
UWORD Yorigin;
UWORD Width;
Expand All @@ -121,7 +121,8 @@ static __forceinline CTStream &operator>>(CTStream &strm, TGAHeader &t) {
strm>>t.IdLength;
strm>>t.ColorMapType;
strm>>t.ImageType;
strm>>t.ColorMapSpec[5];
//strm>>t.ColorMapSpec[5]; // #### not correct
strm.Read_t(t.ColorMapSpec, sizeof (t.ColorMapSpec));
strm>>t.Xorigin;
strm>>t.Yorigin;
strm>>t.Width;
Expand Down
9 changes: 8 additions & 1 deletion SamTSE/Sources/Entities/Common/HUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ extern INDEX hud_iSortPlayers;
extern FLOAT hud_fOpacity;
extern FLOAT hud_fScaling;
extern FLOAT hud_tmWeaponsOnScreen;
extern INDEX hud_bWeaponsIconScale; // HUD weapons icons scale: 0 - small, 1 - big


// player statistics sorting keys
Expand Down Expand Up @@ -248,6 +249,7 @@ static int qsort_CompareDeaths( const void *ppPEN0, const void *ppPEN1) {
else return 0;
}

#ifndef NDEBUG
static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
CPlayer &en0 = **(CPlayer**)ppPEN0;
CPlayer &en1 = **(CPlayer**)ppPEN1;
Expand All @@ -257,6 +259,7 @@ static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
else if( sl0>sl1) return -1;
else return 0;
}
#endif // NDEBUG

// prepare color transitions
static void PrepareColorTransitions( COLOR colFine, COLOR colHigh, COLOR colMedium, COLOR colLow,
Expand Down Expand Up @@ -815,7 +818,11 @@ extern void DrawHUD( const CPlayer *penPlayerCurrent, CDrawPort *pdpCurrent, BOO
if( ptoWantedWeapon == _awiWeapons[i].wi_ptoWeapon) colIcon = C_WHITE;
_fCustomScalingAdjustment = 1.0f;
HUD_DrawBorder( fCol, fRow, fOneUnit, fOneUnit, colIcon);
_fCustomScalingAdjustment = 0.5f;
if (hud_bWeaponsIconScale) {
_fCustomScalingAdjustment = 0.75f;
} else {
_fCustomScalingAdjustment = 0.5f;
}
HUD_DrawIcon( fCol, fRow, *_awiWeapons[i].wi_ptoWeapon, colIcon, 1.0f, FALSE);
// advance to next position
fCol += fAdvUnit;
Expand Down
2 changes: 2 additions & 0 deletions SamTSE/Sources/EntitiesMP/Common/HUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ static int qsort_CompareFrags( const void *ppPEN0, const void *ppPEN1) {
else return -qsort_CompareDeaths(ppPEN0, ppPEN1);
}

#ifndef NDEBUG
static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
CPlayer &en0 = **(CPlayer**)ppPEN0;
CPlayer &en1 = **(CPlayer**)ppPEN1;
Expand All @@ -295,6 +296,7 @@ static int qsort_CompareLatencies( const void *ppPEN0, const void *ppPEN1) {
else if( sl0>sl1) return -1;
else return 0;
}
#endif // NDEBUG

// prepare color transitions
static void PrepareColorTransitions( COLOR colFine, COLOR colHigh, COLOR colMedium, COLOR colLow,
Expand Down
13 changes: 7 additions & 6 deletions SamTSE/Sources/amp11lib/amp3dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@ void ampegdecoder::jointstereo(grsistruct &si, float (*xr)[576], int *scalefacl)

int sfb;
int sfbhigh=22;
int _tmpsfb=0;
if (si.blocktype==2)
{
int sfblow=si.mixedblock?3:0;
Expand All @@ -1035,10 +1036,10 @@ void ampegdecoder::jointstereo(grsistruct &si, float (*xr)[576], int *scalefacl)
if (sfb>3)
sfbhigh=0;
int v=7;
for (sfb=sfb; sfb<13; sfb++)
for (_tmpsfb=sfb; _tmpsfb<13; _tmpsfb++)
{
v=(sfb==12)?v:scalefacs[sfb*3+j];
for (i=bis[sfb]+j; i<bis[sfb+1]; i+=3)
v=(_tmpsfb==12)?v:scalefacs[_tmpsfb*3+j];
for (i=bis[_tmpsfb]+j; i<bis[_tmpsfb+1]; i+=3)
ispos[i]=v;
}
}
Expand All @@ -1050,10 +1051,10 @@ void ampegdecoder::jointstereo(grsistruct &si, float (*xr)[576], int *scalefacl)
if (i<bil[sfb])
break;
int v=7;
for (sfb=sfb; sfb<sfbhigh; sfb++)
for (_tmpsfb=sfb; _tmpsfb<sfbhigh; _tmpsfb++)
{
v=(sfb==21)?v:scalefacl[sfb];
for (i=bil[sfb]; i<bil[sfb+1]; i++)
v=(_tmpsfb==21)?v:scalefacl[_tmpsfb];
for (i=bil[_tmpsfb]; i<bil[_tmpsfb+1]; i++)
ispos[i]=v;
}

Expand Down

0 comments on commit e4e99db

Please sign in to comment.