Simplifications and clean-ups
[invirt/third/libt4.git] / rpc / rpc_protocol.h
index b2fc346..80089ff 100644 (file)
@@ -44,7 +44,8 @@ namespace rpc_protocol {
         proc_id_t id;
     };
 
-    const size_t RPC_HEADER_SZ = max(sizeof(request_header), sizeof(reply_header)) + sizeof(rpc_sz_t);
+    union header_t { request_header req; reply_header rep; };
+    const size_t RPC_HEADER_SZ = sizeof(header_t) + sizeof(rpc_sz_t);
     const size_t DEFAULT_RPC_SZ = 1024; // size of initial buffer allocation
     const size_t MAX_PDU = 10<<20; // maximum PDF is 10M
 
@@ -55,7 +56,4 @@ namespace rpc_protocol {
     REMOTE_PROCEDURE(1, bind, (nonce_t &)); // handler number reserved for bind
 }
 
-ENDIAN_SWAPPABLE(rpc_protocol::request_header)
-ENDIAN_SWAPPABLE(rpc_protocol::reply_header)
-
 #endif