From 168ae6f7e2e87d3050c39bbb03148924751370a3 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 24 May 2009 21:09:00 +0000 Subject: (svn r16422) -Codechange: use const_cast for removing const and warn when const is (accidentally?) removed using C-style casts. --- src/misc/blob.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/misc/blob.hpp') 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(&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(&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);} }; -- cgit v1.2.3-70-g09d2