Skip to content

Commit

Permalink
Remove warnings in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Nov 16, 2012
1 parent 5819603 commit 6bea993
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion example/condense/condense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion example/pretty/pretty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion example/prettyauto/prettyauto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/serialize/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Employee : public Person {
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));
Expand Down
5 changes: 4 additions & 1 deletion example/tutorial/tutorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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 = ");
Expand Down
2 changes: 1 addition & 1 deletion include/rapidjson/encodedstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class AutoUTFInputStream {
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; }
Expand Down

0 comments on commit 6bea993

Please sign in to comment.