we can not cast an "int *" pointer to a "bool *" and assign a bool
to it in hope to update the integer pointed by the "int *" with
1 or 0 according to the assigned boolean. because, the existing
value pointed by the "int *" pointer could be any value, if it's
non-zero, say, 0x12345678, after casting to "bool *", and assigning it
to "false", the variable would be 0x12345600. only the least
significant 8 bits are reset. so after resetting the variable pointed
by the "int *" pointer after reset it using "bool *", it still "true"!
Introduced-by: 1f85545
Signed-off-by: Kefu Chai <kchai@redhat.com>
{
tracepoint(librados, rados_ioctx_pool_requires_alignment_enter2, io);
librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
+ bool requires_alignment;
int retval = ctx->client->pool_requires_alignment2(ctx->get_id(),
- (bool *)requires);
+ &requires_alignment);
tracepoint(librados, rados_ioctx_pool_requires_alignment_exit2, retval,
- *requires);
+ requires_alignment);
+ if (requires)
+ *requires = requires_alignment;
return retval;
}