diff --git a/drogon_ctl/create_model.cc b/drogon_ctl/create_model.cc index 5827f93039..5b12d505c3 100644 --- a/drogon_ctl/create_model.cc +++ b/drogon_ctl/create_model.cc @@ -637,10 +637,9 @@ void create_model::createModelClassFromSqlite3( data["primaryKeyType"] = pkTypes; } data["columns"] = cols; - std::ofstream headerFile(path + "/" + className + ".h", - std::ofstream::out); + std::ofstream headerFile(path + "/" + className + ".h", std::ofstream::out); std::ofstream sourceFile(path + "/" + className + ".cc", - std::ofstream::out); + std::ofstream::out); auto templ = DrTemplateBase::newTemplate("model_h.csp"); headerFile << templ->genText(data); templ = DrTemplateBase::newTemplate("model_cc.csp"); diff --git a/lib/src/HttpRequestImpl.cc b/lib/src/HttpRequestImpl.cc index fe71416c45..9b79131cf0 100644 --- a/lib/src/HttpRequestImpl.cc +++ b/lib/src/HttpRequestImpl.cc @@ -314,10 +314,11 @@ void HttpRequestImpl::appendToBuffer(trantor::MsgBuffer *output) const if (!passThrough_ && (!content.empty() || !content_.empty())) { char buf[64]; - auto len = snprintf(buf, - sizeof(buf), - contentLengthFormatString(), - content.length() + content_.length()); + auto len = + snprintf(buf, + sizeof(buf), + contentLengthFormatString(), + content.length() + content_.length()); output->append(buf, len); if (contentTypeString_.empty()) { diff --git a/lib/src/HttpResponseImpl.cc b/lib/src/HttpResponseImpl.cc index abd8a17240..09bb49b60e 100644 --- a/lib/src/HttpResponseImpl.cc +++ b/lib/src/HttpResponseImpl.cc @@ -30,7 +30,6 @@ using namespace drogon; namespace drogon { - // "Fri, 23 Aug 2019 12:58:03 GMT" length = 29 static const size_t httpFullDateStringLength = 29; static inline void doResponseCreateAdvices( @@ -284,10 +283,11 @@ void HttpResponseImpl::makeHeaderString(trantor::MsgBuffer &buffer) LOG_SYSERR << sendfileName_ << " stat error"; return; } - len = snprintf(buffer.beginWrite(), - buffer.writableBytes(), - contentLengthFormatString(), - filestat.st_size); + len = snprintf( + buffer.beginWrite(), + buffer.writableBytes(), + contentLengthFormatString(), + filestat.st_size); } buffer.hasWritten(len); if (headers_.find("Connection") == headers_.end()) diff --git a/orm_lib/inc/drogon/orm/Result.h b/orm_lib/inc/drogon/orm/Result.h index b686380470..628d384911 100644 --- a/orm_lib/inc/drogon/orm/Result.h +++ b/orm_lib/inc/drogon/orm/Result.h @@ -124,6 +124,10 @@ class Result */ unsigned long long insertId() const noexcept; +#ifdef _MSC_VER + Result() = default; +#endif + private: ResultImplPtr resultPtr_; @@ -142,14 +146,6 @@ class Result const char *getValue(SizeType row, RowSizeType column) const; bool isNull(SizeType row, RowSizeType column) const; FieldSizeType getLength(SizeType row, RowSizeType column) const; -#ifdef _MSC_VER - public: -#else - protected: -#endif - Result() - { - } }; inline void swap(Result &one, Result &two) noexcept { diff --git a/orm_lib/src/ResultImpl.h b/orm_lib/src/ResultImpl.h index 7018bfabf9..42508e91c3 100644 --- a/orm_lib/src/ResultImpl.h +++ b/orm_lib/src/ResultImpl.h @@ -20,10 +20,13 @@ namespace drogon { namespace orm { -class ResultImpl : public trantor::NonCopyable, public Result +class ResultImpl : public trantor::NonCopyable { public: ResultImpl() = default; + using SizeType = Result::SizeType; + using RowSizeType = Result::RowSizeType; + using FieldSizeType = Result::FieldSizeType; virtual SizeType size() const noexcept = 0; virtual RowSizeType columns() const noexcept = 0; virtual const char *columnName(RowSizeType Number) const = 0;