summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-07-03 14:44:30 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-07-03 14:44:30 +1000
commit796e20daea750bf562f193eea1b00a5d192e2580 (patch)
treea476899056a6edb4ae31a4a69258650c1331aca0 /api
parent049575ca2de59b5e1b71e210894a64c54ca00eb7 (diff)
downloadmongo-796e20daea750bf562f193eea1b00a5d192e2580.tar.gz
Fix a bad cast, switch from reinterpret_cast to static_cast in an attempt to avoid this kind of thing in the future.
Diffstat (limited to 'api')
-rw-r--r--api/leveldb/leveldb_wt.h2
-rw-r--r--api/leveldb/rocks_wt.cc8
2 files changed, 5 insertions, 5 deletions
diff --git a/api/leveldb/leveldb_wt.h b/api/leveldb/leveldb_wt.h
index f4b36302272..c51ea9719a0 100644
--- a/api/leveldb/leveldb_wt.h
+++ b/api/leveldb/leveldb_wt.h
@@ -361,7 +361,7 @@ public:
ColumnFamilyHandle* column_family);
ColumnFamilyHandleImpl *GetCF(uint32_t id) {
- return (id < columns_.size()) ? reinterpret_cast<ColumnFamilyHandleImpl *>(columns_[id]) : NULL;
+ return (id < columns_.size()) ? static_cast<ColumnFamilyHandleImpl *>(columns_[id]) : NULL;
}
void SetColumns(std::vector<ColumnFamilyHandle *> &cols) {
columns_ = cols;
diff --git a/api/leveldb/rocks_wt.cc b/api/leveldb/rocks_wt.cc
index aae8b57b7ba..0a3d5b93a9a 100644
--- a/api/leveldb/rocks_wt.cc
+++ b/api/leveldb/rocks_wt.cc
@@ -49,7 +49,7 @@ static int
wtrocks_get_cursor(OperationContext *context, ColumnFamilyHandle *cfhp, WT_CURSOR **cursorp)
{
ColumnFamilyHandleImpl *cf =
- reinterpret_cast<ColumnFamilyHandleImpl *>(cfhp);
+ static_cast<ColumnFamilyHandleImpl *>(cfhp);
if (cf == NULL) {
fprintf(stderr, "Missing column!\n");
assert(0);
@@ -79,7 +79,7 @@ DB::ListColumnFamilies(
Status status = DB::Open(options, name, &dbptr);
if (!status.ok())
return status;
- DbImpl *db = reinterpret_cast<DbImpl *>(dbptr);
+ DbImpl *db = static_cast<DbImpl *>(dbptr);
OperationContext *context = db->GetContext();
WT_SESSION *session = context->GetSession();
WT_CURSOR *c;
@@ -121,7 +121,7 @@ DB::Open(Options const &options, std::string const &name, const std::vector<Colu
Status status = Open(options, name, dbptr);
if (!status.ok())
return status;
- DbImpl *db = reinterpret_cast<DbImpl *>(dbptr);
+ DbImpl *db = static_cast<DbImpl *>(*dbptr);
std::vector<ColumnFamilyHandle*> cfhandles(
column_families.size());
for (size_t i = 0; i < column_families.size(); i++) {
@@ -202,7 +202,7 @@ Status
DbImpl::DropColumnFamily(ColumnFamilyHandle *cfhp)
{
ColumnFamilyHandleImpl *cf =
- reinterpret_cast<ColumnFamilyHandleImpl *>(cfhp);
+ static_cast<ColumnFamilyHandleImpl *>(cfhp);
WT_SESSION *session = GetContext()->GetSession();
int ret = session->drop(session, cf->GetURI().c_str(), NULL);
return WiredTigerErrorToStatus(ret);