Add FTBFS fixes
Andrej Shadura
4 years ago
+30
-0
0 | From 35524f05e2651083c1f6d2e11cbac46027369d11 Mon Sep 17 00:00:00 2001 | |
1 | From: nick black <dankamongmen@gmail.com> | |
2 | Date: Sun, 1 Sep 2019 06:13:58 -0400 | |
3 | Subject: [PATCH 1/2] NFSProcedure: use zero-initializers not memset | |
4 | ||
5 | --- | |
6 | src/protocols/nfs/nfs_procedure.h | 4 ++-- | |
7 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
8 | ||
9 | diff --git a/src/protocols/nfs/nfs_procedure.h b/src/protocols/nfs/nfs_procedure.h | |
10 | index f7a2028..e3da4f2 100644 | |
11 | --- a/src/protocols/nfs/nfs_procedure.h | |
12 | +++ b/src/protocols/nfs/nfs_procedure.h | |
13 | @@ -48,11 +48,11 @@ public: | |
14 | inline NFSProcedure(xdr::XDRDecoder& c, xdr::XDRDecoder& r, const Session* s) | |
15 | : parg{&arg} // set pointer to argument | |
16 | , pres{&res} // set pointer to result | |
17 | + , arg{} // zero-initializer | |
18 | + , res{} | |
19 | { | |
20 | memset(&call, 0, sizeof(call)); | |
21 | memset(&reply, 0, sizeof(reply)); | |
22 | - memset(&arg, 0, sizeof(arg)); | |
23 | - memset(&res, 0, sizeof(res)); | |
24 | ||
25 | // fill call | |
26 | if(!xdr_callmsg(c.xdr(), &call)) | |
27 | -- | |
28 | 2.20.1 | |
29 |
+91
-0
0 | From 366c0b74f0e83312dd635f46ea2f9fc38fd15ac2 Mon Sep 17 00:00:00 2001 | |
1 | From: nick black <dankamongmen@gmail.com> | |
2 | Date: Sun, 1 Sep 2019 06:14:09 -0400 | |
3 | Subject: [PATCH 2/2] remove meaningless consts (-Werror=ignored-qualifiers) | |
4 | ||
5 | --- | |
6 | src/filtration/filtration_processor.h | 6 +++--- | |
7 | src/filtration/rpc_filtrator.h | 8 ++++---- | |
8 | src/protocols/cifs/cifs.cpp | 2 +- | |
9 | 3 files changed, 8 insertions(+), 8 deletions(-) | |
10 | ||
11 | diff --git a/src/filtration/filtration_processor.h b/src/filtration/filtration_processor.h | |
12 | index 8f71b53..f08c360 100644 | |
13 | --- a/src/filtration/filtration_processor.h | |
14 | +++ b/src/filtration/filtration_processor.h | |
15 | @@ -76,12 +76,12 @@ public: | |
16 | { | |
17 | // TODO: this code must be generalized with RPCFiltrator class | |
18 | uint32_t hdr_len{0}; | |
19 | - auto msg = reinterpret_cast<const MessageHeader* const>(info.data); | |
20 | + auto msg = reinterpret_cast<const MessageHeader*>(info.data); | |
21 | switch(msg->type()) | |
22 | { | |
23 | case MsgType::CALL: | |
24 | { | |
25 | - auto call = static_cast<const CallHeader* const>(msg); | |
26 | + auto call = static_cast<const CallHeader*>(msg); | |
27 | if(RPCValidator::check(call)) | |
28 | { | |
29 | if(NFS3Validator::check(call)) | |
30 | @@ -115,7 +115,7 @@ public: | |
31 | break; | |
32 | case MsgType::REPLY: | |
33 | { | |
34 | - auto reply = static_cast<const ReplyHeader* const>(msg); | |
35 | + auto reply = static_cast<const ReplyHeader*>(msg); | |
36 | if(RPCValidator::check(reply)) | |
37 | { | |
38 | // Truncate NFSv3 READ reply message to NFSv3-RW-limit | |
39 | diff --git a/src/filtration/rpc_filtrator.h b/src/filtration/rpc_filtrator.h | |
40 | index 24b494b..602ff07 100644 | |
41 | --- a/src/filtration/rpc_filtrator.h | |
42 | +++ b/src/filtration/rpc_filtrator.h | |
43 | @@ -80,11 +80,11 @@ public: | |
44 | const MessageHeader* const msg = rm->fragment(); | |
45 | if(msg->type() == MsgType::REPLY) | |
46 | { | |
47 | - return RPCValidator::check(static_cast<const ReplyHeader* const>(msg)); | |
48 | + return RPCValidator::check(static_cast<const ReplyHeader*>(msg)); | |
49 | } | |
50 | if(msg->type() == MsgType::CALL) | |
51 | { | |
52 | - return RPCValidator::check(static_cast<const CallHeader* const>(msg)); | |
53 | + return RPCValidator::check(static_cast<const CallHeader*>(msg)); | |
54 | } | |
55 | return false; | |
56 | } | |
57 | @@ -123,7 +123,7 @@ public: | |
58 | { | |
59 | case MsgType::CALL: | |
60 | { | |
61 | - auto call = static_cast<const CallHeader* const>(msg); | |
62 | + auto call = static_cast<const CallHeader*>(msg); | |
63 | if(RPCValidator::check(call)) | |
64 | { | |
65 | BaseImpl::setMsgLen(len); // length of current RPC message | |
66 | @@ -164,7 +164,7 @@ public: | |
67 | break; | |
68 | case MsgType::REPLY: | |
69 | { | |
70 | - auto reply = static_cast<const ReplyHeader* const>(msg); | |
71 | + auto reply = static_cast<const ReplyHeader*>(msg); | |
72 | if(RPCValidator::check(reply)) | |
73 | { | |
74 | BaseImpl::setMsgLen(len); // length of current RPC message | |
75 | diff --git a/src/protocols/cifs/cifs.cpp b/src/protocols/cifs/cifs.cpp | |
76 | index 78e02a9..52a7ebf 100644 | |
77 | --- a/src/protocols/cifs/cifs.cpp | |
78 | +++ b/src/protocols/cifs/cifs.cpp | |
79 | @@ -57,7 +57,7 @@ const NST::protocols::CIFSv1::MessageHeader* NST::protocols::CIFSv1::get_header( | |
80 | ||
81 | bool MessageHeader::isFlag(const Flags flag) const | |
82 | { | |
83 | - return static_cast<const uint8_t>(flag) & static_cast<const uint8_t>(flags); | |
84 | + return static_cast<uint8_t>(flag) & static_cast<uint8_t>(flags); | |
85 | } | |
86 | ||
87 | extern "C" NST_PUBLIC const char* print_cifs1_procedures(SMBv1Commands cmd_code) | |
88 | -- | |
89 | 2.20.1 | |
90 |