Skip to content

Commit 0e392f5

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 0e392f5

File tree

4 files changed

+79
-80
lines changed

4 files changed

+79
-80
lines changed

include/s3select.h

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

18-
using namespace std::string_literals;
1918

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

@@ -732,23 +731,23 @@ void push_compare_operator::operator()(s3select* self, const char* a, const char
732731
std::string token(a, b);
733732
arithmetic_operand::cmp_t c;
734733

735-
if (token =="=="s)
734+
if (token =="==")
736735
{
737736
c = arithmetic_operand::cmp_t::EQ;
738737
}
739-
else if (token =="!="s)
738+
else if (token =="!=")
740739
{
741740
c = arithmetic_operand::cmp_t::NE;
742741
}
743-
else if (token ==">="s)
742+
else if (token ==">=")
744743
{
745744
c = arithmetic_operand::cmp_t::GE;
746745
}
747-
else if (token == "<="s)
746+
else if (token == "<=")
748747
{
749748
c = arithmetic_operand::cmp_t::LE;
750749
}
751-
else if (token == ">"s)
750+
else if (token == ">")
752751
{
753752
c = arithmetic_operand::cmp_t::GT;
754753
}
@@ -840,7 +839,7 @@ void push_negation::operator()(s3select* self, const char* a, const char* b) con
840839
//upon NOT operator, the logical and arithmetical operators are "tagged" to negate result.
841840
if (dynamic_cast<logical_operand*>(pred))
842841
{
843-
logical_operand* f = S3SELECT_NEW(self, logical_operand, pred); // todo: marked as "empty statemant"
842+
logical_operand* f = S3SELECT_NEW(self, logical_operand, pred);
844843
self->getAction()->condQ.push_back(f);
845844
}
846845
else if (dynamic_cast<__function*>(pred) || dynamic_cast<negate_function_operation*>(pred))

include/s3select_functions.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <regex>
88
using namespace std::string_literals;
99

10-
1110
#define BOOST_BIND_ACTION_PARAM( push_name ,param ) boost::bind( &push_name::operator(), g_ ## push_name , _1 ,_2, param)
1211
namespace s3selectEngine
1312
{
@@ -349,7 +348,7 @@ struct _fn_avg : public base_function
349348
return true;
350349
}
351350

352-
void get_aggregate_result(variable *result) override
351+
void get_aggregate_result(variable *result) override
353352
{
354353
if(count == 0) {
355354
throw base_s3select_exception("count cannot be zero!");
@@ -381,7 +380,7 @@ struct _fn_min : public base_function
381380
return true;
382381
}
383382

384-
void get_aggregate_result(variable* result) override
383+
void get_aggregate_result(variable* result) override
385384
{
386385
*result = min;
387386
}
@@ -411,7 +410,7 @@ struct _fn_max : public base_function
411410
return true;
412411
}
413412

414-
void get_aggregate_result(variable* result) override
413+
void get_aggregate_result(variable* result) override
415414
{
416415
*result = max;
417416
}
@@ -437,13 +436,13 @@ struct _fn_to_int : public base_function
437436
if ((errno == ERANGE && (i == LONG_MAX || i == LONG_MIN)) || (errno != 0 && i == 0)) {
438437
throw base_s3select_exception("converted value would fall out of the range of the result type!");
439438
return false;
440-
}
439+
}
441440

442-
if (*perr != '\0') {
443-
throw base_s3select_exception("characters after int!");
444-
return false;
441+
if (*perr != '\0') {
442+
throw base_s3select_exception("characters after int!");
443+
return false;
444+
}
445445
}
446-
}
447446
else if (func_arg.type == value::value_En_t::FLOAT)
448447
{
449448
i = func_arg.dbl();
@@ -488,8 +487,8 @@ struct _fn_to_float : public base_function
488487
}
489488

490489
var_result = d;
491-
break;
492490
}
491+
break;
493492

494493
case value::value_En_t::FLOAT:
495494
var_result = v.dbl();
@@ -586,7 +585,7 @@ struct _fn_to_timestamp : public base_function
586585

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

589-
if(!datetime_validation() or !info_dig.full)
588+
if(!datetime_validation() || !info_dig.full)
590589
{
591590
throw base_s3select_exception("input date-time is illegal");
592591
}

0 commit comments

Comments
 (0)