SET(CMAKE_BUILD_TYPE "DEBUG")
ENDIF(NOT CMAKE_BUILD_TYPE)
-SET(CMAKE_CXX_FLAGS_DEBUG "-g -std=c++1z -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
-SET(CMAKE_CXX_FLAGS_RELEASE "-g -std=c++1z -O2 -DNDEBUG")
+SET(CMAKE_CXX_FLAGS_DEBUG "-g -std=c++1z -O0 -ggdb -Wp,-U_FORTIFY_SOURCE -Wno-overloaded-virtual -Wno-class-memaccess")
+SET(CMAKE_CXX_FLAGS_RELEASE "-g -std=c++1z -O2 -DNDEBUG -Wno-overloaded-virtual -Wno-class-memaccess")
SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
{
// The current results are 'fresh' when not calculating a differential.
bool fresh_results = !calculate_diff;
- bool new_query = false;
if (!isQueryNameInDatabase()) {
// This is the first encounter of the scheduled query.
fresh_results = true;
<< name_;
} else if (isNewQuery()) {
// This query is 'new' in that the previous results may be invalid.
- new_query = true;
INFO(OSQUERY) << "Scheduled query has been updated: " + name_;
saveQuery(name_, query_);
}
// Use a 'target' avoid copying the query data when serializing and saving.
// If a differential is requested and needed the target remains the original
// query data, otherwise the content is moved to the differential's added set.
- const auto* target_gd = ¤t_qd;
- bool update_db = true;
if (!fresh_results && calculate_diff) {
// Get the rows from the last run of this query name.
QueryDataSet previous_qd;
// Calculate the differential between previous and current query results.
dr = diff(previous_qd, current_qd);
-
- update_db = (!dr.added.empty() || !dr.removed.empty());
} else {
dr.added = std::move(current_qd);
- target_gd = &dr.added;
}
return Status::success();
if (document.exist("colsUsed")) {
UsedColumns colsUsed;
Array array = document.get<Array>("colsUsed");
- for (auto i = 0; i < array.size(); i++) {
+ for (unsigned i = 0; i < array.size(); i++) {
std::string name = array.at(i);
colsUsed.insert(name);
}
}
Array constraints = document.get<Array>("constraints");
- for (auto i = 0; i < constraints.size(); i++) {
+ for (unsigned i = 0; i < constraints.size(); i++) {
auto constraint = Object::Create(constraints.at(i));
std::string name = constraint["name"];
context.constraints[name].deserialize(constraint);
{
using namespace vist::json;
Array list = obj.get<Array>("list");
- for (auto i = 0; i < list.size(); i++) {
+ for (unsigned i = 0; i < list.size(); i++) {
auto element = vist::json::Object::Create(list.at(i));
int op = element["op"];
Constraint constraint(static_cast<unsigned char>(op));
TEST(ArchiveTests, serializer_fundamental_nullptr)
{
- std::nullptr_t input;
+ std::nullptr_t input = nullptr;
Archive archive;
archive << input;
Archive archive;
archive.pack(input1, input2, input3, input4, input5);
- int output1;
- float output2;
- double output3;
+ int output1 = 0;
+ float output2 = 1.0;
+ double output3 = 2.0;
std::string raw;
std::string& output4 = raw;
std::shared_ptr<bool> output5;