Kaydet (Commit) d39d80a5 authored tarafından Alexander Wilms's avatar Alexander Wilms Kaydeden (comit) Stephan Bergmann

Remove visual noise from store

Change-Id: I6753eb480618af747ecf4a3ae3c666257761ce70
Reviewed-on: https://gerrit.libreoffice.org/8317Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst a463234e
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "lockbyte.hxx"
#include "sal/types.h"
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "object.hxx"
#include "sal/types.h"
......
......@@ -45,7 +45,6 @@ protected:
~IStoreHandle() {}
};
/** Template helper function as dynamic_cast replacement.
*/
template<class store_handle_type>
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "storbase.hxx"
#include "sal/types.h"
......
......@@ -884,7 +884,6 @@ public:
return store_E_None;
}
PageHolder & get() { return m_xPage; }
PageHolder const & get() const { return m_xPage; }
......
......@@ -36,12 +36,7 @@
using namespace store;
/*========================================================================
*
* PageCache (non-virtual interface) implementation.
*
*======================================================================*/
// PageCache (non-virtual interface) implementation.
storeError PageCache::lookupPageAt (PageHolder & rxPage, sal_uInt32 nOffset)
{
OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::PageCache::lookupPageAt(): invalid Offset");
......@@ -100,45 +95,33 @@ storeError PageCache::removePageAt (sal_uInt32 nOffset)
return removePageAt_Impl (nOffset);
}
/*========================================================================
*
* Entry.
*
*======================================================================*/
// Entry
namespace
{
struct Entry
{
/** Representation.
*/
// Representation
PageHolder m_xPage;
sal_uInt32 m_nOffset;
Entry * m_pNext;
/** Allocation.
*/
// Allocation
static void * operator new (size_t, void * p) { return p; }
static void operator delete (void *, void *) {}
/** Construction.
*/
// Construction
explicit Entry (PageHolder const & rxPage = PageHolder(), sal_uInt32 nOffset = STORE_PAGE_NULL)
: m_xPage(rxPage), m_nOffset(nOffset), m_pNext(0)
{}
/** Destruction.
*/
// Destruction
~Entry() {}
};
} // namespace
/*========================================================================
*
* EntryCache interface.
*
*======================================================================*/
// EntryCache interface
namespace
{
......@@ -160,12 +143,7 @@ protected:
} // namespace
/*========================================================================
*
* EntryCache implementation.
*
*======================================================================*/
// EntryCache implementation
EntryCache & EntryCache::get()
{
static EntryCache g_entry_cache;
......@@ -197,7 +175,7 @@ Entry * EntryCache::create (PageHolder const & rxPage, sal_uInt32 nOffset)
void * pAddr = rtl_cache_alloc (m_entry_cache);
if (pAddr != 0)
{
// construct.
// construct
return new(pAddr) Entry (rxPage, nOffset);
}
return 0;
......@@ -207,19 +185,15 @@ void EntryCache::destroy (Entry * entry)
{
if (entry != 0)
{
// destruct.
// destruct
entry->~Entry();
// return to cache.
// return to cache
rtl_cache_free (m_entry_cache, entry);
}
}
/*========================================================================
*
* highbit():= log2() + 1 (complexity O(1))
*
*======================================================================*/
// highbit():= log2() + 1 (complexity O(1))
static int highbit(sal_Size n)
{
int k = 1;
......@@ -244,11 +218,7 @@ static int highbit(sal_Size n)
return (k);
}
/*========================================================================
*
* PageCache_Impl implementation.
*
*======================================================================*/
//PageCache_Impl implementation
namespace store
{
......@@ -256,8 +226,7 @@ class PageCache_Impl :
public store::OStoreObject,
public store::PageCache
{
/** Representation.
*/
// Representation
static size_t const theTableSize = 32;
BOOST_STATIC_ASSERT(STORE_IMPL_ISP2(theTableSize));
......@@ -283,8 +252,7 @@ class PageCache_Impl :
Entry * lookup_Impl (Entry * entry, sal_uInt32 nOffset);
void rescale_Impl (sal_Size new_size);
/** PageCache Implementation.
*/
// PageCache Implementation
virtual storeError lookupPageAt_Impl (
PageHolder & rxPage,
sal_uInt32 nOffset);
......@@ -300,24 +268,20 @@ class PageCache_Impl :
virtual storeError removePageAt_Impl (
sal_uInt32 nOffset);
/** Not implemented.
*/
// Not implemented
PageCache_Impl (PageCache_Impl const &);
PageCache_Impl & operator= (PageCache_Impl const &);
public:
/** Construction.
*/
// Construction
explicit PageCache_Impl (sal_uInt16 nPageSize);
/** Delegate multiple inherited IReference.
*/
// Delegate multiple inherited IReference
virtual oslInterlockedCount SAL_CALL acquire();
virtual oslInterlockedCount SAL_CALL release();
protected:
/** Destruction.
*/
// Destruction
virtual ~PageCache_Impl (void);
};
......@@ -412,7 +376,7 @@ void PageCache_Impl::rescale_Impl (sal_Size new_size)
}
if (old_table != m_hash_table_0)
{
//
rtl_freeMemory (old_table);
}
}
......@@ -520,20 +484,20 @@ storeError PageCache_Impl::removePageAt_Impl (
return store_E_NotExists;
}
/*========================================================================
/*
*
* Old OStorePageCache implementation.
*
* (two-way association (sorted address array, LRU chain)).
* (external OStorePageData representation).
*
*======================================================================*/
*/
/*========================================================================
/*
*
* PageCache factory implementation.
*
*======================================================================*/
*/
namespace store {
storeError
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "stordata.hxx"
#include "sal/types.h"
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "stordir.hxx"
#include <sal/types.h>
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "store/store.h"
#include <sal/types.h>
......@@ -55,7 +54,6 @@ public:
};
}
using namespace store;
/*========================================================================
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "storlckb.hxx"
#include "sal/types.h"
......@@ -101,7 +100,6 @@ storeError OStoreLockBytes::create (
return store_E_NotFile;
}
// ...
inode_holder_type xNode (aPage.get());
if (eMode != store_AccessReadOnly)
eErrCode = xManager->acquirePage (xNode->m_aDescr, store_AccessReadWrite);
......@@ -110,7 +108,6 @@ storeError OStoreLockBytes::create (
if (eErrCode != store_E_None)
return eErrCode;
// ...
m_xManager = xManager;
m_xNode = xNode;
m_bWriteable = (eMode != store_AccessReadOnly);
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "storpage.hxx"
#include "sal/types.h"
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "stortree.hxx"
#include "sal/types.h"
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <string.h>
#include "sal/types.h"
#include "osl/diagnose.h"
......@@ -237,7 +236,7 @@ struct MyFindData
static void __store_testUnicode (const sal_Char *pszFilename)
{
// ...
rtl_TextToUnicodeConverter hConvert;
hConvert = rtl_createTextToUnicodeConverter (RTL_TEXTENCODING_UTF8);
......@@ -255,13 +254,11 @@ static void __store_testUnicode (const sal_Char *pszFilename)
rtl_destroyTextToUnicodeConverter (hConvert);
// ...
rtl_String *pszFileA = NULL;
rtl_uString *pszFileW = NULL;
// rtl_uString_newFromAscii (&pszFileW, pszFilename);
// ...
rtl_string_newFromStr (&pszFileA, pszFilename);
rtl_string2UString (
......@@ -272,11 +269,9 @@ static void __store_testUnicode (const sal_Char *pszFilename)
rtl_string_release (pszFileA);
// ...
OStorePageKey aKey;
__store_namei (pszFileW->buffer, pszFileW->buffer, aKey);
// ...
rtl_uString2String (
&pszFileA,
pszFileW->buffer, pszFileW->length,
......@@ -285,7 +280,6 @@ static void __store_testUnicode (const sal_Char *pszFilename)
rtl_uString_release (pszFileW);
// ...
rtl_string_release (pszFileA);
}
......@@ -313,14 +307,12 @@ int SAL_CALL main (int argc, char **argv)
if (eErrCode != store_E_None)
return eErrCode;
rtl::Reference<OTestObject> xObject (new OTestObject());
__store_test_handle (&*xObject);
rtl::Reference<OTestBIOS> xBIOS (new OTestBIOS());
__store_test_handle (&*xBIOS);
if (!xBIOS.is())
return 0;
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "sal/types.h"
#include "osl/thread.h"
#include "rtl/ustring.hxx"
......
......@@ -1163,7 +1163,6 @@ storeError MemoryPageAccess::peekAt_Impl (sal_uInt32 nOffset, void * pBuffer, sa
if (!(dst_lo <= dst_hi))
return store_E_InvalidParameter;
// ...
sal_uInt8 const * src_lo = m_pData + nOffset;
if (!(src_lo <= m_pData + m_nSize))
return store_E_CantSeek;
......@@ -1191,7 +1190,6 @@ storeError MemoryPageAccess::pokeAt_Impl (sal_uInt32 nOffset, void const * pBuff
if (uSize > SAL_MAX_UINT32)
return store_E_CantSeek;
// ...
if (uSize > m_nSize)
{
// increase size.
......
......@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#define _T_STORE_CXX
#include <sal/types.h>
#include <osl/diagnose.h>
......@@ -37,7 +36,6 @@ extern "C"
}
#endif /* PROFILE */
/*========================================================================
*
* Internals.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment