aboutsummaryrefslogtreecommitdiff
path: root/src/common/json_util.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-27 13:45:33 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-28 21:30:44 +0100
commitfbd7c359ee10ca08fe3c7c95464fc054ea42a9b8 (patch)
treea85e7285ce2a8e65f9475e46b29bd1bdf5d83a73 /src/common/json_util.h
parentwallet: do not generate 0 change (diff)
downloadmonero-fbd7c359ee10ca08fe3c7c95464fc054ea42a9b8.tar.xz
wallet: fix some "may be used uninitialized" warnings
The compiler can't always work out the _found booleans are set iff the value is initialized.
Diffstat (limited to 'src/common/json_util.h')
-rw-r--r--src/common/json_util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/json_util.h b/src/common/json_util.h
index 6f8b4c18f..45046a4fb 100644
--- a/src/common/json_util.h
+++ b/src/common/json_util.h
@@ -28,8 +28,8 @@
#pragma once
-#define GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, name, type, jtype, mandatory) \
- type field_##name; \
+#define GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, name, type, jtype, mandatory, def) \
+ type field_##name = def; \
bool field_##name##_found = false; \
(void)field_##name##_found; \
do if (json.HasMember(#name)) \