mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
use Qt types
This commit is contained in:
parent
607b1df4dc
commit
ef0f3d5b8c
@ -42,12 +42,12 @@
|
||||
const QString POSTGRES_KEY = "postgres";
|
||||
const QString POSTGRES_DESCRIPTION = "PostgreSQL/PostGIS data provider";
|
||||
|
||||
inline int64_t PKINT2FID( int32_t x )
|
||||
inline qint64 PKINT2FID( qint32 x )
|
||||
{
|
||||
return QgsPostgresUtils::int32pk_to_fid( x );
|
||||
}
|
||||
|
||||
inline int32_t FID2PKINT( int64_t x )
|
||||
inline qint32 FID2PKINT( qint64 x )
|
||||
{
|
||||
return QgsPostgresUtils::fid_to_int32pk( x );
|
||||
}
|
||||
|
@ -514,17 +514,17 @@ class QgsPostgresUtils
|
||||
|
||||
static QString andWhereClauses( const QString& c1, const QString& c2 );
|
||||
|
||||
static const int64_t int32pk_offset = 4294967296;
|
||||
static const qint64 int32pk_offset = 4294967296;
|
||||
|
||||
// We shift negative 32bit integers to above the max 32bit
|
||||
// positive integer to support the whole range of int32 values
|
||||
// See http://hub.qgis.org/issues/14262
|
||||
static int64_t int32pk_to_fid( int32_t x )
|
||||
static qint64 int32pk_to_fid( qint32 x )
|
||||
{
|
||||
return x >= 0 ? x : x + int32pk_offset;
|
||||
}
|
||||
|
||||
static int32_t fid_to_int32pk( int64_t x )
|
||||
static qint32 fid_to_int32pk( qint64 x )
|
||||
{
|
||||
return x <= (( int32pk_offset ) / 2.0 ) ? x : -( int32pk_offset - x );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user