From: Danny Al-Gaaf Date: Tue, 12 Mar 2013 09:01:07 +0000 (+0100) Subject: rgw/rgw_rados.cc: use static_cast instead of C-Style cast X-Git-Tag: v0.60~96^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6becc6b58030befe862c6e20840e04c59865762;p=ceph.git rgw/rgw_rados.cc: use static_cast instead of C-Style cast Signed-off-by: Danny Al-Gaaf --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index ad5485ffe5ae..c0a9e3daad77 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -420,7 +420,7 @@ int RGWRados::log_list_init(const string& prefix, RGWAccessHandle *handle) int RGWRados::log_list_next(RGWAccessHandle handle, string *name) { - log_list_state *state = (log_list_state *)handle; + log_list_state *state = static_cast(handle); while (true) { if (state->obit == state->io_ctx.objects_end()) { delete state; @@ -474,7 +474,7 @@ int RGWRados::log_show_init(const string& name, RGWAccessHandle *handle) int RGWRados::log_show_next(RGWAccessHandle handle, rgw_log_entry *entry) { - log_show_state *state = (log_show_state *)handle; + log_show_state *state = static_cast(handle); off_t off = state->p.get_off(); ldout(cct, 10) << "log_show_next pos " << state->pos << " bl " << state->bl.length() @@ -1048,13 +1048,12 @@ int RGWRados::put_obj_meta(void *ctx, rgw_obj& obj, uint64_t size, std::string oid, key; get_obj_bucket_and_oid_key(obj, bucket, oid, key); librados::IoCtx io_ctx; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); int r = open_bucket_ctx(bucket, io_ctx); if (r < 0) return r; - io_ctx.locator_set_key(key); ObjectWriteOperation op; @@ -1291,7 +1290,7 @@ int RGWRados::copy_obj(void *ctx, RGWObjManifest manifest; RGWObjState *astate = NULL; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); ret = get_obj_state(rctx, src_obj, &astate); if (ret < 0) return ret; @@ -1680,7 +1679,7 @@ int RGWRados::bucket_rebuild_index(rgw_bucket& bucket) int RGWRados::defer_gc(void *ctx, rgw_obj& obj) { - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); rgw_bucket bucket; std::string oid, key; get_obj_bucket_and_oid_key(obj, bucket, oid, key); @@ -1723,7 +1722,7 @@ int RGWRados::delete_obj_impl(void *ctx, rgw_obj& obj) std::string oid, key; get_obj_bucket_and_oid_key(obj, bucket, oid, key); librados::IoCtx io_ctx; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); int r = open_bucket_ctx(bucket, io_ctx); if (r < 0) return r; @@ -1907,7 +1906,7 @@ int RGWRados::get_attr(void *ctx, rgw_obj& obj, const char *name, bufferlist& de librados::IoCtx io_ctx; rgw_bucket actual_bucket = bucket; string actual_obj = oid; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); if (actual_obj.size() == 0) { actual_obj = bucket.name; @@ -2093,7 +2092,7 @@ int RGWRados::set_attr(void *ctx, rgw_obj& obj, const char *name, bufferlist& bl librados::IoCtx io_ctx; rgw_bucket actual_bucket = bucket; string actual_obj = oid; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); if (actual_obj.size() == 0) { actual_obj = bucket.name; @@ -2142,7 +2141,7 @@ int RGWRados::set_attrs(void *ctx, rgw_obj& obj, get_obj_bucket_and_oid_key(obj, bucket, oid, key); librados::IoCtx io_ctx; string actual_obj = oid; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); rgw_bucket actual_bucket = bucket; if (actual_obj.size() == 0) { @@ -2242,7 +2241,7 @@ int RGWRados::prepare_get_obj(void *ctx, rgw_obj& obj, int r = -EINVAL; bufferlist etag; time_t ctime; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); RGWRadosCtx *new_ctx = NULL; RGWObjState *astate = NULL; off_t ofs = 0; @@ -2442,7 +2441,7 @@ int RGWRados::clone_objs_impl(void *ctx, rgw_obj& dst_obj, std::string dst_oid, dst_key; get_obj_bucket_and_oid_key(dst_obj, bucket, dst_oid, dst_key); librados::IoCtx io_ctx; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); uint64_t size = 0; string etag; string content_type; @@ -2581,7 +2580,7 @@ int RGWRados::get_obj(void *ctx, void **handle, rgw_obj& obj, rgw_obj read_obj = obj; uint64_t read_ofs = ofs; uint64_t len, read_len; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); RGWRadosCtx *new_ctx = NULL; bool reading_from_head = true; ObjectReadOperation op; @@ -2928,7 +2927,7 @@ int RGWRados::get_obj_iterate_cb(void *ctx, RGWObjState *astate, off_t read_ofs, off_t len, bool is_head_obj, void *arg) { - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); ObjectReadOperation op; struct get_obj_data *d = (struct get_obj_data *)arg; @@ -3041,7 +3040,7 @@ int RGWRados::iterate_obj(void *ctx, rgw_obj& obj, rgw_obj read_obj = obj; uint64_t read_ofs = ofs; uint64_t len; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); RGWRadosCtx *new_ctx = NULL; bool reading_from_head = true; RGWObjState *astate = NULL; @@ -3119,7 +3118,7 @@ int RGWRados::read(void *ctx, rgw_obj& obj, off_t ofs, size_t size, bufferlist& std::string oid, key; get_obj_bucket_and_oid_key(obj, bucket, oid, key); librados::IoCtx io_ctx; - RGWRadosCtx *rctx = (RGWRadosCtx *)ctx; + RGWRadosCtx *rctx = static_cast(ctx); RGWObjState *astate = NULL; int r = open_bucket_ctx(bucket, io_ctx); if (r < 0)