Remove warnings in examples
git-svn-id: https://rapidjson.googlecode.com/svn/trunk@95 c5894555-1306-4e8d-425f-1f6f381ee07c
This commit is contained in:
parent
47d60859d0
commit
5136516293
@ -10,7 +10,7 @@
|
||||
|
||||
using namespace rapidjson;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int main(int, char*[]) {
|
||||
// Prepare JSON reader and input stream.
|
||||
Reader reader;
|
||||
char readBuffer[65536];
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
using namespace rapidjson;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int main(int, char*[]) {
|
||||
// Prepare reader and input stream.
|
||||
Reader reader;
|
||||
char readBuffer[65536];
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
using namespace rapidjson;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int main(int, char*[]) {
|
||||
#ifdef _WIN32
|
||||
// Prevent Windows converting between CR+LF and LF
|
||||
_setmode(_fileno(stdin), _O_BINARY); // NEW
|
||||
|
@ -108,7 +108,7 @@ private:
|
||||
std::vector<Dependent> dependents_;
|
||||
};
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int main(int, char*[]) {
|
||||
std::vector<Employee> employees;
|
||||
|
||||
employees.push_back(Employee("Milo YIP", 34, true));
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
using namespace rapidjson;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int main(int, char*[]) {
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// 1. Parse a JSON text string to a document.
|
||||
|
||||
@ -46,6 +46,7 @@ int main(int argc, char* argv[]) {
|
||||
assert(hello != 0);
|
||||
assert(hello->value.IsString());
|
||||
assert(strcmp("world", hello->value.GetString()) == 0);
|
||||
(void)hello;
|
||||
|
||||
assert(document["t"].IsBool()); // JSON true/false are bool. Can also uses more specific function IsTrue().
|
||||
printf("t = %s\n", document["t"].GetBool() ? "true" : "false");
|
||||
@ -73,6 +74,8 @@ int main(int argc, char* argv[]) {
|
||||
//int x = a[0].GetInt(); // Error: operator[ is ambiguous, as 0 also mean a null pointer of const char* type.
|
||||
int y = a[SizeType(0)].GetInt(); // Cast to SizeType will work.
|
||||
int z = a[0u].GetInt(); // This works too.
|
||||
(void)y;
|
||||
(void)z;
|
||||
|
||||
// Iterating array with iterators
|
||||
printf("a = ");
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
size_t Tell() const { return is_->Tell(); }
|
||||
|
||||
// Not implemented
|
||||
void Put(Ch c) { RAPIDJSON_ASSERT(false); }
|
||||
void Put(Ch) { RAPIDJSON_ASSERT(false); }
|
||||
void Flush() { RAPIDJSON_ASSERT(false); }
|
||||
Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
|
||||
size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user