diff options
author | Thi Tran <thi@us.ibm.com> | 2015-06-18 16:02:39 -0500 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2015-12-11 13:40:20 -0600 |
commit | 1688000e1117326d861d9dd70b211d30382baf24 (patch) | |
tree | 477deb3f172b932b7b8ce870723415c5800d18cb /src/import | |
parent | e792e4f2aefca1bfbad6c64f6fc76643d85d9cc7 (diff) | |
download | talos-hostboot-1688000e1117326d861d9dd70b211d30382baf24.tar.gz talos-hostboot-1688000e1117326d861d9dd70b211d30382baf24.zip |
Reverse class ReturnCode bool() logic
Change-Id: I8cc814fb2614b524434362d49132eb4d0e6a5ef9
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/18609
Tested-by: Jenkins Server
Reviewed-by: Matt K. Light <mklight@us.ibm.com>
Reviewed-by: Brian Silver <bsilver@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/hwpf/fapi2/include/return_code.H | 86 |
1 files changed, 47 insertions, 39 deletions
diff --git a/src/import/hwpf/fapi2/include/return_code.H b/src/import/hwpf/fapi2/include/return_code.H index 2d84ba126..2f8f3460c 100644 --- a/src/import/hwpf/fapi2/include/return_code.H +++ b/src/import/hwpf/fapi2/include/return_code.H @@ -1,25 +1,19 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: $ */ +/* $Source: hwpf/fapi2/include/return_code.H $ */ /* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ -/* [+] International Business Machines Corp. */ +/* IBM CONFIDENTIAL */ /* */ +/* EKB Project */ /* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ +/* COPYRIGHT 2012,2015 */ +/* [+] International Business Machines Corp. */ /* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ /* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ /* */ /* IBM_PROLOG_END_TAG */ /** @@ -33,22 +27,22 @@ #include <stdint.h> #ifndef FAPI2_NO_FFDC - #include <ffdc.H> + #include <ffdc.H> #endif namespace fapi2 { - /// - /// @brief Class representing a FAPI2 ReturnCode - /// - // Remove the inheritance relationship with FirstFailureData if - // the platform doesn't support FFDC. +/// +/// @brief Class representing a FAPI2 ReturnCode +/// +// Remove the inheritance relationship with FirstFailureData if +// the platform doesn't support FFDC. #ifdef FAPI2_NO_FFDC - class ReturnCode +class ReturnCode #else - class ReturnCode : public FirstFailureData<ReturnCode> +class ReturnCode : public FirstFailureData<ReturnCode> #endif - { +{ public: /// @@ -57,50 +51,64 @@ namespace fapi2 /// ReturnCode(const uint64_t i_rc = FAPI2_RC_SUCCESS): iv_rc(i_rc) - {}; + {}; /// /// @brief integral type conversion function. Returns the error code /// @return The error code /// - inline operator uint64_t() const { return iv_rc; } + inline operator uint64_t() const + { + return iv_rc; + } /// /// @brief Returns true iff iv_rc == SUCCESS /// @return true or false /// - inline operator bool() const { return iv_rc == FAPI2_RC_SUCCESS; } + inline operator bool() const + { + return iv_rc != FAPI2_RC_SUCCESS; + } /// /// @brief Assignement operator /// -#ifdef DOXYGEN + #ifdef DOXYGEN inline ReturnCode& operator=(const uint64_t& rhs) inline ReturnCode& operator=(const ReturnCodes& rhs) -#endif + #endif inline bool operator==(const uint64_t& rhs) const - { return rhs == iv_rc; } + { + return rhs == iv_rc; + } inline bool operator==(const ReturnCodes& rhs) const - { return rhs == iv_rc; } + { + return rhs == iv_rc; + } inline bool operator!=(const uint64_t& rhs) const - { return rhs != iv_rc; } + { + return rhs != iv_rc; + } inline bool operator!=(const ReturnCodes& rhs) const - { return rhs != iv_rc; } + { + return rhs != iv_rc; + } private: uint64_t iv_rc; - }; +}; - /// This implementation assumes no exception handling and leverages thread-local - /// storage. For platforms without thread support, a global variable will - /// suffice for the error state. - extern thread_local ReturnCode current_err; /// the current error state - extern thread_local uint64_t pib_error_mask; /// the pib mask - extern thread_local uint64_t operational_state; /// the operational mode +/// This implementation assumes no exception handling and leverages thread-local +/// storage. For platforms without thread support, a global variable will +/// suffice for the error state. +extern thread_local ReturnCode current_err; /// the current error state +extern thread_local uint64_t pib_error_mask; /// the pib mask +extern thread_local uint64_t operational_state; /// the operational mode } #endif |