Fix build under clang and some warnings

Build problems fixed:
- void* pointer arithmetic which is a GNU extension (works as byte*)
- "variable size object may not be initialized" which is OK under GCC
- nullptr_t related error in json11 (it lacks 'operator <' in clang)

Warnings fixed:
- empty nested struct initializer { 0 } replaced by {}
- removed several unused lambda captures
This commit is contained in:
Vitaliy Filippov
2022-01-16 00:02:54 +03:00
parent 8f64fc61e7
commit 7bdd92ca4f
34 changed files with 209 additions and 200 deletions
+3 -3
View File
@@ -331,8 +331,8 @@ void osd_t::exec_op(osd_op_t *cur_op)
void osd_t::reset_stats()
{
msgr.stats = { 0 };
prev_stats = { 0 };
msgr.stats = {};
prev_stats = {};
memset(recovery_stat_count, 0, sizeof(recovery_stat_count));
memset(recovery_stat_bytes, 0, sizeof(recovery_stat_bytes));
}
@@ -447,7 +447,7 @@ void osd_t::print_slow()
{
for (uint64_t i = 0; i < op->req.sec_stab.len; i += sizeof(obj_ver_id))
{
obj_ver_id *ov = (obj_ver_id*)(op->buf + i);
obj_ver_id *ov = (obj_ver_id*)((uint8_t*)op->buf + i);
bufprintf(i == 0 ? " %lx:%lx v%lu" : ", %lx:%lx v%lu", ov->oid.inode, ov->oid.stripe, ov->version);
}
}