[devel_3.0_main] Cherry-pick Beautification of source-code. 80383
[platform/framework/native/appfw.git] / src / base / FBaseBufferBase.cpp
index 38b5cc6..e4b1a88 100644 (file)
  * @file               FBaseBufferBase.cpp
  * @brief              This is the implementation for BufferBase class.
  */
-
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
 #include <FBaseBufferBase.h>
 #include <FBaseSysLog.h>
 
-
 namespace Tizen { namespace Base
 {
 
@@ -59,18 +57,18 @@ BufferBase::Construct(int capacity)
        void* pTemp = null;
 
        // check whether the size of memory is larger than the maximum of unsigned int
-       unsigned long long size = static_cast <unsigned long long>(sizeof(_BufferData)) +
-               static_cast <unsigned long long>(capacity) * static_cast <unsigned long long>(GetTypeSize());
-       SysTryReturnResult(NID_BASE, size <= static_cast <unsigned long long>((unsigned int) -1), E_OUT_OF_MEMORY,
+       unsigned long long size = static_cast< unsigned long long >(sizeof(_BufferData)) +
+               static_cast< unsigned long long >(capacity) * static_cast< unsigned long long >(GetTypeSize());
+       SysTryReturnResult(NID_BASE, size <= static_cast< unsigned long long >((unsigned int) -1), E_OUT_OF_MEMORY,
                "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       pTemp = malloc(static_cast <unsigned int>(size));
+       pTemp = malloc(static_cast< unsigned int >(size));
        SysTryReturnResult(NID_BASE, 0 != pTemp, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",
                GetErrorMessage(E_OUT_OF_MEMORY));
 
-       memset(pTemp, 0, static_cast <unsigned int>(size));
+       memset(pTemp, 0, static_cast< unsigned int >(size));
 
-       _pData = static_cast <_BufferData*>(pTemp);
+       _pData = static_cast< _BufferData* >(pTemp);
 
        _pData->refCount = 1;
        _pData->capacityInByte = capacity * GetTypeSize();
@@ -261,13 +259,13 @@ BufferBase::ExpandCapacity(int newCapacity)
                "The capacity is less than the current capacity.");
 
        // check whether the size of memory is larger than the maximum of unsigned int
-       unsigned long long size = static_cast <unsigned long long>(sizeof(_BufferData)) +
-               static_cast <unsigned long long>(newCapacity) * static_cast <unsigned long long>(GetTypeSize());
+       unsigned long long size = static_cast< unsigned long long >(sizeof(_BufferData)) +
+               static_cast< unsigned long long >(newCapacity) * static_cast< unsigned long long >(GetTypeSize());
 
-       SysTryReturnResult(NID_BASE, size <= static_cast <unsigned long long>((unsigned int) -1), E_OUT_OF_MEMORY,
+       SysTryReturnResult(NID_BASE, size <= static_cast< unsigned long long >((unsigned int) -1), E_OUT_OF_MEMORY,
                "Memory allocation failed.");
 
-       _pData = static_cast<_BufferData*>(realloc(_pData, static_cast<unsigned int>(size)));
+       _pData = static_cast< _BufferData* >(realloc(_pData, static_cast< unsigned int >(size)));
        SysTryReturnResult(NID_BASE, 0 != _pData, E_OUT_OF_MEMORY, "Memory allocation failed.");
 
        _capacity = newCapacity;
@@ -304,8 +302,8 @@ BufferBase::Dispose(void)
 }
 
 BufferBase::_BufferData::_BufferData()
-       :capacityInByte(0)
-       ,refCount(0)
+       : capacityInByte(0)
+       , refCount(0)
 {
 }
 
@@ -316,7 +314,7 @@ BufferBase::_BufferData::~_BufferData()
 byte*
 BufferBase::_BufferData::GetArray(void)
 {
-       return reinterpret_cast <byte*>(this + 1);
+       return reinterpret_cast< byte* >(this + 1);
 }
 
 }} // Tizen::Base