If there is a failure to read the file like unexpected EOF, bad returns
false, but fail returns true. Important for reading number of items more
than the file actually has.
But do not initialize. If the meta information is invalid and has a big
value, initialization will take significant amount of time but there
might be no actual data in the file because it's too small.
Make sure sqlite3_column_double is not called for int64_t and other
integral types and sqlite3_column_int64 is not called for floating point
types.
[363/1189] Building CXX object components\CMakeFiles\components.dir\RelWithDebInfo\detournavigator\navmeshdb.cpp.obj
D:\dev\openmw\components/sqlite3/request.hpp(109): warning C4244: 'argument': conversion from 'double' to 'T', possible loss of data
with
[
T=int64_t
]
D:\dev\openmw\components/sqlite3/request.hpp(109): note: the template instantiation context (the oldest one first) is
D:\dev\openmw\components\detournavigator\navmeshdb.cpp(198): note: see reference to function template instantiation 'I Sqlite3::request<DetourNavigator::DbQueries::GetMaxTileId,DetourNavigator::TileId*,>(sqlite3 &,Sqlite3::Statement<DetourNavigator::DbQueries::GetMaxTileId> &,I,size_t)' being compiled
with
[
I=DetourNavigator::TileId *
]
D:\dev\openmw\components/sqlite3/request.hpp(262): note: see reference to function template instantiation 'void Sqlite3::getRow<DetourNavigator::TileId>(sqlite3 &,sqlite3_stmt &,T &)' being compiled
with
[
T=DetourNavigator::TileId
]
D:\dev\openmw\components/sqlite3/request.hpp(210): note: see reference to function template instantiation 'void Sqlite3::getColumns<std::tuple<T &>>(sqlite3 &,sqlite3_stmt &,std::tuple<T &> &)' being compiled
with
[
T=DetourNavigator::TileId
]
D:\dev\openmw\components/sqlite3/request.hpp(203): note: see reference to function template instantiation 'void Sqlite3::getColumnsImpl<1,T>(sqlite3 &,sqlite3_stmt &,T &)' being compiled
with
[
T=std::tuple<DetourNavigator::TileId &>
]
D:\dev\openmw\components/sqlite3/request.hpp(190): note: see reference to function template instantiation 'void Sqlite3::copyColumn<T>(sqlite3 &,sqlite3_stmt &,int,int,T &)' being compiled
with
[
T=DetourNavigator::TileId
]
I can't see any reason for this to have been necessary in CI in the first place as we do CI runs for commits on a branch, not for a detached head.
Despite that, I've left it in the Linux and Android scripts as we don't suggest anyone runs those on their own machines.