forked from qt-creator/qt-creator
Sqlite: Make carray bind const
Carray is not changing the pointer so it is fine to use a const pointer. Change-Id: Iad89666b6f543496e39cfeff17e069feb2002ff5 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -185,11 +185,11 @@ void BaseStatement::bind(int index, void *pointer)
|
|||||||
checkForBindingError(resultCode);
|
checkForBindingError(resultCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseStatement::bind(int index, Utils::span<int> values)
|
void BaseStatement::bind(int index, Utils::span<const int> values)
|
||||||
{
|
{
|
||||||
int resultCode = sqlite3_carray_bind(m_compiledStatement.get(),
|
int resultCode = sqlite3_carray_bind(m_compiledStatement.get(),
|
||||||
index,
|
index,
|
||||||
values.data(),
|
const_cast<int *>(values.data()),
|
||||||
static_cast<int>(values.size()),
|
static_cast<int>(values.size()),
|
||||||
CARRAY_INT32,
|
CARRAY_INT32,
|
||||||
SQLITE_STATIC);
|
SQLITE_STATIC);
|
||||||
@@ -197,11 +197,11 @@ void BaseStatement::bind(int index, Utils::span<int> values)
|
|||||||
checkForBindingError(resultCode);
|
checkForBindingError(resultCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseStatement::bind(int index, Utils::span<long long> values)
|
void BaseStatement::bind(int index, Utils::span<const long long> values)
|
||||||
{
|
{
|
||||||
int resultCode = sqlite3_carray_bind(m_compiledStatement.get(),
|
int resultCode = sqlite3_carray_bind(m_compiledStatement.get(),
|
||||||
index,
|
index,
|
||||||
values.data(),
|
const_cast<long long *>(values.data()),
|
||||||
static_cast<int>(values.size()),
|
static_cast<int>(values.size()),
|
||||||
CARRAY_INT64,
|
CARRAY_INT64,
|
||||||
SQLITE_STATIC);
|
SQLITE_STATIC);
|
||||||
@@ -209,11 +209,11 @@ void BaseStatement::bind(int index, Utils::span<long long> values)
|
|||||||
checkForBindingError(resultCode);
|
checkForBindingError(resultCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseStatement::bind(int index, Utils::span<double> values)
|
void BaseStatement::bind(int index, Utils::span<const double> values)
|
||||||
{
|
{
|
||||||
int resultCode = sqlite3_carray_bind(m_compiledStatement.get(),
|
int resultCode = sqlite3_carray_bind(m_compiledStatement.get(),
|
||||||
index,
|
index,
|
||||||
values.data(),
|
const_cast<double *>(values.data()),
|
||||||
static_cast<int>(values.size()),
|
static_cast<int>(values.size()),
|
||||||
CARRAY_DOUBLE,
|
CARRAY_DOUBLE,
|
||||||
SQLITE_STATIC);
|
SQLITE_STATIC);
|
||||||
|
|||||||
@@ -87,9 +87,9 @@ public:
|
|||||||
void bind(int index, long long value);
|
void bind(int index, long long value);
|
||||||
void bind(int index, double value);
|
void bind(int index, double value);
|
||||||
void bind(int index, void *pointer);
|
void bind(int index, void *pointer);
|
||||||
void bind(int index, Utils::span<int> values);
|
void bind(int index, Utils::span<const int> values);
|
||||||
void bind(int index, Utils::span<long long> values);
|
void bind(int index, Utils::span<const long long> values);
|
||||||
void bind(int index, Utils::span<double> values);
|
void bind(int index, Utils::span<const double> values);
|
||||||
void bind(int index, Utils::span<const char *> values);
|
void bind(int index, Utils::span<const char *> values);
|
||||||
void bind(int index, Utils::SmallStringView value);
|
void bind(int index, Utils::SmallStringView value);
|
||||||
void bind(int index, const Value &value);
|
void bind(int index, const Value &value);
|
||||||
|
|||||||
Reference in New Issue
Block a user