The Road to Clang-Format part 3
Whitespace! Part Deux
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I2033813f12ab073bb57f4771e007126b0f8c7e26
diff --git a/src/register/hei_hardware_register.cpp b/src/register/hei_hardware_register.cpp
index 52dc28c..2337e4e 100755
--- a/src/register/hei_hardware_register.cpp
+++ b/src/register/hei_hardware_register.cpp
@@ -15,14 +15,14 @@
#if 0
void HardwareRegister::setBitString(const BitString *bs)
{
- BitString & l_string = accessBitString();
+ BitString& l_string = accessBitString();
l_string.setString(*bs);
}
#endif
//------------------------------------------------------------------------------
-const BitString * HardwareRegister::getBitString(const Chip & i_chip) const
+const BitString* HardwareRegister::getBitString(const Chip& i_chip) const
{
// Verify this register belongs on i_chip.
verifyAccessorChip(i_chip);
@@ -44,7 +44,7 @@
//------------------------------------------------------------------------------
-BitString & HardwareRegister::accessBitString(const Chip & i_chip)
+BitString& HardwareRegister::accessBitString(const Chip& i_chip)
{
// Verify this register belongs on i_chip.
verifyAccessorChip(i_chip);
@@ -66,7 +66,7 @@
//------------------------------------------------------------------------------
-ReturnCode HardwareRegister::read(const Chip & i_chip, bool i_force) const
+ReturnCode HardwareRegister::read(const Chip& i_chip, bool i_force) const
{
ReturnCode rc;
@@ -82,7 +82,7 @@
(REG_ACCESS_WO != getAccessLevel()));
// Get the buffer from the register cache.
- BitString & bs = accessCache(i_chip);
+ BitString& bs = accessCache(i_chip);
// Get the byte size of the buffer.
size_t sz_buffer = BitString::getMinBytes(bs.getBitLen());
@@ -111,7 +111,7 @@
#ifndef __HEI_READ_ONLY
-ReturnCode HardwareRegister::write(const Chip & i_chip) const
+ReturnCode HardwareRegister::write(const Chip& i_chip) const
{
ReturnCode rc;
@@ -126,7 +126,7 @@
HEI_ASSERT(queryCache(i_chip));
// Get the buffer from the register cache.
- BitString & bs = accessCache(i_chip);
+ BitString& bs = accessCache(i_chip);
// Get the byte size of the buffer.
size_t sz_buffer = BitString::getMinBytes(bs.getBitLen());
@@ -153,14 +153,14 @@
//------------------------------------------------------------------------------
-bool HardwareRegister::Cache::query(const Chip & i_chip,
- const HardwareRegister * i_hwReg) const
+bool HardwareRegister::Cache::query(const Chip& i_chip,
+ const HardwareRegister* i_hwReg) const
{
// Does i_chip exist in the cache?
auto chipPairItr = iv_cache.find(i_chip);
if (iv_cache.end() != chipPairItr)
{
- auto & hwRegMap = chipPairItr->second; // for ease of use
+ auto& hwRegMap = chipPairItr->second; // for ease of use
// Does i_hwReg exist in the cache?
auto hwRegPairItr = hwRegMap.find(i_hwReg);
@@ -175,13 +175,13 @@
//------------------------------------------------------------------------------
-BitString & HardwareRegister::Cache::access(const Chip & i_chip,
+BitString& HardwareRegister::Cache::access(const Chip& i_chip,
const HardwareRegister * i_hwReg)
{
// If the entry does not exist, create a new entry.
if (!query(i_chip, i_hwReg))
{
- BitString * bs = new BitStringBuffer { i_hwReg->getSize() * 8 };
+ BitString* bs = new BitStringBuffer { i_hwReg->getSize() * 8 };
iv_cache[i_chip][i_hwReg] = bs;
}
@@ -194,9 +194,9 @@
void HardwareRegister::Cache::flush()
{
// Delete all of the BitStrings.
- for (auto & chipPair : iv_cache)
+ for (auto& chipPair : iv_cache)
{
- for (auto & hwRegPair : chipPair.second)
+ for (auto& hwRegPair : chipPair.second)
{
delete hwRegPair.second;
}
@@ -211,14 +211,14 @@
//------------------------------------------------------------------------------
-void HardwareRegister::Cache::flush(const Chip & i_chip,
- const HardwareRegister * i_hwReg)
+void HardwareRegister::Cache::flush(const Chip& i_chip,
+ const HardwareRegister* i_hwReg)
{
// Does i_chip exist in the cache?
auto chipPairItr = iv_cache.find(i_chip);
if (iv_cache.end() != chipPairItr)
{
- auto & hwRegMap = chipPairItr->second; // for ease of use
+ auto& hwRegMap = chipPairItr->second; // for ease of use
// Does i_hwReg exist in the cache?
auto hwRegPairItr = hwRegMap.find(i_hwReg);
diff --git a/src/register/hei_hardware_register.hpp b/src/register/hei_hardware_register.hpp
index ab1c66e..059a9cf 100755
--- a/src/register/hei_hardware_register.hpp
+++ b/src/register/hei_hardware_register.hpp
@@ -102,7 +102,7 @@
public: // Operators
/** @brief Equals operator. */
- bool operator==(const HardwareRegister & i_r) const
+ bool operator==(const HardwareRegister& i_r) const
{
// Comparing register type, chip type, and address should be sufficient.
return (getRegisterType() == i_r.getRegisterType()) &&
@@ -111,7 +111,7 @@
}
/** @brief Less than operator. */
- bool operator<(const HardwareRegister & i_r) const
+ bool operator<(const HardwareRegister& i_r) const
{
// Comparing register type, chip type, and address should be sufficient.
if (getRegisterType() < i_r.getRegisterType())
@@ -136,7 +136,7 @@
public:
/** Function overloaded from parent Register class. */
- const BitString * getBitString(const Chip & i_chip) const;
+ const BitString* getBitString(const Chip& i_chip) const;
#if 0
/**
@@ -157,7 +157,7 @@
* read from hardware and update the cache.
* @return See the return code from the registerRead() user interface API.
*/
- ReturnCode read(const Chip & i_chip, bool i_force = false) const;
+ ReturnCode read(const Chip& i_chip, bool i_force = false) const;
#ifndef __HEI_READ_ONLY
@@ -167,7 +167,7 @@
* @param i_chip The target chip in which this register belongs.
* @return See the return code from the registerWrite() user interface API.
*/
- ReturnCode write(const Chip & i_chip) const;
+ ReturnCode write(const Chip& i_chip) const;
#endif // __HEI_READ_ONLY
@@ -182,12 +182,12 @@
* @param i_chip The target chip in which this register belongs.
* @return A reference to the BitString.
*/
- BitString & accessBitString(const Chip & i_chip);
+ BitString& accessBitString(const Chip& i_chip);
private: // Hardware accessor management functions.
/** @brief Asserts this register belongs on the target accessor chip. */
- void verifyAccessorChip(const Chip & i_chip) const
+ void verifyAccessorChip(const Chip& i_chip) const
{
HEI_ASSERT(getChipType() == i_chip.getType());
}
@@ -212,10 +212,10 @@
~Cache() = default;
/** @brief Copy constructor. */
- Cache(const Cache &) = delete;
+ Cache(const Cache&) = delete;
/** @brief Assignment operator. */
- Cache & operator=(const Cache &) = delete;
+ Cache& operator=(const Cache&) = delete;
/**
* @brief Queries if a specific entry exists in the cache.
@@ -223,8 +223,8 @@
* @param i_hwReg The target register.
* @return True if the entry exists, false otherwise.
*/
- bool query(const Chip & i_chip,
- const HardwareRegister * i_hwReg) const;
+ bool query(const Chip& i_chip,
+ const HardwareRegister* i_hwReg) const;
/**
* @brief Returns the data buffer for the given chip and register.
@@ -234,8 +234,8 @@
* @note If an entry does not exist in the cache, an entry will be
* created and the BitString will be initialized to 0.
*/
- BitString & access(const Chip & i_chip,
- const HardwareRegister * i_hwReg);
+ BitString& access(const Chip& i_chip,
+ const HardwareRegister* i_hwReg);
/** @brief Flushes entire contents from cache. */
void flush();
@@ -245,7 +245,7 @@
* @param i_chip The target chip.
* @param i_hwReg The target register.
*/
- void flush(const Chip & i_chip, const HardwareRegister * i_hwReg);
+ void flush(const Chip& i_chip, const HardwareRegister* i_hwReg);
private:
@@ -279,7 +279,7 @@
* @brief Flushes this register from the cache.
* @param i_chip The target chip in which this register belongs.
*/
- void flush(const Chip & i_chip) const
+ void flush(const Chip& i_chip) const
{
cv_cache.flush(i_chip, this);
}
@@ -290,7 +290,7 @@
* @param i_chip The target chip in which this register belongs.
* @return True if an entry for this register exist in this cache.
*/
- bool queryCache(const Chip & i_chip) const
+ bool queryCache(const Chip& i_chip) const
{
return cv_cache.query(i_chip, this);
}
@@ -299,7 +299,7 @@
* @param i_chip The target chip in which this register belongs.
* @return A reference to this register's BitString in cache.
*/
- BitString & accessCache(const Chip & i_chip) const
+ BitString& accessCache(const Chip& i_chip) const
{
return cv_cache.access(i_chip, this);
}
diff --git a/src/register/hei_register.hpp b/src/register/hei_register.hpp
index 4514c28..4b5c5fe 100755
--- a/src/register/hei_register.hpp
+++ b/src/register/hei_register.hpp
@@ -37,7 +37,7 @@
* @param i_chip Indicates which chip to access for this register.
* @return A BitString containing the value of this register.
*/
- virtual const BitString * getBitString(const Chip & i_chip) const = 0;
+ virtual const BitString* getBitString(const Chip& i_chip) const = 0;
};
// Pure virtual destructor must be defined.
diff --git a/src/register/hei_scom_register.hpp b/src/register/hei_scom_register.hpp
index c90d5be..d056475 100644
--- a/src/register/hei_scom_register.hpp
+++ b/src/register/hei_scom_register.hpp
@@ -46,7 +46,7 @@
*
* Needed by Flyweight class, but should not be allowed in general.
*/
- ScomRegister(const ScomRegister &) = default;
+ ScomRegister(const ScomRegister&) = default;
/**
* @brief Explicitly disables assignment operator.
@@ -55,7 +55,7 @@
* of the constant instance variables, but helps communicate it is not
* allowed.
*/
- ScomRegister & operator=(const ScomRegister &) = delete;
+ ScomRegister& operator=(const ScomRegister&) = delete;
public: // Accessor functions
@@ -125,7 +125,7 @@
*
* Needed by Flyweight class, but should not be allowed in general.
*/
- IdScomRegister(const IdScomRegister &) = default;
+ IdScomRegister(const IdScomRegister&) = default;
/**
* @brief Explicitly disables assignment operator.
@@ -134,7 +134,7 @@
* of the constant instance variables, but helps communicate it is not
* allowed.
*/
- IdScomRegister & operator=(const IdScomRegister &) = delete;
+ IdScomRegister& operator=(const IdScomRegister&) = delete;
public: // Accessor functions