From aced5d9e4e438ba478ce54f9217166b8ab7cc24f Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Wed, 12 Oct 2016 10:55:04 -0700 Subject: Change StringValue to use std::string Changing the field of 'Value' in edify to std::string from char*. Meanwhile cleaning up the users of 'Value' and switching them to cpp style. Test: compontent tests passed. Bug: 31713288 Change-Id: Iec5a7d601b1e4ca40935bf1c70d325dafecec235 --- edify/edify_parser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'edify/edify_parser.cpp') diff --git a/edify/edify_parser.cpp b/edify/edify_parser.cpp index 1b89cf21d..908fcf13b 100644 --- a/edify/edify_parser.cpp +++ b/edify/edify_parser.cpp @@ -66,12 +66,12 @@ int main(int argc, char** argv) { ExprDump(0, root, buffer); State state(buffer, nullptr); - char* result = Evaluate(&state, root); - if (result == NULL) { + std::string result; + if (!Evaluate(&state, root, &result)) { printf("result was NULL, message is: %s\n", (state.errmsg.empty() ? "(NULL)" : state.errmsg.c_str())); } else { - printf("result is [%s]\n", result); + printf("result is [%s]\n", result.c_str()); } } return 0; -- cgit v1.2.3