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

Signed-off-by: Ronen Friedman <[email protected]>
  • Loading branch information
ronen-fr committed Dec 16, 2020
1 parent 86a344a commit 3e7302f
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 113 deletions.
14 changes: 6 additions & 8 deletions include/s3select.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +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 @@ -732,23 +730,23 @@ void push_compare_operator::operator()(s3select* self, const char* a, const char
std::string token(a, b);
arithmetic_operand::cmp_t c;

if (token =="=="s)
if (token =="==")
{
c = arithmetic_operand::cmp_t::EQ;
}
else if (token =="!="s)
else if (token =="!=")
{
c = arithmetic_operand::cmp_t::NE;
}
else if (token ==">="s)
else if (token ==">=")
{
c = arithmetic_operand::cmp_t::GE;
}
else if (token == "<="s)
else if (token == "<=")
{
c = arithmetic_operand::cmp_t::LE;
}
else if (token == ">"s)
else if (token == ">")
{
c = arithmetic_operand::cmp_t::GT;
}
Expand Down Expand Up @@ -840,7 +838,7 @@ void push_negation::operator()(s3select* self, const char* a, const char* b) con
//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
18 changes: 9 additions & 9 deletions include/s3select_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ struct _fn_avg : public base_function
return true;
}

void get_aggregate_result(variable *result) override
void get_aggregate_result(variable *result) override
{
if(count == 0) {
throw base_s3select_exception("count cannot be zero!");
Expand Down Expand Up @@ -381,7 +381,7 @@ struct _fn_min : public base_function
return true;
}

void get_aggregate_result(variable* result) override
void get_aggregate_result(variable* result) override
{
*result = min;
}
Expand Down Expand Up @@ -411,7 +411,7 @@ struct _fn_max : public base_function
return true;
}

void get_aggregate_result(variable* result) override
void get_aggregate_result(variable* result) override
{
*result = max;
}
Expand All @@ -437,13 +437,13 @@ struct _fn_to_int : public base_function
if ((errno == ERANGE && (i == LONG_MAX || i == LONG_MIN)) || (errno != 0 && i == 0)) {
throw base_s3select_exception("converted value would fall out of the range of the result type!");
return false;
}
}

if (*perr != '\0') {
throw base_s3select_exception("characters after int!");
return false;
if (*perr != '\0') {
throw base_s3select_exception("characters after int!");
return false;
}
}
}
else if (func_arg.type == value::value_En_t::FLOAT)
{
i = func_arg.dbl();
Expand Down Expand Up @@ -488,8 +488,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
Loading

0 comments on commit 3e7302f

Please sign in to comment.