Got rid of most using directives. Ported tests to python.
[invirt/third/libt4.git] / rpc / rpc.cc
index 00f6d2e..de33675 100644 (file)
@@ -60,6 +60,9 @@
 #include <unistd.h>
 #include <string.h>
 
+using std::list;
+using namespace std::chrono;
+
 inline void set_rand_seed() {
     auto now = time_point_cast<nanoseconds>(steady_clock::now());
     srandom((uint32_t)now.time_since_epoch().count()^(uint32_t)getpid());
@@ -186,7 +189,7 @@ int rpcc::call1(proc_id_t proc, milliseconds to, string & rep, marshall & req) {
             lock cal(ca.m);
             while (!ca.done) {
                 IF_LEVEL(2) LOG << "wait";
-                if (ca.c.wait_until(cal, nextdeadline) == cv_status::timeout) {
+                if (ca.c.wait_until(cal, nextdeadline) == std::cv_status::timeout) {
                     IF_LEVEL(2) LOG << "timeout";
                     break;
                 }
@@ -404,7 +407,7 @@ void rpcs::dispatch(shared_ptr<connection> c, const string & buf) {
 
     switch (check_duplicate_and_update(h.clt_nonce, h.xid, h.xid_rep, b1)) {
         case NEW: // new request
-            rh.ret = (*f)(forward<unmarshall>(req), rep);
+            rh.ret = (*f)(std::forward<unmarshall>(req), rep);
             if (rh.ret == rpc_protocol::unmarshall_args_failure) {
                 LOG << "failed to unmarshall the arguments. You are "
                     << "probably calling RPC 0x" << std::hex << proc << " with the wrong "
@@ -555,6 +558,6 @@ static sockaddr_in make_sockaddr(const string & hostandport) {
         memcpy(&a, hp->h_addr_list[0], sizeof(in_addr_t));
         dst.sin_addr.s_addr = a.s_addr;
     }
-    dst.sin_port = hton((in_port_t)stoi(port));
+    dst.sin_port = hton((in_port_t)std::stoi(port));
     return dst;
 }