diff --git a/src/blockstore_write.cpp b/src/blockstore_write.cpp index ddfefea4..61a9a0a0 100644 --- a/src/blockstore_write.cpp +++ b/src/blockstore_write.cpp @@ -21,7 +21,7 @@ bool blockstore_impl_t::enqueue_write(blockstore_op_t *op) dyn = calloc_or_die(1, dyn_size+sizeof(int)); *((int*)dyn) = 1; } - uint8_t *dyn_ptr = (uint8_t*)(alloc_dyn_data ? dyn+sizeof(int) : &dyn); + uint8_t *dyn_ptr = (alloc_dyn_data ? (uint8_t*)dyn+sizeof(int) : (uint8_t*)&dyn); uint64_t version = 1; if (dirty_db.size() > 0) { diff --git a/src/cluster_client.cpp b/src/cluster_client.cpp index b098aa78..f70baefa 100644 --- a/src/cluster_client.cpp +++ b/src/cluster_client.cpp @@ -64,7 +64,7 @@ cluster_client_t::cluster_client_t(ring_loop_t *ringloop, timerfd_manager_t *tfd cluster_client_t::~cluster_client_t() { - msgr.repeer_pgs = [this](osd_num_t){}; + msgr.repeer_pgs = [](osd_num_t){}; if (ringloop) { ringloop->unregister_consumer(&consumer); @@ -454,7 +454,7 @@ bool cluster_client_t::flush() wb->start_writebacks(this, 0); cluster_op_t *sync = new cluster_op_t; sync->opcode = OSD_OP_SYNC; - sync->callback = [this](cluster_op_t *sync) + sync->callback = [](cluster_op_t *sync) { delete sync; }; @@ -465,7 +465,7 @@ bool cluster_client_t::flush() bool sync_done = false; cluster_op_t *sync = new cluster_op_t; sync->opcode = OSD_OP_SYNC; - sync->callback = [this, &sync_done](cluster_op_t *sync) + sync->callback = [&sync_done](cluster_op_t *sync) { delete sync; sync_done = true; diff --git a/src/cluster_client_wb.cpp b/src/cluster_client_wb.cpp index 66d4a457..997c67b1 100644 --- a/src/cluster_client_wb.cpp +++ b/src/cluster_client_wb.cpp @@ -263,7 +263,7 @@ void writeback_cache_t::flush_buffers(cluster_client_t *cli, dirty_buf_it_t from } assert(calc_len == op->len); writebacks_active++; - op->callback = [this, cli, flush_id](cluster_op_t* op) + op->callback = [this, flush_id](cluster_op_t* op) { // Buffer flushes should be always retried, regardless of the error, // so they should never result in an error here @@ -383,7 +383,7 @@ static void copy_to_op(cluster_op_t *op, uint64_t offset, uint8_t *buf, uint64_t auto begin = (cur_offset < offset ? offset : cur_offset); auto end = (cur_offset+v.iov_len > offset+len ? offset+len : cur_offset+v.iov_len); memcpy( - v.iov_base + begin - cur_offset, + (uint8_t*)v.iov_base + begin - cur_offset, buf + (cur_offset <= offset ? 0 : cur_offset-offset), end - begin );