Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ds-ws18
yfs-lab
Commits
6db11a98
Commit
6db11a98
authored
Oct 31, 2016
by
verdelyi
Committed by
Arpan Gujarati
Nov 23, 2016
Browse files
Remove the unnecessary redefinition of max()
parent
ba74563e
Changes
1
Show whitespace changes
Inline
Side-by-side
rpc/marshall.h
View file @
6db11a98
...
@@ -6,12 +6,11 @@
...
@@ -6,12 +6,11 @@
#include <string>
#include <string>
#include <vector>
#include <vector>
#include <map>
#include <map>
#include <algorithm>
#include <assert.h>
#include <assert.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#define max(a,b) ((a>b)?a:b)
struct
req_header
{
struct
req_header
{
req_header
(
int
x
=
0
,
int
p
=
0
,
int
c
=
0
,
int
s
=
0
,
int
xi
=
0
)
:
req_header
(
int
x
=
0
,
int
p
=
0
,
int
c
=
0
,
int
s
=
0
,
int
xi
=
0
)
:
xid
(
x
),
proc
(
p
),
clt_nonce
(
c
),
srv_nonce
(
s
),
xid_rep
(
xi
)
{}
xid
(
x
),
proc
(
p
),
clt_nonce
(
c
),
srv_nonce
(
s
),
xid_rep
(
xi
)
{}
...
@@ -31,16 +30,15 @@ struct reply_header {
...
@@ -31,16 +30,15 @@ struct reply_header {
typedef
uint64_t
rpc_checksum_t
;
typedef
uint64_t
rpc_checksum_t
;
typedef
int
rpc_sz_t
;
typedef
int
rpc_sz_t
;
enum
{
//size of initial buffer allocation
//size of initial buffer allocation
const
int
DEFAULT_RPC_SZ
=
1024
;
DEFAULT_RPC_SZ
=
1024
,
#if RPC_CHECKSUMMING
#if RPC_CHECKSUMMING
//size of rpc_header includes a 4-byte int to be filled by tcpchan and uint64_t checksum
//size of rpc_header includes a 4-byte int to be filled by tcpchan and uint64_t checksum
RPC_HEADER_SZ
=
max
(
sizeof
(
req_header
),
sizeof
(
reply_header
))
+
sizeof
(
rpc_sz_t
)
+
sizeof
(
rpc_checksum_t
)
const
int
RPC_HEADER_SZ
=
std
::
max
(
sizeof
(
req_header
),
sizeof
(
reply_header
))
+
sizeof
(
rpc_sz_t
)
+
sizeof
(
rpc_checksum_t
)
;
#else
#else
RPC_HEADER_SZ
=
max
(
sizeof
(
req_header
),
sizeof
(
reply_header
))
+
sizeof
(
rpc_sz_t
)
const
int
RPC_HEADER_SZ
=
std
::
max
(
sizeof
(
req_header
),
sizeof
(
reply_header
))
+
sizeof
(
rpc_sz_t
)
;
#endif
#endif
};
class
marshall
{
class
marshall
{
private:
private:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment