diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2016-06-07 16:35:33 -0500 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2016-06-13 10:07:04 -0400 |
commit | 6811a617c0d771ddf7bec06df6cfc18d7a1ca978 (patch) | |
tree | fe0fb6f95dea6718ca19739e9c6d33af5eb1b792 /import/hwpf | |
parent | 700cc43c51a84f302fcffbd327caff9c87d946ca (diff) | |
download | talos-sbe-6811a617c0d771ddf7bec06df6cfc18d7a1ca978.tar.gz talos-sbe-6811a617c0d771ddf7bec06df6cfc18d7a1ca978.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/25504
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'import/hwpf')
-rw-r--r-- | import/hwpf/fapi2/include/return_code.H | 21 | ||||
-rw-r--r-- | import/hwpf/fapi2/include/return_code_defs.H | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/import/hwpf/fapi2/include/return_code.H b/import/hwpf/fapi2/include/return_code.H index 66926622..46ecac6c 100644 --- a/import/hwpf/fapi2/include/return_code.H +++ b/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/import/hwpf/fapi2/include/return_code_defs.H b/import/hwpf/fapi2/include/return_code_defs.H index 80dfdfba..72fdc201 100644 --- a/import/hwpf/fapi2/include/return_code_defs.H +++ b/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, |