Browse Source

Fixed warnings

yhirose 8 years ago
parent
commit
e58cfe8168
3 changed files with 6 additions and 6 deletions
  1. 1 1
      example/benchmark.cc
  2. 1 1
      example/hello.cc
  3. 4 4
      example/server.cc

+ 1 - 1
example/benchmark.cc

@@ -18,7 +18,7 @@ struct StopWatch {
   chrono::system_clock::time_point start_;
 };
 
-int main(int argc, char* argv[]) {
+int main(void) {
   string body(1024 * 5, 'a');
 
   httplib::Client cli("httpbin.org", 80);

+ 1 - 1
example/hello.cc

@@ -12,7 +12,7 @@ int main(void)
 {
     Server svr;
 
-    svr.get("/hi", [](const auto& req, auto& res) {
+    svr.get("/hi", [](const auto& /*req*/, auto& res) {
         res.set_content("Hello World!", "text/plain");
     });
 

+ 4 - 4
example/server.cc

@@ -72,11 +72,11 @@ int main(void)
     Server svr;
 #endif
 
-    svr.get("/", [=](const auto& req, auto& res) {
+    svr.get("/", [=](const auto& /*req*/, auto& res) {
         res.set_redirect("/hi");
     });
 
-    svr.get("/hi", [](const auto& req, auto& res) {
+    svr.get("/hi", [](const auto& /*req*/, auto& res) {
         res.set_content("Hello World!", "text/plain");
     });
 
@@ -84,11 +84,11 @@ int main(void)
         res.set_content(dump_headers(req.headers), "text/plain");
     });
 
-    svr.get("/stop", [&](const auto& req, auto& res) {
+    svr.get("/stop", [&](const auto& /*req*/, auto& /*res*/) {
         svr.stop();
     });
 
-    svr.set_error_handler([](const auto& req, auto& res) {
+    svr.set_error_handler([](const auto& /*req*/, auto& res) {
         const char* fmt = "<p>Error Status: <span style='color:red;'>%d</span></p>";
         char buf[BUFSIZ];
         snprintf(buf, sizeof(buf), fmt, res.status);