Skip to content

Commit

Permalink
Fixing some new compiler warnings in GCC 11.3. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
crisluengo committed May 21, 2022
1 parent 2dedffd commit 6847a46
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
54 changes: 27 additions & 27 deletions src/binary/skeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ void Eusk2D(
pim += neigk[ dirc ][ 0 ];
if( *pim & m2 ) {
*pim &= ~m2;
b.STR( pim, ( dirc - 1 ) & 15 );
b.STR( pim, ( dirc - 1u ) & 15u );
}
pim = ptemp + neigk[ dirc ][ 1 ];
if( *pim & m2 ) {
Expand Down Expand Up @@ -778,21 +778,21 @@ void Eusk2D(
// test neighbourhood in old image, use dirc to store table entry
dirc = 0;
pim += strideX;
if( *pim & m2 ) { dirc |= 1; }
if( *pim & m2 ) { dirc |= 1u; }
pim -= strideX2;
if( *pim & m2 ) { dirc |= 16; }
if( *pim & m2 ) { dirc |= 16u; }
pim -= strideY;
if( *pim & m2 ) { dirc |= 8; }
if( *pim & m2 ) { dirc |= 8u; }
pim += strideX;
if( *pim & m2 ) { dirc |= 4; }
if( *pim & m2 ) { dirc |= 4u; }
pim += strideX;
if( *pim & m2 ) { dirc |= 2; }
if( *pim & m2 ) { dirc |= 2u; }
pim += strideY2;
if( *pim & m2 ) { dirc |= 128; }
if( *pim & m2 ) { dirc |= 128u; }
pim -= strideX;
if( *pim & m2 ) { dirc |= 64; }
if( *pim & m2 ) { dirc |= 64u; }
pim -= strideX;
if( *pim & m2 ) { dirc |= 32; }
if( *pim & m2 ) { dirc |= 32u; }
if( luthile[ dirc ] ) { continue; }

// totally recursive neighbourhood will be build in register byte
Expand All @@ -802,34 +802,34 @@ void Eusk2D(
// and mi == 0, a situation which does not occur normally
pim += strideX;
if(( *pim & m1 ) == m2 ) {
if( luthil[ 0 ][ dirc & ~64 ] ) { continue; }
breg &= ~64;
if( luthil[ 0 ][ dirc & ~64u ] ) { continue; }
breg &= ~64u;
}
pim -= strideY - strideX;
if(( *pim & m1 ) == m2 ) {
if( luthil[ 0 ][ dirc & ~1 ] ) { continue; }
breg &= ~1;
if( luthil[ 0 ][ dirc & ~1u ] ) { continue; }
breg &= ~1u;
}
pim -= strideX2;
if(( *pim & m1 ) == m2 ) {
if( luthil[ 0 ][ dirc & ~16 ] ) { continue; }
breg &= ~16;
if( luthil[ 0 ][ dirc & ~16u ] ) { continue; }
breg &= ~16u;
}
pim -= strideY - strideX;
if(( *pim & m1 ) == m2 ) {
if( luthil[ 0 ][ dirc & ~4 ] ) { continue; }
breg &= ~4;
if( luthil[ 0 ][ dirc & ~4u ] ) { continue; }
breg &= ~4u;
}

// test totally recursive neighbourhood
pim += strideX;
if(( *pim & m1 ) == m2 ) { breg &= ~2; }
if(( *pim & m1 ) == m2 ) { breg &= ~2u; }
pim -= strideX2;
if(( *pim & m1 ) == m2 ) { breg &= ~8; }
if(( *pim & m1 ) == m2 ) { breg &= ~8u; }
pim += strideY2;
if(( *pim & m1 ) == m2 ) { breg &= ~32; }
if(( *pim & m1 ) == m2 ) { breg &= ~32u; }
pim += strideX2;
if(( *pim & m1 ) == m2 ) { breg &= ~128; }
if(( *pim & m1 ) == m2 ) { breg &= ~128u; }
if( luthil[ 0 ][ breg ] ) { continue; }

// change pixel, by temporarily removing input mask
Expand Down Expand Up @@ -4691,9 +4691,9 @@ void EuclideanSkeleton(
if( out.Dimensionality() == 2 ) {
Eusk2D(
static_cast< uint8* >( out.Origin() ),
uint8( 1 << 0 ),
uint8( 1 << 1 ),
uint8( 1 << 2 ),
uint8( 1u << 0u ),
uint8( 1u << 1u ),
uint8( 1u << 2u ),
endPixelCondition, edgeCondition,
5, 7, 11, 0,
static_cast< dip::sint >( out.Size( 0 )),
Expand All @@ -4703,9 +4703,9 @@ void EuclideanSkeleton(
} else {
Eusk3D(
static_cast< uint8* >( out.Origin() ),
uint8( 1 << 0 ),
uint8( 1 << 1 ),
uint8( 1 << 2 ),
uint8( 1u << 0u ),
uint8( 1u << 1u ),
uint8( 1u << 2u ),
endPixelCondition, edgeCondition,
4, 6, 7, 9, 10, 12, 0,
static_cast< dip::sint >( out.Size( 0 )),
Expand Down
6 changes: 3 additions & 3 deletions src/morphology/pathopening.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ void MakeNeighborLists(
using PathLenType = uint16;
constexpr auto DT_PATHLEN = DT_UINT16;

constexpr uint8 PO_ACTIVE = 1;
constexpr uint8 PO_QUEUED = 2;
constexpr uint8 PO_CHANGED = 4;
constexpr unsigned PO_ACTIVE = 1;
constexpr unsigned PO_QUEUED = 2;
constexpr unsigned PO_CHANGED = 4;

using PixelQueue = std::queue< dip::sint >;

Expand Down

0 comments on commit 6847a46

Please sign in to comment.