summaryrefslogtreecommitdiff
path: root/example/tutorial/tutorial.cpp
diff options
context:
space:
mode:
authorMilo Yip <miloyip@gmail.com>2015-12-18 18:34:04 +0800
committerMilo Yip <miloyip@gmail.com>2015-12-18 18:34:04 +0800
commit74c8dcfd5791c4f11e6d52fdc15047b0622dd8af (patch)
treeff220aa18d5401b67bb06de63860e55a676f8a73 /example/tutorial/tutorial.cpp
parentf36af30531bc1cfa4f26d798ba1ef668812b8fd0 (diff)
downloadrapidjson-74c8dcfd5791c4f11e6d52fdc15047b0622dd8af.tar.gz
rapidjson-74c8dcfd5791c4f11e6d52fdc15047b0622dd8af.zip
Fix clang -Weverything
Diffstat (limited to 'example/tutorial/tutorial.cpp')
-rw-r--r--example/tutorial/tutorial.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/example/tutorial/tutorial.cpp b/example/tutorial/tutorial.cpp
index 206fdb9..354057a 100644
--- a/example/tutorial/tutorial.cpp
+++ b/example/tutorial/tutorial.cpp
@@ -121,17 +121,17 @@ int main(int, char*[]) {
// This version of SetString() needs an allocator, which means it will allocate a new buffer and copy the the string into the buffer.
Value author;
{
- char buffer[10];
- int len = sprintf(buffer, "%s %s", "Milo", "Yip"); // synthetic example of dynamically created string.
+ char buffer2[10];
+ int len = sprintf(buffer2, "%s %s", "Milo", "Yip"); // synthetic example of dynamically created string.
- author.SetString(buffer, static_cast<size_t>(len), document.GetAllocator());
+ author.SetString(buffer2, static_cast<SizeType>(len), document.GetAllocator());
// Shorter but slower version:
// document["hello"].SetString(buffer, document.GetAllocator());
// Constructor version:
// Value author(buffer, len, document.GetAllocator());
// Value author(buffer, document.GetAllocator());
- memset(buffer, 0, sizeof(buffer)); // For demonstration purpose.
+ memset(buffer2, 0, sizeof(buffer2)); // For demonstration purpose.
}
// Variable 'buffer' is unusable now but 'author' has already made a copy.
document.AddMember("author", author, document.GetAllocator());