Commit 9107c740 authored by Fab's avatar Fab
Browse files

add explicit instantitation operator + fix compilation warnings on Ubuntu-20.04

parent 16f6e550
......@@ -38,8 +38,8 @@ inline
uint32_t XGetPixel( XImage* xImage, int32_t x, int32_t y )
{
typedef uint32_t ( *PF )( XImage*, int32_t, int32_t );
return ( *( ( PF )xImage->f.get_pixel ) )( xImage, x, y );
typedef unsigned long ( *PF )( XImage*, int32_t, int32_t );
return uint32_t( ( *( ( PF )xImage->f.get_pixel ) )( xImage, x, y ) );
}
......@@ -48,7 +48,7 @@ inline
int32_t XPutPixel( XImage* xImage, int32_t x, int32_t y, uint32_t pixel )
{
typedef int32_t ( *PF )( XImage*, int32_t, int32_t, uint32_t );
typedef int32_t ( *PF )( XImage*, int32_t, int32_t, unsigned long );
return ( *( ( PF )xImage->f.put_pixel ) )( xImage, x, y, pixel );
}
......@@ -69,7 +69,7 @@ inline
int32_t XAddPixel( XImage* xImage, int32_t value )
{
typedef int32_t ( *PF )( XImage*, int32_t );
typedef int32_t ( *PF )( XImage*, long );
return ( *( ( PF )xImage->f.add_pixel ) )( xImage, value );
}
......
......@@ -19,6 +19,18 @@ gkg::GeometryAllocation::GeometryAllocation(
}
gkg::GeometryAllocation& gkg::GeometryAllocation::operator = (
const gkg::GeometryAllocation& other )
{
_allotmentX = other._allotmentX;
_allotmentY = other._allotmentY;
return *this;
}
bool gkg::GeometryAllocation::isEqualTo( const GeometryAllocation& other,
float epsilon ) const
{
......
......@@ -17,6 +17,8 @@ class GeometryAllocation
GeometryAllocation();
GeometryAllocation( const GeometryAllocation& other );
GeometryAllocation& operator = ( const GeometryAllocation& other );
bool isEqualTo( const GeometryAllocation& other, float epsilon ) const;
void setAllotment( DimensionName dimName,
......
......@@ -10,6 +10,14 @@ gkg::GeometryAllotment::GeometryAllotment()
}
gkg::GeometryAllotment::GeometryAllotment( const gkg::GeometryAllotment& other )
: _origin( other._origin ),
_span( other._span ),
_alignment( other._alignment )
{
}
gkg::GeometryAllotment::GeometryAllotment( gkg::FloatCoordinate origin,
gkg::FloatCoordinate span,
float alignment )
......@@ -20,6 +28,19 @@ gkg::GeometryAllotment::GeometryAllotment( gkg::FloatCoordinate origin,
}
gkg::GeometryAllotment& gkg::GeometryAllotment::operator = (
const gkg::GeometryAllotment& other )
{
_origin = other._origin;
_span = other._span;
_alignment = other._alignment;
return *this;
}
bool gkg::GeometryAllotment::isEqualTo( const gkg::GeometryAllotment& other,
float epsilon ) const
{
......
......@@ -15,9 +15,12 @@ class GeometryAllotment
public:
GeometryAllotment();
GeometryAllotment( const GeometryAllotment& other );
GeometryAllotment( FloatCoordinate origin,
FloatCoordinate span,
float alignment );
GeometryAllotment& operator = ( const GeometryAllotment& other );
bool isEqualTo( const GeometryAllotment& other, float epsilon ) const;
......
......@@ -22,6 +22,20 @@ gkg::GeometryExtension::GeometryExtension( const gkg::GeometryExtension& other )
}
gkg::GeometryExtension& gkg::GeometryExtension::operator = (
const gkg::GeometryExtension& other )
{
_beginX = other._beginX;
_endX = other._endX;
_beginY = other._beginY;
_endY = other._endY;
return *this;
}
void gkg::GeometryExtension::set( gkg::Canvas* canvas,
const gkg::GeometryAllocation& allocation )
{
......
......@@ -19,6 +19,8 @@ class GeometryExtension
GeometryExtension();
GeometryExtension( const GeometryExtension& other );
GeometryExtension& operator = ( const GeometryExtension& other );
void set( Canvas* canvas, const GeometryAllocation& allocation );
void setXY( Canvas*,
......
......@@ -11,6 +11,16 @@ gkg::GeometryRequirement::GeometryRequirement()
}
gkg::GeometryRequirement::GeometryRequirement(
const gkg::GeometryRequirement& other )
: _natural( other._natural ),
_stretch( other._stretch ),
_shrink( other._shrink ),
_alignment( other._alignment )
{
}
gkg::GeometryRequirement::GeometryRequirement( gkg::FloatCoordinate natural )
: _natural( natural ),
_stretch( 0 ),
......@@ -91,6 +101,20 @@ gkg::GeometryRequirement::GeometryRequirement(
}
gkg::GeometryRequirement& gkg::GeometryRequirement::operator = (
const gkg::GeometryRequirement& other )
{
_natural = other._natural;
_stretch = other._stretch;
_shrink = other._shrink;
_alignment = other._alignment;
return *this;
}
bool gkg::GeometryRequirement::isEqualTo( const gkg::GeometryRequirement& other,
float epsilon ) const
{
......
......@@ -15,6 +15,7 @@ class GeometryRequirement
public:
GeometryRequirement();
GeometryRequirement( const GeometryRequirement& other );
GeometryRequirement( FloatCoordinate natural );
GeometryRequirement( FloatCoordinate natural,
FloatCoordinate stretch,
......@@ -26,6 +27,8 @@ class GeometryRequirement
FloatCoordinate naturalTrail,
FloatCoordinate maximumTrail,
FloatCoordinate minimumTrail );
GeometryRequirement& operator = ( const GeometryRequirement& other );
bool isEqualTo( const GeometryRequirement& other, float epsilon ) const;
bool isDefined() const;
......
......@@ -21,6 +21,19 @@ gkg::GeometryRequisition::GeometryRequisition(
}
gkg::GeometryRequisition& gkg::GeometryRequisition::operator = (
const gkg::GeometryRequisition& other )
{
_penalty = other._penalty;
_requirementX = other._requirementX;
_requirementY = other._requirementY;
return *this;
}
void gkg::GeometryRequisition::setPenalty( int32_t penalty )
{
......
......@@ -16,6 +16,8 @@ class GeometryRequisition
GeometryRequisition();
GeometryRequisition( const GeometryRequisition& other );
GeometryRequisition& operator = ( const GeometryRequisition& other );
void setPenalty( int32_t penalty );
int32_t getPenalty() const;
......
......@@ -48,7 +48,7 @@ gkg::RGBComponent::RGBComponent( const gkg::RGBComponent& other )
gkg::RGBComponent&
gkg::RGBComponent::operator=( const gkg::RGBComponent& other )
gkg::RGBComponent::operator = ( const gkg::RGBComponent& other )
{
r = other.r;
......
......@@ -19,7 +19,7 @@ struct RGBComponent
uint8_t theB = 0U );
RGBComponent( const RGBComponent& other );
RGBComponent& operator=( const RGBComponent& other );
RGBComponent& operator = ( const RGBComponent& other );
RGBComponent& operator += ( const RGBComponent& other );
RGBComponent& operator -= ( const RGBComponent& other );
......
......@@ -372,7 +372,7 @@ gkg::AutoMemoryMappedVector< T >& gkg::AutoMemoryMappedVector< T >::operator=(
}
if( this->isMemoryMapped() || other.isMemoryMapped() )
if ( this->isMemoryMapped() || other.isMemoryMapped() )
{
// copying items
......@@ -394,7 +394,7 @@ gkg::AutoMemoryMappedVector< T >& gkg::AutoMemoryMappedVector< T >::operator=(
else
{
memcpy( &( *this->begin() ), &( *other.begin() ),
memcpy( (void*)&( *this->begin() ), (const void*)&( *other.begin() ),
other.getItemCount() * sizeof( T ) );
}
......
......@@ -56,6 +56,19 @@ gkg::Vector2d< T >::Vector2d( const gkg::Vector2d< T >& other )
}
template < class T >
gkg::Vector2d< T >& gkg::Vector2d< T >::operator = (
const gkg::Vector2d< T >& other )
{
x = other.x;
y = other.y;
return *this;
}
template < class T >
gkg::Vector2d< T >&
gkg::Vector2d< T >::operator += ( const gkg::Vector2d< T >& other )
......
......@@ -18,6 +18,8 @@ struct Vector2d
Vector2d( const Vector2d< T >& other );
Vector2d( T theX, T theY );
Vector2d< T >& operator = ( const Vector2d< T >& other );
Vector2d< T >& operator += ( const Vector2d< T >& other );
Vector2d< T >& operator -= ( const Vector2d< T >& other );
Vector2d< T >& operator *= ( T value );
......
......@@ -57,6 +57,20 @@ gkg::Vector3d< T >::Vector3d( const gkg::Vector3d< T >& other )
}
template < class T >
gkg::Vector3d< T >& gkg::Vector3d< T >::operator = (
const gkg::Vector3d< T >& other )
{
x = other.x;
y = other.y;
z = other.z;
return *this;
}
template < class T >
gkg::Vector3d< T >&
gkg::Vector3d< T >::operator += ( const gkg::Vector3d< T >& other )
......
......@@ -18,6 +18,8 @@ struct Vector3d
Vector3d( const Vector3d< T >& other );
Vector3d( T theX, T theY, T theZ );
Vector3d< T >& operator = ( const Vector3d< T >& other );
Vector3d< T >& operator += ( const Vector3d< T >& other );
Vector3d< T >& operator -= ( const Vector3d< T >& other );
Vector3d< T >& operator *= ( T value );
......
......@@ -63,9 +63,30 @@ gkg::MachineLearningScaler::~MachineLearningScaler()
}
gkg::MachineLearningScaler& gkg::MachineLearningScaler::operator = (
const gkg::MachineLearningScaler& other )
{
copy( other );
return *this;
}
const gkg::Matrix& gkg::MachineLearningScaler::getScaleMatrix() const
{
return _scale;
}
void gkg::MachineLearningScaler::copy( const gkg::MachineLearningScaler& other )
{
_scale = other._scale;
_outMin = other._outMin;
_outMax = other._outMax;
}
......@@ -23,6 +23,8 @@ class MachineLearningScaler
MachineLearningScaler( double outMin = -1, double outMax = 1.0 );
MachineLearningScaler( const MachineLearningScaler& other );
virtual ~MachineLearningScaler();
MachineLearningScaler& operator = ( const MachineLearningScaler& other );
virtual void scale( SparseMatrix& data ) = 0;
virtual void scale( Matrix& data ) = 0;
......@@ -34,6 +36,8 @@ class MachineLearningScaler
Matrix _scale;
double _outMin;
double _outMax;
void copy( const MachineLearningScaler& other );
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment