Skip to content

Commit 342b2b8

Browse files
committed
s3select:clang-tidying of s3select_oper.h
... and some undoing of formatting changes (and rebasing...) Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
1 parent 62320d6 commit 342b2b8

File tree

4 files changed

+70
-74
lines changed

4 files changed

+70
-74
lines changed

include/s3select.h

Lines changed: 1 addition & 2 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

@@ -932,7 +931,7 @@ void push_negation::builder(s3select* self, const char* a, const char* b) const
932931
//upon NOT operator, the logical and arithmetical operators are "tagged" to negate result.
933932
if (dynamic_cast<logical_operand*>(pred))
934933
{
935-
logical_operand* f = S3SELECT_NEW(self, logical_operand, pred); // todo: marked as "empty statemant"
934+
logical_operand* f = S3SELECT_NEW(self, logical_operand, pred);
936935
self->getAction()->condQ.push_back(f);
937936
}
938937
else if (dynamic_cast<__function*>(pred) || dynamic_cast<negate_function_operation*>(pred))

include/s3select_functions.h

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

11-
12-
using namespace std::string_literals;
13-
1411
#define BOOST_BIND_ACTION_PARAM( push_name ,param ) boost::bind( &push_name::operator(), g_ ## push_name , _1 ,_2, param)
1512
namespace s3selectEngine
1613
{
@@ -446,13 +443,13 @@ struct _fn_to_int : public base_function
446443
if ((errno == ERANGE && (i == LONG_MAX || i == LONG_MIN)) || (errno != 0 && i == 0)) {
447444
throw base_s3select_exception("converted value would fall out of the range of the result type!");
448445
return false;
449-
}
446+
}
450447

451-
if (*perr != '\0') {
452-
throw base_s3select_exception("characters after int!");
453-
return false;
448+
if (*perr != '\0') {
449+
throw base_s3select_exception("characters after int!");
450+
return false;
451+
}
454452
}
455-
}
456453
else if (func_arg.type == value::value_En_t::FLOAT)
457454
{
458455
i = func_arg.dbl();
@@ -476,7 +473,6 @@ struct _fn_to_float : public base_function
476473

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

482478
switch (v.type) {
@@ -497,8 +493,8 @@ struct _fn_to_float : public base_function
497493
}
498494

499495
var_result = d;
500-
break;
501496
}
497+
break;
502498

503499
case value::value_En_t::FLOAT:
504500
var_result = v.dbl();
@@ -595,7 +591,7 @@ struct _fn_to_timestamp : public base_function
595591

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

598-
if(!datetime_validation() or !info_dig.full)
594+
if(!datetime_validation() || !info_dig.full)
599595
{
600596
throw base_s3select_exception("input date-time is illegal");
601597
}

0 commit comments

Comments
 (0)