diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2016-05-20 21:40:13 +0300 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2016-05-21 13:30:40 +0300 |
commit | b7ec3e6e726b4fb179437db2027d46acb458c3cc (patch) | |
tree | f6f525947b23ae91695c8399ac3fa396509b0613 | |
parent | e02708ec1f48bf012535f471b6e1b2c34e53bb25 (diff) |
Suppress some compilation warnings.
-rw-r--r-- | TimXmlRpc.cpp | 35 | ||||
-rw-r--r-- | timxmlrpc.h | 2 |
2 files changed, 17 insertions, 20 deletions
diff --git a/TimXmlRpc.cpp b/TimXmlRpc.cpp index 09866b8..c8c919b 100644 --- a/TimXmlRpc.cpp +++ b/TimXmlRpc.cpp @@ -91,16 +91,6 @@ static bool strbegins(const char* bigstr, const char* smallstr, bool casesensiti } -static void assert_failed(int line, char* filename, char* msg) -{ - printf("Assert failed| %s:%d %s\n", filename, line, msg); -} - -#define assert(c) if (c) ; else assert_failed(__LINE__,__FILE__,#c) - - - - //---------------------------------- ValueArray: ------------------------------- void XmlRpcValue::ValueArray::resize(int n) @@ -286,7 +276,7 @@ public: template<class _II, class _OI, class _State, class _Endline> - _II put(_II _First, _II _Last, _OI _To, _State& _St, _Endline _Endl) const + _II put(_II _First, _II _Last, _OI _To, _State&, _Endline) const { three2four _3to4; int line_octets = 0; @@ -1244,8 +1234,8 @@ public: XmlRpcImplementation(const char* server, INTERNET_PORT port, const char* object, XmlRpcClient::protocol_enum protocol); XmlRpcImplementation(const char* URI); bool execute(const char* method, XmlRpcValue const& params, XmlRpcValue& result); - void setCallback(XmlRpcCallback Callback, void* context) - { this->Callback = Callback; this->context = context; } + void setCallback(XmlRpcCallback Callback_, void* context_) + { Callback = Callback_; context = context_; } void setIgnoreCertificateAuthority(bool value) { ignoreCertificateAuthority = value; } ~XmlRpcImplementation(); }; @@ -1452,11 +1442,11 @@ void XmlRpcImplementation::hadError(const char* function) } -static void CALLBACK myInternetCallback(HINTERNET hInternet, +static void CALLBACK myInternetCallback(HINTERNET, DWORD_PTR dwContext, DWORD dwInternetStatus, - LPVOID lpvStatusInformation, - DWORD dwStatusInformationLength) + LPVOID, + DWORD) { XmlRpcImplementation *connection = (XmlRpcImplementation*)dwContext; if (connection && connection->Callback) { @@ -1617,9 +1607,9 @@ RETRY: if (!HttpQueryInfo(hHttpFile, HTTP_QUERY_STATUS_TEXT, status_text, &buf_size, 0)) errmsg = "Could not query HTTP result status"; else { - char buf[512]; - sprintf_s(buf, "Low level (HTTP) error: %d %s", HttpErrcode, status_text); - errmsg = buf; + std::ostringstream sstream; + sstream << "Low level (HTTP) error: " << HttpErrcode << " " << status_text; + errmsg = sstream.str(); } free(status_text); InternetCloseHandle(hHttpFile); @@ -1673,6 +1663,13 @@ XmlRpcImplementation::~XmlRpcImplementation() #include <fstream> +static void assert_failed(int line, char* filename, char* msg) +{ + printf("Assert failed| %s:%d %s\n", filename, line, msg); +} + +#define assert(c) if (c) ; else assert_failed(__LINE__,__FILE__,#c) + static void RoundTrip(XmlRpcValue &a) { std::ostringstream ostr; diff --git a/timxmlrpc.h b/timxmlrpc.h index 96f9fd9..23086af 100644 --- a/timxmlrpc.h +++ b/timxmlrpc.h @@ -323,7 +323,7 @@ public: enum protocol_enum { XMLRPC_AUTO=0, XMLRPC_HTTP=1, XMLRPC_HTTPS=2 }; //! Construct a client and attempt to connect to the server at the specified host:port address - //! @param host The name of the remote machine hosting the server + //! @param server The name of the remote machine hosting the server //! @param port The port on the remote machine where the server is listening //! @param object An optional object name to be sent in the HTTP GET header XmlRpcClient(const char* server, int port, const char* object, protocol_enum protocol=XMLRPC_AUTO); |