summaryrefslogtreecommitdiffstats
path: root/edify
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-10-05 21:06:49 +0200
committerTao Bao <tbao@google.com>2017-10-05 21:46:18 +0200
commit0bf20d51336aef08850d0152a6e1501f4b733cf6 (patch)
tree457ff3c86c54dc30219977faeb23fa42022d1a5e /edify
parentMerge "graphics: add rotation logic" (diff)
downloadandroid_bootable_recovery-0bf20d51336aef08850d0152a6e1501f4b733cf6.tar
android_bootable_recovery-0bf20d51336aef08850d0152a6e1501f4b733cf6.tar.gz
android_bootable_recovery-0bf20d51336aef08850d0152a6e1501f4b733cf6.tar.bz2
android_bootable_recovery-0bf20d51336aef08850d0152a6e1501f4b733cf6.tar.lz
android_bootable_recovery-0bf20d51336aef08850d0152a6e1501f4b733cf6.tar.xz
android_bootable_recovery-0bf20d51336aef08850d0152a6e1501f4b733cf6.tar.zst
android_bootable_recovery-0bf20d51336aef08850d0152a6e1501f4b733cf6.zip
Diffstat (limited to 'edify')
-rw-r--r--edify/expr.cpp9
-rw-r--r--edify/expr.h38
2 files changed, 24 insertions, 23 deletions
diff --git a/edify/expr.cpp b/edify/expr.cpp
index 54ab3325c..403162d6d 100644
--- a/edify/expr.cpp
+++ b/edify/expr.cpp
@@ -31,6 +31,8 @@
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
+#include "error_code.h"
+
// Functions should:
//
// - return a malloc()'d string
@@ -416,8 +418,5 @@ Value* ErrorAbort(State* state, CauseCode cause_code, const char* format, ...) {
return nullptr;
}
-State::State(const std::string& script, void* cookie) :
- script(script),
- cookie(cookie) {
-}
-
+State::State(const std::string& script, void* cookie)
+ : script(script), cookie(cookie), error_code(kNoError), cause_code(kNoCause) {}
diff --git a/edify/expr.h b/edify/expr.h
index 4838d20c0..32828028a 100644
--- a/edify/expr.h
+++ b/edify/expr.h
@@ -23,32 +23,34 @@
#include <string>
#include <vector>
-#include "error_code.h"
+// Forward declaration to avoid including "error_code.h".
+enum ErrorCode : int;
+enum CauseCode : int;
struct State {
- State(const std::string& script, void* cookie);
+ State(const std::string& script, void* cookie);
- // The source of the original script.
- const std::string& script;
+ // The source of the original script.
+ const std::string& script;
- // Optional pointer to app-specific data; the core of edify never
- // uses this value.
- void* cookie;
+ // Optional pointer to app-specific data; the core of edify never
+ // uses this value.
+ void* cookie;
- // The error message (if any) returned if the evaluation aborts.
- // Should be empty initially, will be either empty or a string that
- // Evaluate() returns.
- std::string errmsg;
+ // The error message (if any) returned if the evaluation aborts.
+ // Should be empty initially, will be either empty or a string that
+ // Evaluate() returns.
+ std::string errmsg;
- // error code indicates the type of failure (e.g. failure to update system image)
- // during the OTA process.
- ErrorCode error_code = kNoError;
+ // error code indicates the type of failure (e.g. failure to update system image)
+ // during the OTA process.
+ ErrorCode error_code;
- // cause code provides more detailed reason of an OTA failure (e.g. fsync error)
- // in addition to the error code.
- CauseCode cause_code = kNoCause;
+ // cause code provides more detailed reason of an OTA failure (e.g. fsync error)
+ // in addition to the error code.
+ CauseCode cause_code;
- bool is_retry = false;
+ bool is_retry = false;
};
enum ValueType {