Skip to content

Commit 3e7302f

Browse files
committed
s3select:clang-tidying of s3select_oper.h
... and some undoing of formatting changes Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
1 parent 86a344a commit 3e7302f

File tree

4 files changed

+117
-113
lines changed

4 files changed

+117
-113
lines changed

include/s3select.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include <boost/bind.hpp>
1616
#include <functional>
1717

18-
using namespace std::string_literals;
19-
2018
#define _DEBUG_TERM {string token(a,b);std::cout << __FUNCTION__ << token << std::endl;}
2119

2220

@@ -732,23 +730,23 @@ void push_compare_operator::operator()(s3select* self, const char* a, const char
732730
std::string token(a, b);
733731
arithmetic_operand::cmp_t c;
734732

735-
if (token =="=="s)
733+
if (token =="==")
736734
{
737735
c = arithmetic_operand::cmp_t::EQ;
738736
}
739-
else if (token =="!="s)
737+
else if (token =="!=")
740738
{
741739
c = arithmetic_operand::cmp_t::NE;
742740
}
743-
else if (token ==">="s)
741+
else if (token ==">=")
744742
{
745743
c = arithmetic_operand::cmp_t::GE;
746744
}
747-
else if (token == "<="s)
745+
else if (token == "<=")
748746
{
749747
c = arithmetic_operand::cmp_t::LE;
750748
}
751-
else if (token == ">"s)
749+
else if (token == ">")
752750
{
753751
c = arithmetic_operand::cmp_t::GT;
754752
}
@@ -840,7 +838,7 @@ void push_negation::operator()(s3select* self, const char* a, const char* b) con
840838
//upon NOT operator, the logical and arithmetical operators are "tagged" to negate result.
841839
if (dynamic_cast<logical_operand*>(pred))
842840
{
843-
logical_operand* f = S3SELECT_NEW(self, logical_operand, pred); // todo: marked as "empty statemant"
841+
logical_operand* f = S3SELECT_NEW(self, logical_operand, pred);
844842
self->getAction()->condQ.push_back(f);
845843
}
846844
else if (dynamic_cast<__function*>(pred) || dynamic_cast<negate_function_operation*>(pred))

include/s3select_functions.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ struct _fn_avg : public base_function
349349
return true;
350350
}
351351

352-
void get_aggregate_result(variable *result) override
352+
void get_aggregate_result(variable *result) override
353353
{
354354
if(count == 0) {
355355
throw base_s3select_exception("count cannot be zero!");
@@ -381,7 +381,7 @@ struct _fn_min : public base_function
381381
return true;
382382
}
383383

384-
void get_aggregate_result(variable* result) override
384+
void get_aggregate_result(variable* result) override
385385
{
386386
*result = min;
387387
}
@@ -411,7 +411,7 @@ struct _fn_max : public base_function
411411
return true;
412412
}
413413

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

442-
if (*perr != '\0') {
443-
throw base_s3select_exception("characters after int!");
444-
return false;
442+
if (*perr != '\0') {
443+
throw base_s3select_exception("characters after int!");
444+
return false;
445+
}
445446
}
446-
}
447447
else if (func_arg.type == value::value_En_t::FLOAT)
448448
{
449449
i = func_arg.dbl();
@@ -488,8 +488,8 @@ struct _fn_to_float : public base_function
488488
}
489489

490490
var_result = d;
491-
break;
492491
}
492+
break;
493493

494494
case value::value_En_t::FLOAT:
495495
var_result = v.dbl();

0 commit comments

Comments
 (0)