diff --git a/include/XPath/impl/xpath_function.hpp b/include/XPath/impl/xpath_function.hpp index d9074973..7c261d90 100644 --- a/include/XPath/impl/xpath_function.hpp +++ b/include/XPath/impl/xpath_function.hpp @@ -202,7 +202,7 @@ public: virtual double doEvaluate(const DOM::Node& context, const ExecutionContext& executionContext) const { - return baseT::argAsNodeSet(0, context, executionContext).size(); + return static_cast(baseT::argAsNodeSet(0, context, executionContext).size()); } // evaluate }; // class CountFn @@ -480,7 +480,7 @@ protected: if(startAt < 0) startAt = 0; if((isInfinite(endAt)) || (endAt > string_adaptor::length(value))) - endAt = string_adaptor::length(value); + endAt = static_cast(string_adaptor::length(value)); return string_adaptor::substr(value, static_cast(startAt), static_cast(endAt - startAt)); } // evaluate @@ -498,7 +498,7 @@ public: const ExecutionContext& executionContext) const { string_type v = (baseT::argCount() > 0) ? baseT::argAsString(0, context, executionContext) : nodeStringValue(context); - return string_adaptor::length(v); + return static_cast(string_adaptor::length(v)); } // evaluate }; // StringLengthFn diff --git a/include/io/socket_stream.hpp b/include/io/socket_stream.hpp index 48bba0f8..83b8dd54 100644 --- a/include/io/socket_stream.hpp +++ b/include/io/socket_stream.hpp @@ -170,7 +170,7 @@ basic_socketbuf* basic_socketbuf::open(const cha sockAddr.sin_port = htons(port); // connect - int tmpsock = socket(AF_INET, SOCK_STREAM, 0); + int tmpsock = static_cast(socket(AF_INET, SOCK_STREAM, 0)); if(tmpsock == INVALID_SOCKET) return 0; if(connect(tmpsock, reinterpret_cast(&sockAddr), sizeof(sockaddr_in)) != 0) @@ -267,7 +267,7 @@ bool basic_socketbuf::writeSocket() if(!length) return true; - bool ok = (send(sock_, from_next, length, 0) != SOCKET_ERROR); + bool ok = (send(sock_, from_next, static_cast(length), 0) != SOCKET_ERROR); if(ok) setp(from_next, from_next + outBuffer_.capacity()); @@ -289,13 +289,13 @@ int basic_socketbuf::readSocket() if(!inBuffer_.capacity()) growInBuffer(); - size_t pbCount = std::min(gptr() - eback(), pbSize_); + size_t pbCount = std::min(gptr() - eback(), pbSize_); memcpy(&(inBuffer_[0]) + (pbSize_-pbCount)*sizeof(charT), gptr() - pbCount*sizeof(charT), pbCount*sizeof(charT)); - int res = recv(sock_, &(inBuffer_[0]) + pbSize_, inBuffer_.capacity() - pbSize_, 0); + int res = recv(sock_, &(inBuffer_[0]) + pbSize_, static_cast(inBuffer_.capacity() - pbSize_), 0); if(res == 0) { // server closed the socket diff --git a/src/convert/base64codecvt.cpp b/src/convert/base64codecvt.cpp index b6775962..ea31d929 100644 --- a/src/convert/base64codecvt.cpp +++ b/src/convert/base64codecvt.cpp @@ -150,7 +150,7 @@ int base64codecvt::do_length(const std::mbstate_t&, chars -= 3; } // while(chars > max) - return length; + return static_cast(length); } // do_length int base64codecvt::do_max_length() const throw() diff --git a/src/convert/iso88591utf8codecvt.cpp b/src/convert/iso88591utf8codecvt.cpp index edbd16c3..f243c193 100644 --- a/src/convert/iso88591utf8codecvt.cpp +++ b/src/convert/iso88591utf8codecvt.cpp @@ -55,7 +55,7 @@ int iso88591utf8codecvt::do_length(const std::mbstate_t&, ++from_next; } // while - return (from_next-from); + return static_cast(from_next-from); } // do_length // end of file diff --git a/src/convert/rot13codecvt.cpp b/src/convert/rot13codecvt.cpp index 5d29821b..ac25658c 100644 --- a/src/convert/rot13codecvt.cpp +++ b/src/convert/rot13codecvt.cpp @@ -43,7 +43,7 @@ int rot13codecvt::do_length(const std::mbstate_t&, const char* end, size_t max) const { - return std::max(end - from, max); + return std::max(static_cast(end - from), static_cast(max)); } // do_length // end of file diff --git a/src/convert/ucs2utf8codecvt.cpp b/src/convert/ucs2utf8codecvt.cpp index d4b17f52..9a28cca7 100644 --- a/src/convert/ucs2utf8codecvt.cpp +++ b/src/convert/ucs2utf8codecvt.cpp @@ -58,7 +58,7 @@ int ucs2utf8codecvt::do_length(const std::mbstate_t&, ++from_next; } // while - return (from_next-from); + return static_cast(from_next-from); } // do_length // end of file diff --git a/src/convert/utf16beucs2codecvt.cpp b/src/convert/utf16beucs2codecvt.cpp index 27274904..a2f1fd61 100644 --- a/src/convert/utf16beucs2codecvt.cpp +++ b/src/convert/utf16beucs2codecvt.cpp @@ -47,7 +47,7 @@ int utf16beucs2codecvt::do_length(const std::mbstate_t&, const char* end, size_t max) const { - return std::max((end-from), max/2); + return std::max(static_cast(end-from), static_cast(max/2)); } // do_length #endif diff --git a/src/convert/utf16leucs2codecvt.cpp b/src/convert/utf16leucs2codecvt.cpp index 36f54e8f..17abde79 100644 --- a/src/convert/utf16leucs2codecvt.cpp +++ b/src/convert/utf16leucs2codecvt.cpp @@ -47,7 +47,7 @@ int utf16leucs2codecvt::do_length(const std::mbstate_t&, const char* end, size_t max) const { - return std::max((end-from), max/2); + return std::max(static_cast(end-from), static_cast(max/2)); } // do_length #endif diff --git a/src/convert/utf16utf8codecvt.cpp b/src/convert/utf16utf8codecvt.cpp index 3d1db319..690a5686 100644 --- a/src/convert/utf16utf8codecvt.cpp +++ b/src/convert/utf16utf8codecvt.cpp @@ -58,7 +58,7 @@ int utf16utf8codecvt::do_length(const std::mbstate_t&, ++from_next; } // while - return (from_next-from); + return static_cast(from_next-from); } // do_length // end of file diff --git a/src/convert/utf8iso88591codecvt.cpp b/src/convert/utf8iso88591codecvt.cpp index 08c7ee95..0d2c0779 100644 --- a/src/convert/utf8iso88591codecvt.cpp +++ b/src/convert/utf8iso88591codecvt.cpp @@ -76,7 +76,7 @@ int utf8iso88591codecvt::do_length(const std::mbstate_t&, } } // while - return (from_next-from); + return static_cast(from_next-from); } // do_length // end of file diff --git a/src/convert/utf8ucs2codecvt.cpp b/src/convert/utf8ucs2codecvt.cpp index b51a3d00..d7d89a0f 100644 --- a/src/convert/utf8ucs2codecvt.cpp +++ b/src/convert/utf8ucs2codecvt.cpp @@ -77,7 +77,7 @@ int utf8ucs2codecvt::do_length(const std::mbstate_t&, } } // while - return (from_next-from); + return static_cast(from_next-from); } // do_length #endif