Fixed Issue 46: old style cast to 'void*' casts away const in document.h
git-svn-id: https://rapidjson.googlecode.com/svn/trunk@88 c5894555-1306-4e8d-425f-1f6f381ee07c
This commit is contained in:
parent
d419c0ae5a
commit
90f983ced2
@ -64,7 +64,7 @@ solution "test"
|
|||||||
defines { "_CRT_SECURE_NO_WARNINGS" }
|
defines { "_CRT_SECURE_NO_WARNINGS" }
|
||||||
|
|
||||||
configuration "gmake"
|
configuration "gmake"
|
||||||
buildoptions "-msse4.2"
|
buildoptions "-msse4.2 -Werror=cast-qual"
|
||||||
|
|
||||||
project "gtest"
|
project "gtest"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
|
@ -152,7 +152,7 @@ public:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kCopyStringFlag:
|
case kCopyStringFlag:
|
||||||
Allocator::Free((void*)data_.s.str);
|
Allocator::Free(const_cast<Ch*>(data_.s.str));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -670,8 +670,8 @@ private:
|
|||||||
flags_ = kCopyStringFlag;
|
flags_ = kCopyStringFlag;
|
||||||
data_.s.str = (Ch *)allocator.Malloc((length + 1) * sizeof(Ch));
|
data_.s.str = (Ch *)allocator.Malloc((length + 1) * sizeof(Ch));
|
||||||
data_.s.length = length;
|
data_.s.length = length;
|
||||||
memcpy((void*)data_.s.str, s, length * sizeof(Ch));
|
memcpy(const_cast<Ch*>(data_.s.str), s, length * sizeof(Ch));
|
||||||
((Ch*)data_.s.str)[length] = '\0';
|
const_cast<Ch*>(data_.s.str)[length] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Assignment without calling destructor
|
//! Assignment without calling destructor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user