diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-05 22:25:45 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-11 01:50:25 +0000 |
commit | d6268ea91c519a13e297931f0b5be8c17f56bcd6 (patch) | |
tree | 90170179db6acc55b4f6dc60ccbee95ad7d4d940 /src/sql/drivers/psql/qsql_psql.cpp | |
parent | 6b38d9fa77e4639021d504754b8a96088cbbe427 (diff) |
QtSql: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.
Change-Id: Ia0aac2f09e9245339951ffff13c94688f5b6ed76
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'src/sql/drivers/psql/qsql_psql.cpp')
-rw-r--r-- | src/sql/drivers/psql/qsql_psql.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 3aa2455ff0..5c67652cdb 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -448,7 +448,7 @@ QVariant QPSQLResult::data(int i) } case QVariant::ByteArray: { size_t len; - unsigned char *data = PQunescapeBytea((unsigned char*)val, &len); + unsigned char *data = PQunescapeBytea((const unsigned char*)val, &len); QByteArray ba((const char*)data, len); qPQfreemem(data); return QVariant(ba); @@ -1312,9 +1312,9 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const QByteArray ba(field.value().toByteArray()); size_t len; #if defined PG_VERSION_NUM && PG_VERSION_NUM-0 >= 80200 - unsigned char *data = PQescapeByteaConn(d->connection, (unsigned char*)ba.constData(), ba.size(), &len); + unsigned char *data = PQescapeByteaConn(d->connection, (const unsigned char*)ba.constData(), ba.size(), &len); #else - unsigned char *data = PQescapeBytea((unsigned char*)ba.constData(), ba.size(), &len); + unsigned char *data = PQescapeBytea((const unsigned char*)ba.constData(), ba.size(), &len); #endif r += QLatin1Char('\''); r += QLatin1String((const char*)data); |