Skip to content

Commit

Permalink
Remove obsolete __GNUC__ checks (#2165)
Browse files Browse the repository at this point in the history
  • Loading branch information
undef21 authored Nov 3, 2020
1 parent be3f735 commit 20c83d5
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 42 deletions.
5 changes: 0 additions & 5 deletions src/fheroes2/objects/objdsrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@

int ObjDsrt::GetPassable( u32 index )
{
#if ( __GNUC__ == 4 && __GNUC_MINOR__ == 4 )
// fixed: array subscript is above array bounds
const u8 disabled[] = {61, 89, 90, 91, 92, 93, 125, 126, 255};
#else
const u8 disabled[] = {61, 89, 90, 91, 92, 93, 125, 126};
#endif
const u8 restricted[] = {3, 6, 9, 12, 14, 15, 17, 18, 20, 21, 22, 24, 26, 28, 30, 31, 32, 34, 36, 39, 40, 42, 45,
48, 49, 51, 53, 72, 76, 81, 83, 94, 95, 97, 98, 99, 100, 110, 111, 112, 116, 121, 127, 128, 130};

Expand Down
10 changes: 0 additions & 10 deletions src/fheroes2/objects/objlava.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ bool ObjLav2::isAction( u32 index )

bool ObjLav2::isShadow( u32 index )
{
#if ( __GNUC__ == 4 && __GNUC_MINOR__ == 4 )
// fixed: array subscript is above array bounds
const u8 shadows[] = {0, 7, 14, 29, 33, 44, 55, 78, 255};
#else
const u8 shadows[] = {0, 7, 14, 29, 33, 44, 55, 78};
#endif
return ARRAY_COUNT_END( shadows ) != std::find( shadows, ARRAY_COUNT_END( shadows ), index );
}

Expand Down Expand Up @@ -94,12 +89,7 @@ bool ObjLava::isAction( u32 index )

bool ObjLava::isShadow( u32 index )
{
#if ( __GNUC__ == 4 && __GNUC_MINOR__ == 4 )
// fixed: array subscript is above array bounds
const u8 shadows[] = {10, 11, 45, 49, 77, 109, 113, 116, 255};
#else
const u8 shadows[] = {10, 11, 45, 49, 77, 109, 113, 116};
#endif
return ARRAY_COUNT_END( shadows ) != std::find( shadows, ARRAY_COUNT_END( shadows ), index );
}

Expand Down
5 changes: 0 additions & 5 deletions src/fheroes2/objects/objmult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ bool ObjMult::isShadow( u32 index )

int ObjMul2::GetPassable( u32 index )
{
#if ( __GNUC__ == 4 && __GNUC_MINOR__ == 4 )
// fixed: array subscript is above array bounds
const u8 disabled[] = {46, 76, 77, 124, 125, 126, 221, 213, 255};
#else
const u8 disabled[] = {46, 76, 77, 124, 125, 126, 221, 213};
#endif
const u8 restricted[] = {16, 18, 19, 25, 27, 51, 52, 53, 55, 57, 78, 79, 81, 98, 105, 128, 136, 187, 207, 209, 214, 215, 217};

if ( isShadow( index ) )
Expand Down
16 changes: 0 additions & 16 deletions src/fheroes2/objects/objwatr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@

int ObjWat2::GetPassable( u32 index )
{
#if ( __GNUC__ == 4 && __GNUC_MINOR__ == 4 )
// fixed: array subscript is above array bounds
const u8 disabled[] = {11, 12, 19, 22, 255};
#else
const u8 disabled[] = {11, 12, 19, 22};
#endif
const u8 restricted[] = {2, 20};

if ( isShadow( index ) )
Expand All @@ -51,12 +46,7 @@ int ObjWat2::GetPassable( u32 index )

int ObjWatr::GetPassable( u32 index )
{
#if ( __GNUC__ == 4 && __GNUC_MINOR__ == 4 )
// fixed: array subscript is above array bounds
const u8 disabled[] = {11, 12, 19, 22, 255};
#else
const u8 disabled[] = {11, 12, 19, 22};
#endif
const u8 restricted[] = {69, 182, 183, 185, 186, 187, 248};

if ( isShadow( index ) )
Expand All @@ -79,13 +69,7 @@ bool ObjWatr::isAction( u32 index )

bool ObjWatr::isShadow( u32 index )
{
#if ( __GNUC__ == 4 && __GNUC_MINOR__ == 4 )
// fixed: array subscript is above array bounds
const u8 shadows[] = {12, 38, 52, 55, 118, 166, 188, 240, 255};
#else
const u8 shadows[] = {12, 38, 52, 55, 118, 166, 188, 240};
#endif

return ARRAY_COUNT_END( shadows ) != std::find( shadows, ARRAY_COUNT_END( shadows ), index );
}

Expand Down
6 changes: 0 additions & 6 deletions src/fheroes2/objects/objxloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,7 @@ bool ObjXlc2::isAction( u32 index )

bool ObjXlc2::isShadow( u32 index )
{
#if ( __GNUC__ == 4 && __GNUC_MINOR__ == 4 )
// fixed: array subscript is above array bounds
const u8 shadows[] = {2, 10, 47, 83, 255};
#else
const u8 shadows[] = {2, 10, 47, 83};
#endif

return ARRAY_COUNT_END( shadows ) != std::find( shadows, ARRAY_COUNT_END( shadows ), index );
}

Expand Down

0 comments on commit 20c83d5

Please sign in to comment.