8000 Merge branch 'devel' of https://github.com/arangodb/arangodb into bug… · arangodb/arangodb@25d1b0c · GitHub
[go: up one dir, main page]

Skip to content

Commit 25d1b0c

Browse files
committed
Merge branch 'devel' of https://github.com/arangodb/arangodb into bug-fix/fix-issue-4185
2 parents 0183813 + 7f86015 commit 25d1b0c

File tree

7 files changed

+41
-23
lines changed

7 files changed

+41
-23
lines changed

3rdParty/velocypack/include/velocypack/Builder.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,9 @@ class Builder {
340340
}
341341

342342
// Add a subvalue into an object from a Value:
343-
uint8_t* add(std::string const& attrName, Value const& sub) {
344-
return addInternal<Value>(attrName, sub);
345-
}
346-
uint8_t* add(char const* attrName, Value const& sub) {
347-
return addInternal<Value>(attrName, sub);
348-
}
349-
uint8_t* add(char const* attrName, size_t attrLength, Value const& sub) {
350-
return addInternal<Value>(attrName, attrLength, sub);
351-
}
343+
uint8_t* add(std::string const& attrName, Value const& sub);
344+
uint8_t* add(char const* attrName, Value const& sub);
345+
uint8_t* add(char const* attrName, size_t attrLength, Value const& sub);
352346

353347
// Add a subvalue into an object from a Slice:
354348
uint8_t* add(std::string const& attrName, Slice const& sub) {

3rdParty/velocypack/src/Builder.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ std::string Builder::toJson() const {
5151
Dumper::dump(slice(), &sink);
5252
return buffer;
5353
}
54+
55+
// Add a subvalue into an object from a Value:
56+
uint8_t* Builder::add(std::string const& attrName, Value const& sub) {
57+
return addInternal<Value>(attrName, sub);
58+
}
59+
uint8_t* Builder::add(char const* attrName, Value const& sub) {
60+
return addInternal<Value>(attrName, sub);
61+
}
62+
uint8_t* Builder::add(char const* attrName, size_t attrLength, Value const& sub) {
63+
return addInternal<Value>(attrName, attrLength, sub);
64+
}
5465

5566
void Builder::doActualSort(std::vector<SortEntry>& entries) {
5667
VELOCYPACK_ASSERT(entries.size() > 1);

arangod/Aql/tokens.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,8 @@ class Parser;
912912

913913
#define YY_EXTRA_TYPE arangodb::aql::Parser*
914914

915-
#define YY_USER_ACTION \
916-
yylloc->first_line = static_cast<int>(yylineno); \
915+
#define YY_USER_ACTION \
916+
yylloc->first_line = static_cast<int>(yylineno); \
917917
yylloc->first_column = static_cast<int>(yycolumn); \
918918
yylloc->last_column = static_cast<int>(yycolumn + yyleng - 1); \
919919
yycolumn += static_cast<int>(yyleng); \

arangod/Aql/tokens.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class Parser;
4040

4141
#define YY_EXTRA_TYPE arangodb::aql::Parser*
4242

43-
#define YY_USER_ACTION \
44-
yylloc->first_line = static_cast<int>(yylineno); \
43+
#define YY_USER_ACTION \
44+
yylloc->first_line = static_cast<int>(yylineno); \
4545
yylloc->first_column = static_cast<int>(yycolumn); \
4646
yylloc->last_column = static_cast<int& 8000 gt;(yycolumn + yyleng - 1); \
4747
yycolumn += static_cast<int>(yyleng); \

arangod/Cluster/ClusterComm.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,13 +1250,12 @@ void ClusterCommThread::abortRequestsToFailedServers() {
12501250
void ClusterCommThread::run() {
12511251
LOG_TOPIC(DEBUG, Logger::CLUSTER) << "starting ClusterComm thread";
12521252

1253-
std::chrono::steady_clock clock;
1254-
auto lastAbortCheck = clock.now();
1253+
auto lastAbortCheck = std::chrono::steady_clock::now();
12551254
while (!isStopping()) {
12561255
try {
1257-
if (clock.now() - lastAbortCheck > std::chrono::duration<double>(3.0)) {
1256+
if (std::chrono::steady_clock::now() - lastAbortCheck > std::chrono::duration<double>(3.0)) {
12581257
abortRequestsToFailedServers();
1259-
lastAbortCheck = clock.now();
1258+
lastAbortCheck = std::chrono::steady_clock::now();
12601259
}
12611260
_cc->communicator()->work_once();
12621261
_cc->communicator()->wait();

arangod/RocksDBEngine/RocksDBEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ Result RocksDBEngine::registerRecoveryHelper(
13441344
std::shared_ptr<RocksDBRecoveryHelper> helper) {
13451345
try {
13461346
_recoveryHelpers.emplace_back(helper);
1347-
} catch (std::bad_alloc const& ex) {
1347+
} catch (std::bad_alloc const&) {
13481348
return {TRI_ERROR_OUT_OF_MEMORY};
13491349
}
13501350

lib/Basics/NumberUtils.h

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,13 @@ inline T atoi_positive(char const* p, char const* e, bool& valid) noexcept {
198198
// false.
199199
// this function will not modify errno.
200200
template<typename T>
201-
inline T atoi(char const* p, char const* e, bool& valid) noexcept {
201+
inline typename std::enable_if<std::is_signed<T>::value, T>::type atoi(char const* p, char const* e, bool& valid) noexcept {
202202
if (TRI_UNLIKELY(p == e)) {
203203
valid = false;
204204
return T();
205205
}
206206

207207
if (*p == '-') {
208-
if (!std::is_signed<T>::value) {
209-
valid = false;
210-
return T();
211-
}
212208
return atoi_negative<T>(++p, e, valid);
213209
}
214210
if (TRI_UNLIKELY(*p == '+')) {
@@ -218,6 +214,24 @@ inline T atoi(char const* p, char const* e, bool& valid) noexcept {
218214
return atoi_positive<T>(p, e, valid);
219215
}
220216

217+
template<typename T>
218+
inline typename std::enable_if<std::is_unsigned<T>::value, T>::type atoi(char const* p, char const* e, bool& valid) noexcept {
219+
if (TRI_UNLIKELY(p == e)) {
220+
valid = false;
221+
return T();
222+
}
< 8A25 /td>
223+
224+
if (*p == '-') {
225+
valid = false;
226+
return T();
227+
}
228+
if (TRI_UNLIKELY(*p == '+')) {
229+
++p;
230+
}
231+
232+
return atoi_positive<T>(p, e, valid);
233+
}
234+
221235
// function to convert the string value between p
222236
// (inclusive) and e (exclusive) into a number value of type T
223237
//

0 commit comments

Comments
 (0)
0