aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-01-18 01:05:58 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-04 22:38:03 +0000
commite396146aeebd61d6a26003045d554f6e94d5f028 (patch)
treed0abbc7b2feb1325435c149c9f9309063e9fc670 /contrib/epee/include
parentvarious: remove unused variables (diff)
downloadmonero-e396146aeebd61d6a26003045d554f6e94d5f028.tar.xz
default initialize rpc structures
Diffstat (limited to 'contrib/epee/include')
-rw-r--r--contrib/epee/include/misc_language.h5
-rw-r--r--contrib/epee/include/net/jsonrpc_structs.h14
2 files changed, 19 insertions, 0 deletions
diff --git a/contrib/epee/include/misc_language.h b/contrib/epee/include/misc_language.h
index 7e4eb337d..5f7202150 100644
--- a/contrib/epee/include/misc_language.h
+++ b/contrib/epee/include/misc_language.h
@@ -159,5 +159,10 @@ namespace misc_utils
return slc;
}
+ template<typename T> struct struct_init: T
+ {
+ struct_init(): T{} {}
+ };
+
}
}
diff --git a/contrib/epee/include/net/jsonrpc_structs.h b/contrib/epee/include/net/jsonrpc_structs.h
index 9df9e2596..b61c369f2 100644
--- a/contrib/epee/include/net/jsonrpc_structs.h
+++ b/contrib/epee/include/net/jsonrpc_structs.h
@@ -18,6 +18,8 @@ namespace epee
epee::serialization::storage_entry id;
t_param params;
+ request(): id{}, params{} {}
+
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(jsonrpc)
KV_SERIALIZE(id)
@@ -30,6 +32,9 @@ namespace epee
{
int64_t code;
std::string message;
+
+ error(): code(0) {}
+
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(code)
KV_SERIALIZE(message)
@@ -55,6 +60,9 @@ namespace epee
t_param result;
epee::serialization::storage_entry id;
t_error error;
+
+ response(): result{}, id(), error{} {}
+
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(jsonrpc)
KV_SERIALIZE(id)
@@ -69,6 +77,9 @@ namespace epee
std::string jsonrpc;
t_param result;
epee::serialization::storage_entry id;
+
+ response(): result{}, id{} {}
+
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(jsonrpc)
KV_SERIALIZE(id)
@@ -82,6 +93,9 @@ namespace epee
std::string jsonrpc;
t_error error;
epee::serialization::storage_entry id;
+
+ response(): error{}, id{} {}
+
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(jsonrpc)
KV_SERIALIZE(id)