Skip to content

Commit

Permalink
s3select:clang-tidying of s3select_oper.h
Browse files Browse the repository at this point in the history
... and some undoing of formatting changes

(and rebasing...)

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
  • Loading branch information
ronen-fr committed Dec 31, 2020
1 parent 62320d6 commit 9b6c158
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 69 deletions.
3 changes: 1 addition & 2 deletions include/s3select.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <boost/bind.hpp>
#include <functional>

using namespace std::string_literals;

#define _DEBUG_TERM {string token(a,b);std::cout << __FUNCTION__ << token << std::endl;}

Expand Down Expand Up @@ -932,7 +931,7 @@ void push_negation::builder(s3select* self, const char* a, const char* b) const
//upon NOT operator, the logical and arithmetical operators are "tagged" to negate result.
if (dynamic_cast<logical_operand*>(pred))
{
logical_operand* f = S3SELECT_NEW(self, logical_operand, pred); // todo: marked as "empty statemant"
logical_operand* f = S3SELECT_NEW(self, logical_operand, pred);
self->getAction()->condQ.push_back(f);
}
else if (dynamic_cast<__function*>(pred) || dynamic_cast<negate_function_operation*>(pred))
Expand Down
9 changes: 3 additions & 6 deletions include/s3select_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <regex>
using namespace std::string_literals;


using namespace std::string_literals;

Expand Down Expand Up @@ -452,7 +450,7 @@ struct _fn_to_int : public base_function
throw base_s3select_exception("characters after int!");
return false;
}
}
}
else if (func_arg.type == value::value_En_t::FLOAT)
{
i = func_arg.dbl();
Expand All @@ -476,7 +474,6 @@ struct _fn_to_float : public base_function

bool operator()(bs_stmt_vec_t* args, variable* result) override
{
char* perr;
value v = (*args->begin())->eval();

switch (v.type) {
Expand All @@ -497,8 +494,8 @@ struct _fn_to_float : public base_function
}

var_result = d;
break;
}
break;

case value::value_En_t::FLOAT:
var_result = v.dbl();
Expand Down Expand Up @@ -595,7 +592,7 @@ struct _fn_to_timestamp : public base_function

bsc::parse_info<> info_dig = bsc::parse(v_str.str(), d_yyyymmdd_dig >> *(separator) >> d_time_dig);

if(!datetime_validation() or !info_dig.full)
if(!datetime_validation() || !info_dig.full)
{
throw base_s3select_exception("input date-time is illegal");
}
Expand Down

0 comments on commit 9b6c158

Please sign in to comment.