summaryrefslogtreecommitdiff
path: root/src/misc
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-24 21:09:00 +0000
committerrubidium <rubidium@openttd.org>2009-05-24 21:09:00 +0000
commit168ae6f7e2e87d3050c39bbb03148924751370a3 (patch)
treef231a8b93fcf344d126a8d3aa3ded9803200ca67 /src/misc
parent0d99b6c71cd096599b4805d230483f3e4e958af1 (diff)
downloadopenttd-168ae6f7e2e87d3050c39bbb03148924751370a3.tar.xz
(svn r16422) -Codechange: use const_cast for removing const and warn when const is (accidentally?) removed using C-style casts.
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/blob.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/misc/blob.hpp b/src/misc/blob.hpp
index 56e10a7cf..cdda12bd3 100644
--- a/src/misc/blob.hpp
+++ b/src/misc/blob.hpp
@@ -82,7 +82,7 @@ public:
{
assert(pHdr_1 != NULL);
ptr_u.m_pHdr_1 = pHdr_1;
- *(CHdr**)&pHdr_1 = NULL;
+ *const_cast<CHdr**>(&pHdr_1) = NULL;
}
/** destructor */
@@ -330,7 +330,7 @@ public:
struct OnTransfer {
typename Tbase_::CHdr *m_pHdr_1;
- OnTransfer(const OnTransfer& src) : m_pHdr_1(src.m_pHdr_1) {assert(src.m_pHdr_1 != NULL); *(typename Tbase_::CHdr**)&src.m_pHdr_1 = NULL;}
+ OnTransfer(const OnTransfer& src) : m_pHdr_1(src.m_pHdr_1) {assert(src.m_pHdr_1 != NULL); *const_cast<typename Tbase_::CHdr**>(&src.m_pHdr_1) = NULL;}
OnTransfer(CBlobT& src) : m_pHdr_1(src.ptr_u.m_pHdr_1) {src.InitEmpty();}
~OnTransfer() {assert(m_pHdr_1 == NULL);}
};