Unverified Commit 7a5c4f44 authored by Dennis Jenkins's avatar Dennis Jenkins Committed by GitHub

Merge pull request #325 from oktal/dennisjenkins75-warning-redux

Compiler warning reduction
parents 089b71b2 ea24b955
...@@ -115,19 +115,19 @@ private: ...@@ -115,19 +115,19 @@ private:
} }
void retrieveAllAccounts(const Rest::Request& req, Http::ResponseWriter response) { void retrieveAllAccounts(const Rest::Request&, Http::ResponseWriter response) {
response.send(Http::Code::Ok, "No Account"); response.send(Http::Code::Ok, "No Account");
} }
void retrieveAccount(const Rest::Request& req, Http::ResponseWriter response) { void retrieveAccount(const Rest::Request&, Http::ResponseWriter response) {
response.send(Http::Code::Ok, "The bank is closed, come back later"); response.send(Http::Code::Ok, "The bank is closed, come back later");
} }
void createAccount(const Rest::Request& req, Http::ResponseWriter response) { void createAccount(const Rest::Request&, Http::ResponseWriter response) {
response.send(Http::Code::Ok, "The bank is closed, come back later"); response.send(Http::Code::Ok, "The bank is closed, come back later");
} }
void creditAccount(const Rest::Request& req, Http::ResponseWriter response) { void creditAccount(const Rest::Request&, Http::ResponseWriter response) {
response.send(Http::Code::Ok, "The bank is closed, come back later"); response.send(Http::Code::Ok, "The bank is closed, come back later");
} }
......
...@@ -171,6 +171,9 @@ namespace Async { ...@@ -171,6 +171,9 @@ namespace Async {
struct Core { struct Core {
Core(State _state, TypeId _id) Core(State _state, TypeId _id)
: state(_state) : state(_state)
, exc()
, mtx()
, requests()
, id(_id) , id(_id)
{ } { }
...@@ -217,6 +220,7 @@ namespace Async { ...@@ -217,6 +220,7 @@ namespace Async {
struct CoreT : public Core { struct CoreT : public Core {
CoreT() CoreT()
: Core(State::Pending, TypeId::of<T>()) : Core(State::Pending, TypeId::of<T>())
, storage()
{ } { }
template<class Other> template<class Other>
......
...@@ -165,8 +165,21 @@ public: ...@@ -165,8 +165,21 @@ public:
PROTOTYPE_OF(Aio::Handler, Transport) PROTOTYPE_OF(Aio::Handler, Transport)
Transport() {} Transport()
Transport(const Transport &rhs) { UNUSED(rhs); } : requestsQueue()
, connectionsQueue()
, connections()
, requests()
, timeouts()
{ }
Transport(const Transport &)
: requestsQueue()
, connectionsQueue()
, connections()
, requests()
, timeouts()
{ }
typedef std::function<void()> OnResponseParsed; typedef std::function<void()> OnResponseParsed;
...@@ -284,6 +297,7 @@ public: ...@@ -284,6 +297,7 @@ public:
private: private:
RequestBuilder(Client* const client) RequestBuilder(Client* const client)
: client_(client) : client_(client)
, request_()
, timeout_(std::chrono::milliseconds(0)) , timeout_(std::chrono::milliseconds(0))
{ } { }
......
...@@ -103,6 +103,10 @@ template<typename DT> struct DataTypeValidation { ...@@ -103,6 +103,10 @@ template<typename DT> struct DataTypeValidation {
} // namespace Traits } // namespace Traits
struct ProduceConsume { struct ProduceConsume {
ProduceConsume()
: produce()
, consume()
{ }
std::vector<Http::Mime::MediaType> produce; std::vector<Http::Mime::MediaType> produce;
std::vector<Http::Mime::MediaType> consume; std::vector<Http::Mime::MediaType> consume;
...@@ -152,6 +156,8 @@ struct DataType { ...@@ -152,6 +156,8 @@ struct DataType {
virtual const char* format() const = 0; virtual const char* format() const = 0;
virtual bool validate(const std::string& input) const = 0; virtual bool validate(const std::string& input) const = 0;
virtual ~DataType() {}
}; };
template<typename T> template<typename T>
...@@ -160,6 +166,8 @@ struct DataTypeT : public DataType { ...@@ -160,6 +166,8 @@ struct DataTypeT : public DataType {
const char* format() const { return Traits::DataTypeInfo<T>::format(); } const char* format() const { return Traits::DataTypeInfo<T>::format(); }
bool validate(const std::string& input) const { return Traits::DataTypeValidation<T>::validate(input); } bool validate(const std::string& input) const { return Traits::DataTypeValidation<T>::validate(input); }
virtual ~DataTypeT() {}
}; };
template<typename T> template<typename T>
...@@ -255,6 +263,10 @@ public: ...@@ -255,6 +263,10 @@ public:
bool hasPath(const std::string& name, Http::Method method) const; bool hasPath(const std::string& name, Http::Method method) const;
bool hasPath(const Path& path) const; bool hasPath(const Path& path) const;
PathGroup()
: groups_()
{ }
Group paths(const std::string& name) const; Group paths(const std::string& name) const;
Optional<Path> path(const std::string& name, Http::Method method) const; Optional<Path> path(const std::string& name, Http::Method method) const;
...@@ -437,6 +449,10 @@ class Swagger { ...@@ -437,6 +449,10 @@ class Swagger {
public: public:
Swagger(const Description& description) Swagger(const Description& description)
: description_(description) : description_(description)
, uiPath_()
, uiDirectory_()
, apiPath_()
, serializer_()
{ } { }
typedef std::function<std::string (const Description&)> Serializer; typedef std::function<std::string (const Description&)> Serializer;
......
...@@ -174,6 +174,8 @@ public: ...@@ -174,6 +174,8 @@ public:
}; };
Queue() Queue()
: head()
, tail(nullptr)
{ {
auto *sentinel = new Entry; auto *sentinel = new Entry;
sentinel->next = nullptr; sentinel->next = nullptr;
......
...@@ -235,6 +235,12 @@ public: ...@@ -235,6 +235,12 @@ public:
Route::Status route(const Http::Request& request, Http::ResponseWriter response); Route::Status route(const Http::Request& request, Http::ResponseWriter response);
Router()
: routes()
, customHandlers()
, notFoundHandler()
{ }
private: private:
void addRoute(Http::Method method, const std::string& resource, void addRoute(Http::Method method, const std::string& resource,
......
...@@ -84,6 +84,8 @@ public: ...@@ -84,6 +84,8 @@ public:
static size_t maxSize; static size_t maxSize;
ArrayStreamBuf() ArrayStreamBuf()
: StreamBuf<CharT>()
, bytes()
{ {
bytes.clear(); bytes.clear();
Base::setg(bytes.data(), bytes.data(), bytes.data() + bytes.size()); Base::setg(bytes.data(), bytes.data(), bytes.data() + bytes.size());
......
...@@ -42,12 +42,14 @@ public: ...@@ -42,12 +42,14 @@ public:
, size_(size) , size_(size)
{ } { }
explicit ViewBase(const T* begin, const T* end) { explicit ViewBase(const T* begin, const T* end)
: begin_(begin)
, size_(0)
{
if (begin > end) { if (begin > end) {
throw std::invalid_argument("begin > end"); throw std::invalid_argument("begin > end");
} }
begin_ = begin;
size_ = std::distance(begin, end); size_ = std::distance(begin, end);
} }
......
...@@ -225,7 +225,7 @@ CookieJar::add(const Cookie& cookie) { ...@@ -225,7 +225,7 @@ CookieJar::add(const Cookie& cookie) {
} }
void // Unimplemented void // Unimplemented
CookieJar::removeCookie(const std::string& name) { CookieJar::removeCookie(const std::string& /*name*/) {
// Empty for now, can be used later // Empty for now, can be used later
} }
......
...@@ -45,6 +45,9 @@ Info::Info( ...@@ -45,6 +45,9 @@ Info::Info(
: title(std::move(title)) : title(std::move(title))
, version(std::move(version)) , version(std::move(version))
, description(std::move(description)) , description(std::move(description))
, termsOfService()
, contact()
, license()
{ } { }
PathDecl::PathDecl( PathDecl::PathDecl(
...@@ -59,6 +62,10 @@ Path::Path( ...@@ -59,6 +62,10 @@ Path::Path(
, method(method) , method(method)
, description(std::move(description)) , description(std::move(description))
, hidden(false) , hidden(false)
, pc()
, parameters()
, responses()
, handler()
{ } { }
std::string std::string
...@@ -191,6 +198,7 @@ PathBuilder::PathBuilder(Path* path) ...@@ -191,6 +198,7 @@ PathBuilder::PathBuilder(Path* path)
SubPath::SubPath( SubPath::SubPath(
std::string prefix, PathGroup* paths) std::string prefix, PathGroup* paths)
: prefix(std::move(prefix)) : prefix(std::move(prefix))
, parameters()
, paths(paths) , paths(paths)
{ } { }
...@@ -220,6 +228,7 @@ Parameter::Parameter( ...@@ -220,6 +228,7 @@ Parameter::Parameter(
: name(std::move(name)) : name(std::move(name))
, description(std::move(description)) , description(std::move(description))
, required(true) , required(true)
, type()
{ } { }
Response::Response( Response::Response(
...@@ -260,6 +269,11 @@ InfoBuilder::license(std::string name, std::string url) { ...@@ -260,6 +269,11 @@ InfoBuilder::license(std::string name, std::string url) {
Description::Description( Description::Description(
std::string title, std::string version, std::string description) std::string title, std::string version, std::string description)
: info_(std::move(title), std::move(version), std::move(description)) : info_(std::move(title), std::move(version), std::move(description))
, host_()
, basePath_()
, schemes_()
, pc()
, paths_()
{ {
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment