Skip to content

Commit

Permalink
use Qt types
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 10, 2016
1 parent 607b1df commit ef0f3d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -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 );
}
Expand Down
6 changes: 3 additions & 3 deletions src/providers/postgres/qgspostgresprovider.h
Expand Up @@ -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 );
}
Expand Down

0 comments on commit ef0f3d5

Please sign in to comment.