Skip to content

Commit ae91fb2

Browse files
committedJun 24, 2019
Fix cast warnings
1 parent 538e294 commit ae91fb2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/app/gps/qgsgpsinformationwidget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,11 +1021,11 @@ void QgsGpsInformationWidget::mBtnCloseFeature_clicked()
10211021

10221022
if ( layerWKBType == QgsWkbTypes::LineString )
10231023
{
1024-
int size = 1 + 2 * sizeof( int ) + 2 * mCaptureList.size() * sizeof( double );
1024+
int size = 1 + 2 * static_cast<int>( sizeof( int ) ) + 2 * mCaptureList.size() * static_cast<int>( sizeof( double ) );
10251025
unsigned char *buf = new unsigned char[size];
10261026

10271027
QgsWkbPtr wkbPtr( buf, size );
1028-
wkbPtr << ( char ) QgsApplication::endian() << QgsWkbTypes::LineString << mCaptureList.size();
1028+
wkbPtr << static_cast< char >( QgsApplication::endian() ) << QgsWkbTypes::LineString << mCaptureList.size();
10291029

10301030
for ( QList<QgsPointXY>::const_iterator it = mCaptureList.constBegin(); it != mCaptureList.constEnd(); ++it )
10311031
{
@@ -1043,11 +1043,11 @@ void QgsGpsInformationWidget::mBtnCloseFeature_clicked()
10431043
}
10441044
else if ( layerWKBType == QgsWkbTypes::Polygon )
10451045
{
1046-
int size = 1 + 3 * sizeof( int ) + 2 * ( mCaptureList.size() + 1 ) * sizeof( double );
1046+
int size = 1 + 3 * static_cast< int >( sizeof( int ) ) + 2 * ( mCaptureList.size() + 1 ) * static_cast< int >( sizeof( double ) );
10471047
unsigned char *buf = new unsigned char[size];
10481048

10491049
QgsWkbPtr wkbPtr( buf, size );
1050-
wkbPtr << ( char ) QgsApplication::endian() << QgsWkbTypes::Polygon << 1 << mCaptureList.size() + 1;
1050+
wkbPtr << static_cast< char >( QgsApplication::endian() ) << QgsWkbTypes::Polygon << 1 << mCaptureList.size() + 1;
10511051

10521052
QList<QgsPointXY>::iterator it;
10531053
for ( it = mCaptureList.begin(); it != mCaptureList.end(); ++it )

0 commit comments

Comments
 (0)