Commit f3fab8cd authored by Christian Rober's avatar Christian Rober Committed by Yoni Fogel

refs #5086 adding function declarations for compilation errors on clang, added...

refs #5086 adding function declarations for compilation errors on clang, added macro usage to prevent clang from being too strict about POD.

git-svn-id: file:///svn/toku/tokudb@47173 c7de825b-a66e-492c-adef-691d508d4ae1
parent 43023505
......@@ -19,7 +19,8 @@ void frwlock::init(toku_mutex_t *const mutex) {
m_num_expensive_want_write = 0;
toku_cond_init(&m_wait_read, nullptr);
m_queue_item_read = { .cond = &m_wait_read, .next = nullptr };
m_queue_item_read.cond = &m_wait_read;
m_queue_item_read.next = nullptr;
m_wait_read_is_in_queue = false;
m_current_writer_expensive = false;
m_read_wait_expensive = false;
......
......@@ -78,7 +78,7 @@ class frwlock {
queue_item *m_wait_tail;
};
static_assert(std::is_pod<frwlock>::value, "not pod");
ENSURE_POD(frwlock);
} // namespace toku
......
......@@ -3789,8 +3789,8 @@ struct store_fifo_offset_extra {
int i;
};
__attribute__((nonnull(3)))
static int store_fifo_offset(const int32_t &offset, const uint32_t UU(idx), struct store_fifo_offset_extra *const extra)
int store_fifo_offset(const int32_t &offset, const uint32_t UU(idx), struct store_fifo_offset_extra *const extra) __attribute__((nonnull(3)));
int store_fifo_offset(const int32_t &offset, const uint32_t UU(idx), struct store_fifo_offset_extra *const extra)
{
extra->offsets[extra->i] = offset;
extra->i++;
......@@ -3802,8 +3802,8 @@ static int store_fifo_offset(const int32_t &offset, const uint32_t UU(idx), stru
* figure out the MSN of each message, and compare those MSNs. Returns 1,
* 0, or -1 if a is larger than, equal to, or smaller than b.
*/
static int
fifo_offset_msn_cmp(FIFO &fifo, const int32_t &ao, const int32_t &bo)
int fifo_offset_msn_cmp(FIFO &fifo, const int32_t &ao, const int32_t &bo);
int fifo_offset_msn_cmp(FIFO &fifo, const int32_t &ao, const int32_t &bo)
{
const struct fifo_entry *a = toku_fifo_get_entry(fifo, ao);
const struct fifo_entry *b = toku_fifo_get_entry(fifo, bo);
......@@ -3868,8 +3868,8 @@ struct iterate_do_bn_apply_cmd_extra {
STAT64INFO stats_to_update;
};
__attribute__((nonnull(3)))
static int iterate_do_bn_apply_cmd(const int32_t &offset, const uint32_t UU(idx), struct iterate_do_bn_apply_cmd_extra *const e)
int iterate_do_bn_apply_cmd(const int32_t &offset, const uint32_t UU(idx), struct iterate_do_bn_apply_cmd_extra *const e) __attribute__((nonnull(3)));
int iterate_do_bn_apply_cmd(const int32_t &offset, const uint32_t UU(idx), struct iterate_do_bn_apply_cmd_extra *const e)
{
NONLEAF_CHILDINFO bnc = BNC(e->ancestor, e->childnum);
struct fifo_entry *entry = toku_fifo_get_entry(bnc->buffer, offset);
......@@ -4225,8 +4225,8 @@ struct copy_to_stale_extra {
NONLEAF_CHILDINFO bnc;
};
__attribute__((nonnull(3)))
static int copy_to_stale(const int32_t &offset, const uint32_t UU(idx), struct copy_to_stale_extra *const extra)
int copy_to_stale(const int32_t &offset, const uint32_t UU(idx), struct copy_to_stale_extra *const extra) __attribute__((nonnull(3)));
int copy_to_stale(const int32_t &offset, const uint32_t UU(idx), struct copy_to_stale_extra *const extra)
{
struct fifo_entry *entry = toku_fifo_get_entry(extra->bnc->buffer, offset);
DBT keydbt;
......
......@@ -128,8 +128,8 @@ struct verify_message_tree_extra {
bool messages_have_been_moved;
};
__attribute__((nonnull(3)))
static int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e)
int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e) __attribute__((nonnull(3)));
int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e)
{
int verbose = e->verbose;
BLOCKNUM blocknum = e->blocknum;
......@@ -156,12 +156,13 @@ static int verify_message_tree(const int32_t &offset, const uint32_t UU(idx), st
return result;
}
static int error_on_iter(const int32_t &UU(offset), const uint32_t UU(idx), void *UU(e)) {
int error_on_iter(const int32_t &UU(offset), const uint32_t UU(idx), void *UU(e));
int error_on_iter(const int32_t &UU(offset), const uint32_t UU(idx), void *UU(e)) {
return TOKUDB_NEEDS_REPAIR;
}
__attribute__((nonnull(3)))
static int verify_marked_messages(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e)
int verify_marked_messages(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e) __attribute__((nonnull(3)));
int verify_marked_messages(const int32_t &offset, const uint32_t UU(idx), struct verify_message_tree_extra *const e)
{
int verbose = e->verbose;
BLOCKNUM blocknum = e->blocknum;
......
......@@ -579,7 +579,7 @@ class omt {
typedef uint32_t node_idx;
typedef omt_internal::subtree_templated<supports_marks> subtree;
typedef omt_internal::omt_node_templated<omtdata_t, supports_marks> omt_node;
static_assert(std::is_pod<subtree>::value, "not POD");
ENSURE_POD(subtree);
struct omt_array {
uint32_t start_idx;
......
......@@ -59,7 +59,7 @@
//typedef struct value *OMTVALUE; // A slight improvement over using void*.
#include "omt-tmpl.h"
typedef void *OMTVALUE;
typedef struct toku::omt<OMTVALUE> *OMT;
typedef toku::omt<OMTVALUE> *OMT;
int toku_omt_create (OMT *omtp);
......
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