Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Yip <miloyip@gmail.com>2014-06-25 15:21:17 +0400
committerMilo Yip <miloyip@gmail.com>2014-06-25 19:14:32 +0400
commit609381fc2e4f1d7f1145322f5ef4bb4101c7c736 (patch)
treef000e4b003fecf6292a7ff35ecb88af24145c737 /include/rapidjson/internal/stack.h
parentf930d9e2e5976d75f63f634981db2102c31c04b3 (diff)
Fixed some clang -Weverything warnings.
Diffstat (limited to 'include/rapidjson/internal/stack.h')
-rw-r--r--include/rapidjson/internal/stack.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/rapidjson/internal/stack.h b/include/rapidjson/internal/stack.h
index 6ed47e33..c1a8bedd 100644
--- a/include/rapidjson/internal/stack.h
+++ b/include/rapidjson/internal/stack.h
@@ -42,7 +42,7 @@ public:
stack_top_ = stack_ + size;
stack_end_ = stack_ + stack_capacity_;
}
- T* ret = (T*)stack_top_;
+ T* ret = reinterpret_cast<T*>(stack_top_);
stack_top_ += sizeof(T) * count;
return ret;
}
@@ -51,13 +51,13 @@ public:
T* Pop(size_t count) {
RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T));
stack_top_ -= count * sizeof(T);
- return (T*)stack_top_;
+ return reinterpret_cast<T*>(stack_top_);
}
template<typename T>
T* Top() {
RAPIDJSON_ASSERT(GetSize() >= sizeof(T));
- return (T*)(stack_top_ - sizeof(T));
+ return reinterpret_cast<T*>(stack_top_ - sizeof(T));
}
template<typename T>
@@ -65,7 +65,7 @@ public:
Allocator& GetAllocator() { return *allocator_; }
bool Empty() const { return stack_top_ == stack_; }
- size_t GetSize() const { return stack_top_ - stack_; }
+ size_t GetSize() const { return static_cast<size_t>(stack_top_ - stack_); }
size_t GetCapacity() const { return stack_capacity_; }
private: