summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-03-06 07:02:40 +0000
committerarseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640>2012-03-06 07:02:40 +0000
commiteea13e4d72af4fb83a3d6c4671ae29d1c4305c49 (patch)
tree24e176cbcda212b6c4b15fd3a189ee9f3f33c4be
parenteaac540dd208601921ed2ca33448003a697ff557 (diff)
Fix 'cast increases required alignment of target type' warning for BlackBerry NDK in PUGIXML_WCHAR_MODE (wchar_t is 4 bytes)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@842 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--src/pugixml.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index ab18c74..bc76b0b 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -348,7 +348,9 @@ namespace
assert(full_size < (1 << 16) || (page->busy_size == full_size && page_offset == 0));
header->full_size = static_cast<uint16_t>(full_size < (1 << 16) ? full_size : 0);
- return reinterpret_cast<char_t*>(header + 1);
+ // round-trip through void* to avoid 'cast increases required alignment of target type' warning
+ // header is guaranteed a pointer-sized alignment, which should be enough for char_t
+ return static_cast<char_t*>(static_cast<void*>(header + 1));
}
void deallocate_string(char_t* string)