1
0
mirror of synced 2025-04-20 11:47:43 +03:00

Fixed warnings

This commit is contained in:
yhirose 2017-12-05 17:28:52 -05:00
parent 4fb2f51766
commit e58cfe8168
3 changed files with 6 additions and 6 deletions

View File

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

View File

@ -12,7 +12,7 @@ int main(void)
{ {
Server svr; 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"); res.set_content("Hello World!", "text/plain");
}); });

View File

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