From fbd7c359ee10ca08fe3c7c95464fc054ea42a9b8 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 27 Aug 2016 13:45:33 +0100 Subject: 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. --- src/common/json_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common') 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)) \ -- cgit v1.2.3