diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2016-06-07 16:35:33 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-06-09 15:27:28 -0400 |
commit | 355d93543e9d9dfcf84096c02049f54fcab003ea (patch) | |
tree | 648e1e4071981c0fa605763967788eb859cd9abd | |
parent | eb94922ec70b66d3ee721988507fa31e6f5ee628 (diff) | |
download | talos-hostboot-355d93543e9d9dfcf84096c02049f54fcab003ea.tar.gz talos-hostboot-355d93543e9d9dfcf84096c02049f54fcab003ea.zip |
Add explicit RC checkers to ReturnCode class
We encountered compiler errors trying to do seemingly normal
comparisons that hit the operator overloads. It required some
non-ideal casting operations to make it work. These new
functions push all of the casting logic into the class where
it belongs.
Change-Id: I566f12acbd698a625848514399aca1b7ec233496
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25473
Reviewed-by: Brian R. Silver <bsilver@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Tested-by: PPE CI
Tested-by: Hostboot CI
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25505
Tested-by: FSP CI Jenkins
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r-- | src/import/hwpf/fapi2/include/return_code.H | 21 | ||||
-rw-r--r-- | src/import/hwpf/fapi2/include/return_code_defs.H | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/import/hwpf/fapi2/include/return_code.H b/src/import/hwpf/fapi2/include/return_code.H index 669266222..46ecac6c3 100644 --- a/src/import/hwpf/fapi2/include/return_code.H +++ b/src/import/hwpf/fapi2/include/return_code.H @@ -138,6 +138,27 @@ class ReturnCode : public FirstFailureData<ReturnCode> return l_creator; } + + /// + /// @brief explicit check for RC value + /// @return true if this instance has a matching RC + /// + inline bool isRC(const ReturnCodes i_rc) const + { + return static_cast<uint32_t>(i_rc) == iv_rc; + } + + + /// + /// @brief explicit check for RC value + /// @return true if this instance has a matching RC + /// + inline bool isRC(const uint32_t i_rc) const + { + return i_rc == iv_rc; + } + + private: uint32_t iv_rc; }; diff --git a/src/import/hwpf/fapi2/include/return_code_defs.H b/src/import/hwpf/fapi2/include/return_code_defs.H index 80dfdfba7..72fdc2017 100644 --- a/src/import/hwpf/fapi2/include/return_code_defs.H +++ b/src/import/hwpf/fapi2/include/return_code_defs.H @@ -55,7 +55,7 @@ namespace fapi2 /// /// @brief Enumeration of return codes /// -enum ReturnCodes +enum ReturnCodes : uint32_t { ///< Success FAPI2_RC_SUCCESS = 0, |