mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 17:56:13 -04:00
Fix build on Linux, including cpplint warnings.
This commit is contained in:
parent
a84c04aada
commit
9a07f3918d
@ -13,6 +13,7 @@
|
|||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <SQLiteCpp/Exception.h>
|
#include <SQLiteCpp/Exception.h>
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <SQLiteCpp/Column.h>
|
#include <SQLiteCpp/Column.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
namespace SQLite
|
namespace SQLite
|
||||||
@ -82,7 +83,6 @@ std::string Column::getString() const noexcept // nothrow
|
|||||||
// - no need for sqlite3_column_text to add a \0 on the end, as we're getting the bytes length directly
|
// - no need for sqlite3_column_text to add a \0 on the end, as we're getting the bytes length directly
|
||||||
const char *data = static_cast<const char *>(sqlite3_column_blob(mStmtPtr, mIndex));
|
const char *data = static_cast<const char *>(sqlite3_column_blob(mStmtPtr, mIndex));
|
||||||
|
|
||||||
// Note: C++ order of argument evaluation is unspecified, so not calling _blob and _bytes both directly in std::string constructor
|
|
||||||
// SQLite docs: "The safest policy is to invoke… sqlite3_column_blob() followed by sqlite3_column_bytes()"
|
// SQLite docs: "The safest policy is to invoke… sqlite3_column_blob() followed by sqlite3_column_bytes()"
|
||||||
// Note: std::string is ok to pass nullptr as first arg, if length is 0
|
// Note: std::string is ok to pass nullptr as first arg, if length is 0
|
||||||
return std::string(data, sqlite3_column_bytes(mStmtPtr, mIndex));
|
return std::string(data, sqlite3_column_bytes(mStmtPtr, mIndex));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user