Skip to content
Permalink
Browse files

use Qt types

  • Loading branch information
jef-n committed Jun 10, 2016
1 parent 607b1df commit ef0f3d5b8c16c7392e6b6e706270b295b3e022fb
Showing with 5 additions and 5 deletions.
  1. +2 −2 src/providers/postgres/qgspostgresprovider.cpp
  2. +3 −3 src/providers/postgres/qgspostgresprovider.h
@@ -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 );
}

0 comments on commit ef0f3d5

Please sign in to comment.
You can’t perform that action at this time.