diff -Naur pficommon-1.3.1.0.old/src/concurrent/pcbuf_test.cpp pficommon-1.3.1.0/src/concurrent/pcbuf_test.cpp --- pficommon-1.3.1.0.old/src/concurrent/pcbuf_test.cpp 2016-10-03 19:57:38.869866515 -0400 +++ pficommon-1.3.1.0/src/concurrent/pcbuf_test.cpp 2016-10-03 19:57:49.392789358 -0400 @@ -151,7 +151,7 @@ // start consumers vector > consumers(consumer_num); for (size_t i = 0; i < consumers.size(); i++) { - function f = bind(consumer_func, + pfi::lang::function f = bind(consumer_func, &q, &shutdown_flag, &consumer_histgram, @@ -163,7 +163,7 @@ // start producers vector > producers(producer_num); for (size_t i = 0; i < producers.size(); i++) { - function f = bind(producer_func, + pfi::lang::function f = bind(producer_func, &q, produced_data_min, produced_data_max, diff -Naur pficommon-1.3.1.0.old/src/concurrent/thread.cpp pficommon-1.3.1.0/src/concurrent/thread.cpp --- pficommon-1.3.1.0.old/src/concurrent/thread.cpp 2016-10-03 19:57:38.869866515 -0400 +++ pficommon-1.3.1.0/src/concurrent/thread.cpp 2016-10-03 19:57:49.392789358 -0400 @@ -44,7 +44,7 @@ class thread::impl : noncopyable{ public: - impl(const function &f); + impl(const pfi::lang::function &f); ~impl(); bool start(); @@ -57,10 +57,10 @@ bool running; pthread_t tid; - function f; + pfi::lang::function f; }; -thread::thread(const function &f) +thread::thread(const pfi::lang::function &f) :pimpl(new impl(f)) { } @@ -115,7 +115,7 @@ #endif } -thread::impl::impl(const function &f) +thread::impl::impl(const pfi::lang::function &f) : running(false) , tid(0) , f(f) @@ -134,7 +134,7 @@ if (running) return false; running=true; - function *pf=new function(f); + pfi::lang::function *pf=new pfi::lang::function(f); int res=pthread_create(&tid,NULL,start_routine,(void*)pf); if (res!=0){ delete pf; @@ -177,7 +177,7 @@ void *thread::impl::start_routine(void *p) { - function *pf=reinterpret_cast*>(p); + pfi::lang::function *pf=reinterpret_cast*>(p); (*pf)(); delete pf; return NULL; diff -Naur pficommon-1.3.1.0.old/src/data/serialization_test.cpp pficommon-1.3.1.0/src/data/serialization_test.cpp --- pficommon-1.3.1.0.old/src/data/serialization_test.cpp 2016-10-03 19:57:38.869866515 -0400 +++ pficommon-1.3.1.0/src/data/serialization_test.cpp 2016-10-03 19:57:49.392789358 -0400 @@ -297,25 +297,25 @@ TEST(serialization, reflect) { { - shared_ptr t=get_type >(); + pfi::lang::shared_ptr t=get_type >(); ostringstream oss; t->print(oss); EXPECT_EQ(oss.str(), "array"); } { - shared_ptr t=get_type >(); + pfi::lang::shared_ptr t=get_type >(); ostringstream oss; t->print(oss); EXPECT_EQ(oss.str(), "array"); } { - shared_ptr t=get_type >(); + pfi::lang::shared_ptr t=get_type >(); ostringstream oss; t->print(oss); EXPECT_EQ(oss.str(), "map"); } { - shared_ptr t=get_type, string> > >(); + pfi::lang::shared_ptr t=get_type, string> > >(); ostringstream oss; t->print(oss); EXPECT_EQ(oss.str(), "array,string>>"); diff -Naur pficommon-1.3.1.0.old/src/database/mysql/connection.cpp pficommon-1.3.1.0/src/database/mysql/connection.cpp --- pficommon-1.3.1.0.old/src/database/mysql/connection.cpp 2016-10-03 19:57:38.870866508 -0400 +++ pficommon-1.3.1.0/src/database/mysql/connection.cpp 2016-10-03 19:57:49.392789358 -0400 @@ -145,20 +145,20 @@ } int mysql_connection::run(const string &sql, - const vector > &args) + const vector > &args) { if (conn->get() == NULL) reconnect(); // TODO: optimize try { - shared_ptr stat(prepare(sql)); + pfi::lang::shared_ptr stat(prepare(sql)); return stat->execute(args); } catch (const connection_error &e) { reconnect(); // this function rethrows an exception if necessary } - shared_ptr stat(prepare(sql)); + pfi::lang::shared_ptr stat(prepare(sql)); return stat->execute(args); } diff -Naur pficommon-1.3.1.0.old/src/database/mysql/statement.cpp pficommon-1.3.1.0/src/database/mysql/statement.cpp --- pficommon-1.3.1.0.old/src/database/mysql/statement.cpp 2016-10-03 19:57:38.870866508 -0400 +++ pficommon-1.3.1.0/src/database/mysql/statement.cpp 2016-10-03 19:59:27.620233480 -0400 @@ -48,7 +48,7 @@ namespace database{ namespace mysql{ -mysql_statement::mysql_statement(shared_ptr &conn, const string &query) :conn(conn),meta(NULL) @@ -98,7 +98,7 @@ mysql_stmt_close(stmt); } -int mysql_statement::execute(const vector > &args) +int mysql_statement::execute(const vector > &args) { if (param_count!=args.size()){ ostringstream msg; @@ -146,7 +146,7 @@ return 0; } -bool mysql_statement::fetch_row(vector > &row) +bool mysql_statement::fetch_row(vector > &row) { static const size_t INIT_BUF_SIZE = 16*1024; diff -Naur pficommon-1.3.1.0.old/src/database/mysql/value.cpp pficommon-1.3.1.0/src/database/mysql/value.cpp --- pficommon-1.3.1.0.old/src/database/mysql/value.cpp 2016-10-03 19:57:38.870866508 -0400 +++ pficommon-1.3.1.0/src/database/mysql/value.cpp 2016-10-03 19:57:49.392789358 -0400 @@ -88,14 +88,14 @@ } } -shared_ptr from_bind(MYSQL_BIND &bind) +pfi::lang::shared_ptr from_bind(MYSQL_BIND &bind) { sql_value *p=from_bind_p(bind); - if (!p) return shared_ptr(); - return shared_ptr(p); + if (!p) return pfi::lang::shared_ptr(); + return pfi::lang::shared_ptr(p); } -size_t bind_length(shared_ptr p) +size_t bind_length(pfi::lang::shared_ptr p) { if (!p) return 0; @@ -119,7 +119,7 @@ } } -void to_bind(shared_ptr p, MYSQL_BIND &bind) +void to_bind(pfi::lang::shared_ptr p, MYSQL_BIND &bind) { if (!p){ bind.is_null=NULL; diff -Naur pficommon-1.3.1.0.old/src/database/postgresql/connection.cpp pficommon-1.3.1.0/src/database/postgresql/connection.cpp --- pficommon-1.3.1.0.old/src/database/postgresql/connection.cpp 2016-10-03 19:57:38.870866508 -0400 +++ pficommon-1.3.1.0/src/database/postgresql/connection.cpp 2016-10-03 19:57:49.392789358 -0400 @@ -108,9 +108,9 @@ (void)connection::run("ROLLBACK"); } -int postgresql_connection::run(const string &sql, const vector > &args) +int postgresql_connection::run(const string &sql, const vector > &args) { - shared_ptr stat(prepare(sql)); + pfi::lang::shared_ptr stat(prepare(sql)); return stat->execute(args); } diff -Naur pficommon-1.3.1.0.old/src/database/postgresql/statement.cpp pficommon-1.3.1.0/src/database/postgresql/statement.cpp --- pficommon-1.3.1.0.old/src/database/postgresql/statement.cpp 2016-10-03 19:57:38.870866508 -0400 +++ pficommon-1.3.1.0/src/database/postgresql/statement.cpp 2016-10-03 19:57:49.393789351 -0400 @@ -58,7 +58,7 @@ return oss.str(); } -postgresql_statement::postgresql_statement(shared_ptr conn, +postgresql_statement::postgresql_statement(pfi::lang::shared_ptr conn, const string &query) : conn(conn) { @@ -72,10 +72,10 @@ { } -int postgresql_statement::execute(const vector > &args) +int postgresql_statement::execute(const vector > &args) { int n=args.size(); - vector > sparams(n); + vector > sparams(n); vector params(n); vector param_lens(n); @@ -95,8 +95,8 @@ if (r==NULL) throw database_error("PQexecPrepared failed"); - shared_ptr rtmp= - shared_ptr(new postgresql_result(r)); + pfi::lang::shared_ptr rtmp= + pfi::lang::shared_ptr(new postgresql_result(r)); if (!rtmp->command_ok() && !rtmp->tuple_ok()) @@ -108,7 +108,7 @@ return 0; } -bool postgresql_statement::fetch_row(vector > &row) +bool postgresql_statement::fetch_row(vector > &row) { if (!res) return false; return res->fetch_row(row); diff -Naur pficommon-1.3.1.0.old/src/database/postgresql/value.cpp pficommon-1.3.1.0/src/database/postgresql/value.cpp --- pficommon-1.3.1.0.old/src/database/postgresql/value.cpp 2016-10-03 19:57:38.870866508 -0400 +++ pficommon-1.3.1.0/src/database/postgresql/value.cpp 2016-10-03 19:57:49.393789351 -0400 @@ -115,36 +115,36 @@ } } -shared_ptr str_to_sql(char *p, int len, int is_null, Oid oid) +pfi::lang::shared_ptr str_to_sql(char *p, int len, int is_null, Oid oid) { - if (is_null) return shared_ptr(); + if (is_null) return pfi::lang::shared_ptr(); sql_type t=oid_to_sql_type(oid); - return shared_ptr(make_sql_value(p, len, t)); + return pfi::lang::shared_ptr(make_sql_value(p, len, t)); } -shared_ptr sql_to_str(shared_ptr p) +pfi::lang::shared_ptr sql_to_str(pfi::lang::shared_ptr p) { - if (!p) return shared_ptr(); + if (!p) return pfi::lang::shared_ptr(); switch(p->type()){ case SQL_BOOL:{ static const string t("true"); static const string f("false"); - return shared_ptr(new string(dynamic_cast(p.get())->get()?t:f)); + return pfi::lang::shared_ptr(new string(dynamic_cast(p.get())->get()?t:f)); } case SQL_STRING:{ - return shared_ptr(new string(dynamic_cast(p.get())->get())); + return pfi::lang::shared_ptr(new string(dynamic_cast(p.get())->get())); } case SQL_INT32:{ - return shared_ptr(new string(lexical_cast(dynamic_cast(p.get())->get()))); + return pfi::lang::shared_ptr(new string(lexical_cast(dynamic_cast(p.get())->get()))); } case SQL_INT64:{ - return shared_ptr(new string(lexical_cast(dynamic_cast(p.get())->get()))); + return pfi::lang::shared_ptr(new string(lexical_cast(dynamic_cast(p.get())->get()))); } case SQL_FLOAT:{ ostringstream oss; oss<(p.get())->get(); - return shared_ptr(new string(oss.str())); + return pfi::lang::shared_ptr(new string(oss.str())); } case SQL_TIMESTAMP:{ calendar_time ct(dynamic_cast(p.get())->get()); @@ -159,10 +159,10 @@ strftime(buf, sizeof(buf), "%Y-%m-%d %T.", &t); sprintf(ubuf, "%06d", ct.usec); strcat(buf, ubuf); - return shared_ptr(new string(buf)); + return pfi::lang::shared_ptr(new string(buf)); } case SQL_UNKNOWN:{ - return shared_ptr(new string(dynamic_cast(p.get())->get())); + return pfi::lang::shared_ptr(new string(dynamic_cast(p.get())->get())); } default: abort(); diff -Naur pficommon-1.3.1.0.old/src/math/random_test.cpp pficommon-1.3.1.0/src/math/random_test.cpp --- pficommon-1.3.1.0.old/src/math/random_test.cpp 2016-10-03 19:57:38.870866508 -0400 +++ pficommon-1.3.1.0/src/math/random_test.cpp 2016-10-03 19:57:49.393789351 -0400 @@ -52,7 +52,7 @@ template -vector moment(int max_mom, int size, function &val){ +vector moment(int max_mom, int size, pfi::lang::function &val){ vector mom(max_mom,0); for(int i=0;i mt; - shared_ptr r1(new mt); + pfi::lang::shared_ptr r1(new mt); usleep(5); - shared_ptr r2(new mt); + pfi::lang::shared_ptr r2(new mt); for(int i=0;i<10;++i){ int x=r1->next_int(), y=r2->next_int(); EXPECT_TRUE(x!=y) << "x=" << x << " " << "y=" << y << endl; @@ -110,7 +110,7 @@ } -bool is_standard_deviation(function f, bool expectation=true){ +bool is_standard_deviation(pfi::lang::function f, bool expectation=true){ // if f is standard deviation, it passes approx 99.99% probability. int size=1<<22; diff -Naur pficommon-1.3.1.0.old/src/network/cgi/inserter.cpp pficommon-1.3.1.0/src/network/cgi/inserter.cpp --- pficommon-1.3.1.0.old/src/network/cgi/inserter.cpp 2016-10-03 19:57:38.871866500 -0400 +++ pficommon-1.3.1.0/src/network/cgi/inserter.cpp 2016-10-03 19:57:49.393789351 -0400 @@ -50,8 +50,8 @@ tag_inserter::~tag_inserter() { - shared_ptr elem(new tag_elem(name, attrs)); - vector > children=b.leave(); + pfi::lang::shared_ptr elem(new tag_elem(name, attrs)); + vector > children=b.leave(); for (int i=0;i<(int)children.size();i++) elem->add_child(children[i]); b.push(elem); @@ -59,12 +59,12 @@ text_inserter::text_inserter(const string &text, xhtml_builder &b) { - b.push(shared_ptr(new text_elem(text))); + b.push(pfi::lang::shared_ptr(new text_elem(text))); } prim_inserter::prim_inserter(const string &text, xhtml_builder &b) { - b.push(shared_ptr(new prim_elem(text))); + b.push(pfi::lang::shared_ptr(new prim_elem(text))); } } // cgi diff -Naur pficommon-1.3.1.0.old/src/network/cgi/server.cpp pficommon-1.3.1.0/src/network/cgi/server.cpp --- pficommon-1.3.1.0.old/src/network/cgi/server.cpp 2016-10-03 19:57:38.871866500 -0400 +++ pficommon-1.3.1.0/src/network/cgi/server.cpp 2016-10-03 19:57:49.393789351 -0400 @@ -161,12 +161,12 @@ <<", thread-num="< gen_resp(stringstream &ss) +static pfi::lang::shared_ptr gen_resp(stringstream &ss) { http::header head(ss); @@ -210,7 +210,7 @@ head.erase("status"); } - shared_ptr resp(new http::response(code, reason)); + pfi::lang::shared_ptr resp(new http::response(code, reason)); head["Content-Type"]=content_type; @@ -232,10 +232,10 @@ } void run_server::process(socket_type ssock, - shared_ptr cc) + pfi::lang::shared_ptr cc) { for (;;){ - shared_ptr sock(ssock->accept()); + pfi::lang::shared_ptr sock(ssock->accept()); if (!sock) continue; if (ssock->timeout()>0 && !sock->set_timeout(ssock->timeout())) @@ -272,7 +272,7 @@ cc->exec(req.body(), sout, cerr, env); - shared_ptr resp=gen_resp(sout); + pfi::lang::shared_ptr resp=gen_resp(sout); resp->send(sock); } catch(const exception &e){ diff -Naur pficommon-1.3.1.0.old/src/network/http/base.cpp pficommon-1.3.1.0/src/network/http/base.cpp --- pficommon-1.3.1.0.old/src/network/http/base.cpp 2016-10-03 19:57:38.871866500 -0400 +++ pficommon-1.3.1.0/src/network/http/base.cpp 2016-10-03 19:57:49.393789351 -0400 @@ -61,7 +61,7 @@ { } -void header::read_header(function f) +void header::read_header(pfi::lang::function f) { string line, key, val; if (!f(&line)) @@ -124,7 +124,7 @@ return sock->getline(*str, line_limit); } -header::header(shared_ptr sock) +header::header(pfi::lang::shared_ptr sock) { read_header(bind(&socket_getline, sock.get(), _1, line_limit)); } @@ -211,7 +211,7 @@ return dat.end(); } -void header::send(shared_ptr sock) +void header::send(pfi::lang::shared_ptr sock) { for (int i=0;i<(int)dat.size();i++){ string line=dat[i].first+": "+dat[i].second+"\r\n"; @@ -228,7 +228,7 @@ public: typedef C char_type; - basic_httpbody_chunked_streambuf(shared_ptr sock) + basic_httpbody_chunked_streambuf(pfi::lang::shared_ptr sock) : sock(sock) , chunk_rest(0) , buf(buf_size) @@ -321,7 +321,7 @@ iss>>hex>>chunk_rest; } - shared_ptr sock; + pfi::lang::shared_ptr sock; int chunk_rest; @@ -334,7 +334,7 @@ public: typedef C char_type; - basic_httpbody_streambuf(shared_ptr sock, int length) + basic_httpbody_streambuf(pfi::lang::shared_ptr sock, int length) : sock(sock) , rest(length) , buf(T::eof()){ @@ -359,7 +359,7 @@ } private: - shared_ptr sock; + pfi::lang::shared_ptr sock; int rest; int buf; @@ -368,7 +368,7 @@ template > class basic_httpbody_chunked_stream : public basic_iostream{ public: - basic_httpbody_chunked_stream(shared_ptr sock) + basic_httpbody_chunked_stream(pfi::lang::shared_ptr sock) : basic_iostream() , buf(sock){ this->init(&buf); @@ -380,7 +380,7 @@ template > class basic_httpbody_stream : public basic_iostream{ public: - basic_httpbody_stream(shared_ptr sock, int len) + basic_httpbody_stream(pfi::lang::shared_ptr sock, int len) : basic_iostream() , buf(sock, len){ this->init(&buf); @@ -406,7 +406,7 @@ { } -request::request(shared_ptr sock) +request::request(pfi::lang::shared_ptr sock) : method_("") , uri_("/") , version_(1,1) @@ -438,11 +438,11 @@ // body if (cicmp(header_["Transfer-Encoding"],"chunked")) - stream=shared_ptr(new basic_httpbody_chunked_stream(sock)); + stream=pfi::lang::shared_ptr(new basic_httpbody_chunked_stream(sock)); else if (header_["Content-Length"]!="") - stream=shared_ptr(new basic_httpbody_stream(sock, lexical_cast(header_["Content-Length"]))); + stream=pfi::lang::shared_ptr(new basic_httpbody_stream(sock, lexical_cast(header_["Content-Length"]))); else - stream=shared_ptr(new socketstream(sock)); + stream=pfi::lang::shared_ptr(new socketstream(sock)); } request::~request() @@ -474,7 +474,7 @@ return *stream; } -void request::send(shared_ptr sock) +void request::send(pfi::lang::shared_ptr sock) { stringstream *ss=dynamic_cast(stream.get()); if (!ss) throw http_exception("body is not stringstream"); @@ -499,7 +499,7 @@ if (sock->flush()>=0) throw http_exception("flush failed"); if (dat.length()==0) - stream=shared_ptr(new socketstream(sock)); + stream=pfi::lang::shared_ptr(new socketstream(sock)); } response::response() @@ -518,7 +518,7 @@ { } -response::response(shared_ptr sock) +response::response(pfi::lang::shared_ptr sock) { // status-line { @@ -546,11 +546,11 @@ // body if (cicmp(header_["Transfer-Encoding"],"chunked")) - stream=shared_ptr(new basic_httpbody_chunked_stream(sock)); + stream=pfi::lang::shared_ptr(new basic_httpbody_chunked_stream(sock)); else if (header_["Content-Length"]!="") - stream=shared_ptr(new basic_httpbody_stream(sock, lexical_cast(header_["Content-Length"]))); + stream=pfi::lang::shared_ptr(new basic_httpbody_stream(sock, lexical_cast(header_["Content-Length"]))); else - stream=shared_ptr(new socketstream(sock)); + stream=pfi::lang::shared_ptr(new socketstream(sock)); } response::~response() @@ -582,7 +582,7 @@ return *stream; } -void response::send(shared_ptr sock) +void response::send(pfi::lang::shared_ptr sock) { stringstream *ss=dynamic_cast(stream.get()); if (!ss) throw http_exception("body is not stringstream"); @@ -607,7 +607,7 @@ if (sock->flush()>=0) throw http_exception("flush failed"); if (dat.length()==0) - stream=shared_ptr(new socketstream(sock)); + stream=pfi::lang::shared_ptr(new socketstream(sock)); } } // http diff -Naur pficommon-1.3.1.0.old/src/network/mprpc/rpc_server.cpp pficommon-1.3.1.0/src/network/mprpc/rpc_server.cpp --- pficommon-1.3.1.0.old/src/network/mprpc/rpc_server.cpp 2016-10-03 19:57:38.871866500 -0400 +++ pficommon-1.3.1.0/src/network/mprpc/rpc_server.cpp 2016-10-03 19:57:49.393789351 -0400 @@ -80,9 +80,9 @@ if (!basic_server::create(port)) return false; - std::vector > ths(nthreads); + std::vector > ths(nthreads); for (int i=0; i(new thread( + ths[i] = pfi::lang::shared_ptr(new thread( pfi::lang::bind(&rpc_server::process, this))); if (!ths[i]->start()) return false; } diff -Naur pficommon-1.3.1.0.old/src/network/rpc/base.cpp pficommon-1.3.1.0/src/network/rpc/base.cpp --- pficommon-1.3.1.0.old/src/network/rpc/base.cpp 2016-10-03 19:57:38.871866500 -0400 +++ pficommon-1.3.1.0/src/network/rpc/base.cpp 2016-10-03 19:57:49.393789351 -0400 @@ -59,20 +59,20 @@ { } -void rpc_server::add(const string &name, shared_ptr invoker) +void rpc_server::add(const string &name, pfi::lang::shared_ptr invoker) { funcs[name]=invoker; } bool rpc_server::serv(uint16_t port, int nthreads) { - shared_ptr ssock(new server_socket()); + pfi::lang::shared_ptr ssock(new server_socket()); if (!ssock->create(port)) return false; - vector > ths(nthreads); + vector > ths(nthreads); for (int i=0; i(new thread(bind(&rpc_server::process, this, ssock))); + ths[i]=pfi::lang::shared_ptr(new thread(bind(&rpc_server::process, this, ssock))); if (!ths[i]->start()) return false; } for (int i=0; i ssock) +void rpc_server::process(pfi::lang::shared_ptr ssock) { for (;;){ - shared_ptr sock(ssock->accept()); + pfi::lang::shared_ptr sock(ssock->accept()); if (!sock) continue; sock->set_nodelay(true); @@ -139,11 +139,11 @@ { } -shared_ptr rpc_client::get_connection() +pfi::lang::shared_ptr rpc_client::get_connection() { for (int i=0;i<2;i++){ if (!ss || !(*ss)){ - ss=shared_ptr(new socketstream(host, port)); + ss=pfi::lang::shared_ptr(new socketstream(host, port)); if (!(*ss)){ ss.reset(); continue; @@ -180,7 +180,7 @@ return ss; } -void rpc_client::return_connection(shared_ptr css) +void rpc_client::return_connection(pfi::lang::shared_ptr css) { ss=css; } diff -Naur pficommon-1.3.1.0.old/src/network/socket.cpp pficommon-1.3.1.0/src/network/socket.cpp --- pficommon-1.3.1.0.old/src/network/socket.cpp 2016-10-03 19:57:38.871866500 -0400 +++ pficommon-1.3.1.0/src/network/socket.cpp 2016-10-03 19:57:49.393789351 -0400 @@ -57,7 +57,7 @@ namespace pfi{ namespace network{ -shared_ptr stream_socket::resolver; +pfi::lang::shared_ptr stream_socket::resolver; r_mutex stream_socket::resolver_m; class sigign{ @@ -87,7 +87,7 @@ close(); } -void stream_socket::set_dns_resolver(shared_ptr r) +void stream_socket::set_dns_resolver(pfi::lang::shared_ptr r) { synchronized(resolver_m) resolver=r; @@ -105,10 +105,10 @@ return false; } - shared_ptr res; + pfi::lang::shared_ptr res; synchronized(resolver_m){ if (!resolver) - set_dns_resolver(shared_ptr + set_dns_resolver(pfi::lang::shared_ptr (new normal_dns_resolver())); res=resolver; } diff -Naur pficommon-1.3.1.0.old/src/visualization/magick.cpp pficommon-1.3.1.0/src/visualization/magick.cpp --- pficommon-1.3.1.0.old/src/visualization/magick.cpp 2016-10-03 19:57:38.872866493 -0400 +++ pficommon-1.3.1.0/src/visualization/magick.cpp 2016-10-03 20:02:33.215016787 -0400 @@ -69,9 +69,9 @@ Magick::PixelPacket c=img.pixelColor(x, y); // Quantum Depth is 8 or 16 #if QuantumDepth == 16 - r=c.red>>8; - g=c.green>>8; - b=c.blue>>8; + r=((unsigned char) c.red)>>8; + g=((unsigned char) c.green)>>8; + b=((unsigned char) c.blue)>>8; #else r=c.red; g=c.green; diff -Naur pficommon-1.3.1.0.old/tools/genrpc/gen_php.h pficommon-1.3.1.0/tools/genrpc/gen_php.h --- pficommon-1.3.1.0.old/tools/genrpc/gen_php.h 2016-10-03 19:57:38.872866493 -0400 +++ pficommon-1.3.1.0/tools/genrpc/gen_php.h 2016-10-03 19:57:49.394789344 -0400 @@ -18,7 +18,7 @@ #define LIB_PATH "pfi_rpc.php" -typedef shared_ptr type_rep_p; +typedef pfi::lang::shared_ptr type_rep_p; typedef pair > function_type; class php_generator{ @@ -99,7 +99,7 @@ os<<" var $int_typeinfo;"<, vector > > >::iterator p=mems.begin(); + for (map, vector > > >::iterator p=mems.begin(); p!=mems.end(); p++){ const string &method_name=p->first; @@ -113,7 +113,7 @@ os<<" $this->int_typeinfo=new int_type(false, 4);"<string_typeinfo=new string_type();"<, vector > > >::iterator p=mems.begin(); + for (map, vector > > >::iterator p=mems.begin(); p!=mems.end(); p++){ const string &method_name=p->first; @@ -148,7 +148,7 @@ os<<" throw new Exception(\"result code is not OK: $code\");"<, vector > > >::iterator p=mems.begin(); + for (map, vector > > >::iterator p=mems.begin(); p!=mems.end(); p++){ const string &method_name=p->first; diff -Naur pficommon-1.3.1.0.old/tools/genrpc/main.cpp pficommon-1.3.1.0/tools/genrpc/main.cpp --- pficommon-1.3.1.0.old/tools/genrpc/main.cpp 2016-10-03 19:57:38.872866493 -0400 +++ pficommon-1.3.1.0/tools/genrpc/main.cpp 2016-10-03 19:57:49.394789344 -0400 @@ -26,12 +26,12 @@ string tname("genrpctmpXXXXXX"); string gname("genrpcexeXXXXXX"); { - shared_ptr pofs(tmpstream(tname)); + pfi::lang::shared_ptr pofs(tmpstream(tname)); ostream &ofs=*pofs.get(); ofs< pofs(tmpstream(gname)); + pfi::lang::shared_ptr pofs(tmpstream(gname)); } int compile_stat=system(("g++ -xc++ "+tname+" "+compiler_options+" -lpficommon -o "+gname).c_str()); unlink(tname.c_str());