diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-14 09:27:28 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-14 09:27:28 +0000 |
commit | 2c7009b5200ff5b7462b56239c909daef8ed7910 (patch) | |
tree | 40b116d31a3c7f56540d12ed05a5b80f3e7c4ef3 /sca-cpp/trunk/modules | |
parent | efccdd821b68280ee3b73c8ef5cda121bc27f620 (diff) |
Port to Ubuntu server 10.10 64-bit. C++ code fixes required to compile and run on 64-bit. Update INSTALL doc and build scripts. Remove a few obsolete scripts.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1034963 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules')
-rw-r--r-- | sca-cpp/trunk/modules/http/curl-connect.cpp | 10 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/http.hpp | 18 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/httpd.hpp | 2 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/mod-ssltunnel.cpp | 4 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/openauth.hpp | 2 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/java/eval.hpp | 4 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/json/json-test.cpp | 2 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/json/json.hpp | 2 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/python/eval.hpp | 2 |
9 files changed, 23 insertions, 23 deletions
diff --git a/sca-cpp/trunk/modules/http/curl-connect.cpp b/sca-cpp/trunk/modules/http/curl-connect.cpp index 8957fb01b0..432ccc2000 100644 --- a/sca-cpp/trunk/modules/http/curl-connect.cpp +++ b/sca-cpp/trunk/modules/http/curl-connect.cpp @@ -60,8 +60,8 @@ const bool testConnect(const string& url, const string& ca = "", const string& c if (pollfds->rtnevents & APR_POLLIN) { char data[8192]; if (pollfds->desc.s == csock) { - const int rl = ::read(0, data, sizeof(data)); - if (rl == -1) + const size_t rl = ::read(0, data, sizeof(data)); + if (rl == (size_t)-1) return false; if (rl > 0) { const failable<bool> src = http::send(data, rl, cs); @@ -69,12 +69,12 @@ const bool testConnect(const string& url, const string& ca = "", const string& c } } else { - const failable<int> frl = http::recv(data, sizeof(data), cs); + const failable<size_t> frl = http::recv(data, sizeof(data), cs); assert(hasContent(frl)); - const int rl = content(frl); + const size_t rl = content(frl); if (rl == 0) return true; - const int wl = ::write(0, data, rl); + const size_t wl = ::write(0, data, rl); assert(wl == rl); } continue; diff --git a/sca-cpp/trunk/modules/http/http.hpp b/sca-cpp/trunk/modules/http/http.hpp index 56331d7ee2..b6ec9d4e5a 100644 --- a/sca-cpp/trunk/modules/http/http.hpp +++ b/sca-cpp/trunk/modules/http/http.hpp @@ -94,8 +94,8 @@ private: friend CURL* handle(const CURLSession& cs); friend apr_socket_t* sock(const CURLSession& cs); friend const failable<bool> connect(const string& url, CURLSession& cs); - friend const failable<bool> send(const char* c, const int l, const CURLSession& cs); - friend const failable<int> recv(char* c, const int l, const CURLSession& cs); + friend const failable<bool> send(const char* c, const size_t l, const CURLSession& cs); + friend const failable<size_t> recv(char* c, const size_t l, const CURLSession& cs); public: string ca; @@ -257,7 +257,7 @@ template<typename R> const failable<list<R> > apply(const list<list<string> >& h ostringstream os; write(cadr(hdr), os); const string s = str(os); - const int sz = length(s); + const size_t sz = length(s); // Setup the read, write header and write data callbacks CURLReadContext rcx(mklist(s)); @@ -564,7 +564,7 @@ const failable<bool> connect(const string& url, CURLSession& cs) { /** * Send an array of chars. */ -const failable<bool> send(const char* c, const int l, const CURLSession& cs) { +const failable<bool> send(const char* c, const size_t l, const CURLSession& cs) { // Send the data size_t wl = 0; @@ -582,30 +582,30 @@ const failable<bool> send(const char* c, const int l, const CURLSession& cs) { return mkfailure<bool>(apreason(pollrc)); // Send what's left - return send(c + wl, (int)((size_t)l - wl), cs); + return send(c + wl, l - wl, cs); } /** * Receive an array of chars. */ -const failable<int> recv(char* c, const int l, const CURLSession& cs) { +const failable<size_t> recv(char* c, const size_t l, const CURLSession& cs) { // Receive data size_t rl; const CURLcode rc = curl_easy_recv(cs.h, c, (size_t)l, &rl); if (rc == CURLE_OK) - return (int)rl; + return (size_t)rl; if (rc == 1) return 0; if (rc != CURLE_AGAIN) - return mkfailure<int>(curlreason(rc)); + return mkfailure<size_t>(curlreason(rc)); // If the socket was not ready, wait for it to become ready const apr_pollfd_t* pollfds; apr_int32_t pollcount; apr_status_t pollrc = apr_pollset_poll(cs.rpollset, -1, &pollcount, &pollfds); if (pollrc != APR_SUCCESS) - return mkfailure<int>(apreason(pollrc)); + return mkfailure<size_t>(apreason(pollrc)); // Receive again return recv(c, l, cs); diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp index 02c9904ac3..78d292dc89 100644 --- a/sca-cpp/trunk/modules/http/httpd.hpp +++ b/sca-cpp/trunk/modules/http/httpd.hpp @@ -328,7 +328,7 @@ const int setupReadPolicy(request_rec* r) { */ const list<string> read(request_rec* r) { char b[1024]; - const int n = ap_get_client_block(r, b, sizeof(b)); + const size_t n = ap_get_client_block(r, b, sizeof(b)); if (n <= 0) return list<string>(); return cons(string(b, n), read(r)); diff --git a/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp b/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp index c241cd982d..f5539ce785 100644 --- a/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp +++ b/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp @@ -203,10 +203,10 @@ int tunnel(conn_rec* conn, http::CURLSession& cs, const string& url, const strin // Receive from target char data[8192]; - const failable<int> frl = http::recv(data, sizeof(data), cs); + const failable<size_t> frl = http::recv(data, sizeof(data), cs); if (!hasContent(frl)) return abort(conn, string("Couldn't receive from target") + reason(frl)); - const int rl = content(frl); + const size_t rl = content(frl); // Target connection closed if (rl == 0) diff --git a/sca-cpp/trunk/modules/http/openauth.hpp b/sca-cpp/trunk/modules/http/openauth.hpp index 53250b4732..ff69a9732f 100644 --- a/sca-cpp/trunk/modules/http/openauth.hpp +++ b/sca-cpp/trunk/modules/http/openauth.hpp @@ -51,7 +51,7 @@ const maybe<string> sessionID(const list<string> c) { if (isNil(c)) return maybe<string>(); const string cn = cookieName(c_str(car(c))); - const int i = find(cn, "="); + const size_t i = find(cn, "="); if (i < length(cn)) { const list<string> kv = mklist<string>(substr(cn, 0, i), substr(cn, i+1)); if (!isNil(kv) && !isNil(cdr(kv))) { diff --git a/sca-cpp/trunk/modules/java/eval.hpp b/sca-cpp/trunk/modules/java/eval.hpp index daf30d891b..11e57cb08a 100644 --- a/sca-cpp/trunk/modules/java/eval.hpp +++ b/sca-cpp/trunk/modules/java/eval.hpp @@ -316,7 +316,7 @@ const jobjectArray valuesToJarrayHelper(const JavaRuntime& jr, jobjectArray a, c } const jobjectArray valuesToJarray(const JavaRuntime& jr, const list<value>& v) { - jobjectArray a = jr.env->NewObjectArray(length(v), jr.objectClass, NULL); + jobjectArray a = jr.env->NewObjectArray((jsize)length(v), jr.objectClass, NULL); return valuesToJarrayHelper(jr, a, v, 0); } @@ -360,7 +360,7 @@ const jvalue* valuesToJvaluesHelper(const JavaRuntime& jr, jvalue* a, const list } const jvalue* valuesToJvalues(const JavaRuntime& jr, const list<value>& types, const list<value>& v) { - const int n = length(v); + const size_t n = length(v); jvalue* a = new (gc_anew<jvalue>(n)) jvalue[n]; valuesToJvaluesHelper(jr, a, types, v); return a; diff --git a/sca-cpp/trunk/modules/json/json-test.cpp b/sca-cpp/trunk/modules/json/json-test.cpp index 9bae859ce2..abed71a9c3 100644 --- a/sca-cpp/trunk/modules/json/json-test.cpp +++ b/sca-cpp/trunk/modules/json/json-test.cpp @@ -35,7 +35,7 @@ bool testJSEval() { JSONContext cx; const string script("(function testJSON(n){ return JSON.parse(JSON.stringify(n)) })(5)"); jsval rval; - assert(JS_EvaluateScript(cx, cx.getGlobal(), c_str(script), length(script), "testJSON.js", 1, &rval)); + assert(JS_EvaluateScript(cx, cx.getGlobal(), c_str(script), (uintN)length(script), "testJSON.js", 1, &rval)); const string r(JS_GetStringBytes(JS_ValueToString(cx, rval))); assert(r == "5"); return true; diff --git a/sca-cpp/trunk/modules/json/json.hpp b/sca-cpp/trunk/modules/json/json.hpp index 94d37866a3..a0617b0e5e 100644 --- a/sca-cpp/trunk/modules/json/json.hpp +++ b/sca-cpp/trunk/modules/json/json.hpp @@ -217,7 +217,7 @@ failable<bool> consume(JSONParser* parser, const list<string>& ilist, const JSON if (isNil(ilist)) return true; JSString* jstr = JS_NewStringCopyZ(cx, c_str(car(ilist))); - if(!JS_ConsumeJSONText(cx, parser, JS_GetStringChars(jstr), JS_GetStringLength(jstr))) + if(!JS_ConsumeJSONText(cx, parser, JS_GetStringChars(jstr), (uint32)JS_GetStringLength(jstr))) return mkfailure<bool>("JS_ConsumeJSONText failed"); return consume(parser, cdr(ilist), cx); } diff --git a/sca-cpp/trunk/modules/python/eval.hpp b/sca-cpp/trunk/modules/python/eval.hpp index 0ff68a6a1d..7f9339f6e1 100644 --- a/sca-cpp/trunk/modules/python/eval.hpp +++ b/sca-cpp/trunk/modules/python/eval.hpp @@ -215,7 +215,7 @@ PyObject* valueToPyObject(const value& v) { * Convert a python tuple to a list of values. */ -const list<value> pyTupleToValuesHelper(PyObject* o, const int i, const int size) { +const list<value> pyTupleToValuesHelper(PyObject* o, const size_t i, const size_t size) { if (i == size) return list<value>(); return cons(pyObjectToValue(PyTuple_GetItem(o, i)), pyTupleToValuesHelper(o, i + 1, size)); |