Fix build on Linux, including cpplint warnings.

This commit is contained in:
Douglas Heriot 2016-06-26 01:58:01 +10:00 committed by Sébastien Rombauts
parent a84c04aada
commit 9a07f3918d
4 changed files with 12 additions and 11 deletions

View File

@ -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>

View File

@ -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));