Commit 34c6f2a8 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5206 fix usage of <type_traits> on clang, fix omt::split_at return value


git-svn-id: file:///svn/toku/tokudb@45963 c7de825b-a66e-492c-adef-691d508d4ae1
parent 14857271
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <errno.h> #include <errno.h>
#include <db.h> #include <db.h>
#if defined(__ICL) || defined(__ICC) #if defined(__ICL) || defined(__ICC) || defined(__clang__)
# define static_assert(foo, bar) // nothing # define static_assert(foo, bar) // nothing
#else #else
# include <type_traits> # include <type_traits>
...@@ -69,7 +69,7 @@ struct omt { ...@@ -69,7 +69,7 @@ struct omt {
* *
*/ */
__attribute__((nonnull)) __attribute__((nonnull))
void split_at(omt *const newomt, const uint32_t idx) { int split_at(omt *const newomt, const uint32_t idx) {
invariant_notnull(newomt); invariant_notnull(newomt);
if (idx > this->size()) { return EINVAL; } if (idx > this->size()) { return EINVAL; }
this->convert_to_array(); this->convert_to_array();
...@@ -77,6 +77,7 @@ struct omt { ...@@ -77,6 +77,7 @@ struct omt {
newomt->create_from_sorted_array(&this->d.a.values[this->d.a.start_idx + idx], newsize); newomt->create_from_sorted_array(&this->d.a.values[this->d.a.start_idx + idx], newsize);
this->d.a.num_values = idx; this->d.a.num_values = idx;
this->maybe_resize_array(); this->maybe_resize_array();
return 0;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment