The Road to Clang-Format part 5
Whitespace: With a Vengeance
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I706a599c8c0dc159a0205c7c8cb2d3b7cbb7213f
diff --git a/src/util/hei_bit_string.cpp b/src/util/hei_bit_string.cpp
index 39a585c..dc72a5b 100755
--- a/src/util/hei_bit_string.cpp
+++ b/src/util/hei_bit_string.cpp
@@ -136,7 +136,7 @@
// could be used in the constructor of BitStringBuffer, which could causes
// an infinite loop.
uint8_t a[sizeof(i_pattern)] = {};
- BitString bs { sizeof(i_pattern) * 8, a };
+ BitString bs{sizeof(i_pattern) * 8, a};
bs.setFieldRight(0, i_pLen, i_pattern);
// Iterate the range in chunks the size of i_pLen.
@@ -351,7 +351,7 @@
if (i_shift < getBitLen())
{
// bso overlays bsb, containing the shifted offset.
- BitString bso (bsb.getBitLen() - i_shift, bsb.getBufAddr(), i_shift);
+ BitString bso(bsb.getBitLen() - i_shift, bsb.getBufAddr(), i_shift);
// Copy this into bso.
bso.setString(*this);
@@ -369,8 +369,7 @@
if (i_shift < getBitLen())
{
// bso overlays *this, containing the shifted offset.
- BitString bso (this->getBitLen() - i_shift, this->getBufAddr(),
- i_shift);
+ BitString bso(this->getBitLen() - i_shift, this->getBufAddr(), i_shift);
// Copy bso into bsb.
bsb.setString(bso);
@@ -406,7 +405,7 @@
BitStringBuffer::~BitStringBuffer()
{
- delete [] (uint8_t*)getBufAddr();
+ delete[](uint8_t*) getBufAddr();
}
//------------------------------------------------------------------------------
@@ -439,7 +438,7 @@
{
// The initBuffer() function will deallocate the buffer as well, however we
// also need to deallocate the buffer here before we set the length.
- delete [] (uint8_t*)getBufAddr();
+ delete[](uint8_t*) getBufAddr();
setBufAddr(nullptr);
setBitLen(i_bs.getBitLen());
@@ -460,7 +459,7 @@
{
// The initBuffer() function will deallocate the buffer as well, however
// we also need to deallocate the buffer here before we set the length.
- delete [] (uint8_t*)getBufAddr();
+ delete[](uint8_t*) getBufAddr();
setBufAddr(nullptr);
setBitLen(i_bsb.getBitLen());
@@ -479,10 +478,10 @@
void BitStringBuffer::initBuffer()
{
// Deallocate the current buffer.
- delete [] (uint8_t*)getBufAddr();
+ delete[](uint8_t*) getBufAddr();
// create new buffer, initialized to 0's
- setBufAddr(new uint8_t[ getMinBytes(getBitLen()) ]());
+ setBufAddr(new uint8_t[getMinBytes(getBitLen())]());
}
} // end namespace libhei
diff --git a/src/util/hei_bit_string.hpp b/src/util/hei_bit_string.hpp
index 6229441..80f13af 100755
--- a/src/util/hei_bit_string.hpp
+++ b/src/util/hei_bit_string.hpp
@@ -59,12 +59,10 @@
class BitString
{
private: // constants
-
static const uint64_t UINT64_BIT_LEN;
static const uint64_t UINT8_BIT_LEN;
public: // functions
-
/**
* @brief Constructor
* @param i_bitLen The number of bits in the bit string.
@@ -375,7 +373,6 @@
BitString(const BitStringBuffer& i_bsb) = delete;
protected: // functions
-
/**
* @param i_newBufAddr The starting address of the new bit string buffer.
* @pre Before calling this function, make sure you deallocate the old
@@ -393,7 +390,6 @@
}
private: // functions
-
/**
* @brief Given a bit position within the bit string, this function returns
* the address that contains the bit position and the bit position
@@ -407,7 +403,6 @@
uint8_t* getRelativePosition(uint64_t& o_relPos, uint64_t i_absPos) const;
private: // instance variables
-
uint64_t iv_bitLen; ///< The bit length of this buffer.
void* iv_bufAddr; ///< The beginning address of this buffer.
uint64_t iv_offset; ///< Start position offset
@@ -425,7 +420,6 @@
class BitStringBuffer : public BitString
{
public: // functions
-
/**
* @brief Constructor
* @param i_bitLen Number of bits in the string.
@@ -448,7 +442,6 @@
BitStringBuffer& operator=(const BitStringBuffer& i_bsb);
private: // functions
-
/** @brief Deallocates the old buffer, if needed, and initializes the new
* buffer. */
void initBuffer();
diff --git a/src/util/hei_flyweight.hpp b/src/util/hei_flyweight.hpp
index 4aeb952..437dcad 100644
--- a/src/util/hei_flyweight.hpp
+++ b/src/util/hei_flyweight.hpp
@@ -13,7 +13,6 @@
class Flyweight
{
private: // This class cannot be instantiated. Use getSingleton() instead.
-
/** @brief Default constructor. */
Flyweight() = default;
@@ -30,7 +29,6 @@
Flyweight& operator=(const Flyweight&) = delete;
public:
-
/** @brief Provides access to a singleton instance of this object. */
static Flyweight& getSingleton()
{
@@ -58,7 +56,7 @@
if (iv_index.end() == itr || !(i_entry == *(*itr)))
{
// Create a new entry and store the pointer in the sorted index.
- itr = iv_index.insert(itr, new T { i_entry });
+ itr = iv_index.insert(itr, new T{i_entry});
}
// Return a reference to this entry in the factory.
@@ -95,7 +93,6 @@
}
private:
-
/**
* Each new T is allocated on the memory heap and a pointer to each of those
* objects is stored in this vector. The vector will not contain duplicates