]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/examples/clntsrv/client.cc
update
[l4.git] / l4 / pkg / examples / clntsrv / client.cc
index f5649b86bc54d8e4efc9b2695375205dc5a8f807..388ebcc55286abda163a2ba0ef933ac134ddbe29 100644 (file)
@@ -1,5 +1,8 @@
 /*
- * (c) 2008-2009 Technische Universität Dresden
+ * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
+ *               Alexander Warg <warg@os.inf.tu-dresden.de>
+ *     economic rights: Technische Universität Dresden (Germany)
+ *
  * This file is part of TUD:OS and distributed under the terms of the
  * GNU General Public License 2.
  * Please see the COPYING-GPL-2 file for details.
 
 #include "shared.h"
 
-int
+static int
 func_neg_call(L4::Cap<void> const &server, l4_uint32_t *result,
               l4_uint32_t val)
 {
-  L4::Ipc_iostream s(l4_utcb());
+  L4::Ipc::Iostream s(l4_utcb());
   s << l4_umword_t(Opcode::func_neg) << val;
-  l4_msgtag_t res = s.call(server.cap());
-  if (l4_ipc_error(res, l4_utcb()))
-    return 1; // failure
+  int r = l4_error(s.call(server.cap(), Protocol::Calc));
+  if (r)
+    return r; // failure
   s >> *result;
   return 0; // ok
 }
 
-int
+static int
 func_sub_call(L4::Cap<void> const &server, l4_uint32_t *result,
               l4_uint32_t val1, l4_uint32_t val2)
 {
-  L4::Ipc_iostream s(l4_utcb());
+  L4::Ipc::Iostream s(l4_utcb());
   s << l4_umword_t(Opcode::func_sub) << val1 << val2;
-  l4_msgtag_t res = s.call(server.cap(), Protocol::Calc);
-  if (l4_ipc_error(res, l4_utcb()))
-    return 1; // failure
+  int r = l4_error(s.call(server.cap(), Protocol::Calc));
+  if (r)
+    return r; // failure
   s >> *result;
   return 0; // ok
 }
@@ -43,7 +46,6 @@ func_sub_call(L4::Cap<void> const &server, l4_uint32_t *result,
 int
 main()
 {
-
   L4::Cap<void> server = L4Re::Env::env()->get_cap<void>("calc_server");
   if (!server.is_valid())
     {