mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
kushnertodd fix to issue #724 Remove warnings from Windows build
This commit is contained in:
parent
110e71f4f2
commit
6fca36c7b9
@ -53,7 +53,7 @@ std::vector<const char*>& ClassId::getClassNames() {
|
||||
v_int32 ClassId::registerClassName(const char* name) {
|
||||
std::lock_guard<std::mutex> lock(getClassMutex());
|
||||
getClassNames().push_back(name);
|
||||
return getClassNames().size() - 1;
|
||||
return (v_int32) getClassNames().size() - 1;
|
||||
}
|
||||
|
||||
ClassId::ClassId(const char* pName)
|
||||
@ -63,7 +63,7 @@ ClassId::ClassId(const char* pName)
|
||||
|
||||
int ClassId::getClassCount() {
|
||||
std::lock_guard<std::mutex> lock(getClassMutex());
|
||||
return getClassNames().size();
|
||||
return (int) getClassNames().size();
|
||||
}
|
||||
|
||||
std::vector<const char*> ClassId::getRegisteredClassNames() {
|
||||
|
@ -76,7 +76,7 @@ StringTemplate::StringTemplate(const oatpp::String& text, std::vector<Variable>&
|
||||
throw std::runtime_error("[oatpp::data::share::StringTemplate::StringTemplate()]: Error. The template variable can't have a negative size.");
|
||||
}
|
||||
|
||||
if(var.posEnd >= m_text->size()) {
|
||||
if((size_t) var.posEnd >= m_text->size()) {
|
||||
throw std::runtime_error("[oatpp::data::share::StringTemplate::StringTemplate()]: Error. The template variable can't out-bound the template text.");
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ void StringTemplate::format(stream::ConsistentOutputStream* stream, ValueProvide
|
||||
|
||||
}
|
||||
|
||||
if(prevPos < m_text->size()) {
|
||||
if((size_t) prevPos < m_text->size()) {
|
||||
stream->writeSimple(m_text->data() + prevPos, m_text->size() - prevPos);
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,9 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
_Pragma("warning(disable : 4996)")
|
||||
#endif
|
||||
#include "FileStream.hpp"
|
||||
|
||||
namespace oatpp { namespace data{ namespace stream {
|
||||
|
@ -143,7 +143,7 @@ void ConnectionMonitor::Monitor::monitorTask(std::shared_ptr<Monitor> monitor) {
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex>(monitor->m_runMutex);
|
||||
std::lock_guard<std::mutex> lock(monitor->m_runMutex);
|
||||
monitor->m_stopped = true;
|
||||
}
|
||||
|
||||
|
@ -188,9 +188,11 @@ oatpp::v_io_handle ConnectionProvider::instantiateServer(){
|
||||
|
||||
if (hints.ai_family == AF_UNSPEC || hints.ai_family == AF_INET6) {
|
||||
if (setsockopt(serverHandle, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&no, sizeof( int ) ) != 0 ) {
|
||||
const size_t buflen = 500;
|
||||
char buf[buflen];
|
||||
OATPP_LOGW("[oatpp::network::tcp::server::ConnectionProvider::instantiateServer()]",
|
||||
"Warning. Failed to set %s for accepting socket: %s", "IPV6_V6ONLY",
|
||||
strerror(errno));
|
||||
strerror_s(buf, buflen, errno));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ oatpp::String Utils::escapeString(const char* data, v_buff_size size, v_uint32 f
|
||||
}
|
||||
|
||||
if(size > safeSize){
|
||||
for(v_buff_size i = pos; i < result->size(); i ++){
|
||||
for(v_buff_size i = pos; (size_t) i < result->size(); i ++){
|
||||
resultData[i] = '?';
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,9 @@ std::shared_ptr<protocol::http::outgoing::Response> ErrorHandler::handleError(co
|
||||
|
||||
std::shared_ptr<protocol::http::outgoing::Response> response;
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
_Pragma("warning(disable : 4068 4996)")
|
||||
#endif
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
/* Default impl for backwards compatibility until the deprecated methods are removed */
|
||||
|
@ -92,7 +92,7 @@ class DtoD : public DtoA {
|
||||
|
||||
DTO_INIT(DtoD, DtoA)
|
||||
|
||||
DTO_FIELD(Int32, a) = Int64(64);
|
||||
DTO_FIELD(Int32, a) = Int32(64);
|
||||
|
||||
};
|
||||
|
||||
|
@ -22,6 +22,9 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
_Pragma("warning(disable : 4101)")
|
||||
#endif
|
||||
#include "ObjectWrapperTest.hpp"
|
||||
#include "oatpp/core/Types.hpp"
|
||||
|
||||
|
@ -22,6 +22,9 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32)
|
||||
_Pragma("warning(disable : 4101)")
|
||||
#endif
|
||||
#include "StringTest.hpp"
|
||||
|
||||
#include "oatpp/core/Types.hpp"
|
||||
|
Loading…
Reference in New Issue
Block a user