From c189268e0ab3ec33c02c5dbabfd31b37e0b1f5ab Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Mon, 18 Oct 2010 16:25:37 +0100 Subject: remove non-compiled code --- store/source/stordata.cxx | 25 ------ store/source/storpage.cxx | 65 -------------- store/source/stortree.cxx | 35 -------- store/source/stortree.hxx | 6 -- store/workben/t_base.cxx | 9 -- store/workben/t_file.cxx | 22 ----- store/workben/t_leak.cxx | 4 - store/workben/t_page.cxx | 219 ---------------------------------------------- store/workben/t_store.cxx | 17 ---- 9 files changed, 402 deletions(-) (limited to 'store') diff --git a/store/source/stordata.cxx b/store/source/stordata.cxx index 689a39564af6..db85ce0eff13 100644 --- a/store/source/stordata.cxx +++ b/store/source/stordata.cxx @@ -724,31 +724,6 @@ OStoreDirectoryPageObject::scope ( return page::SCOPE_UNREACHABLE; } -#if 0 /* NYI */ -/* - * chunk (external data page). - */ -inode::ChunkDescriptor OStoreDirectoryPageObject::chunk (sal_uInt32 nOffset) -{ - // @@@ INSUFFICIENT: NEED SCOPE AS WELL @@@ - sal_uInt32 nCapacity = m_rPage.capacity(); - if (nOffset < nCapacity) - // Internal scope (inode page). - return inode::ChunkDescriptor (nOffset, nCapacity); - else - // External scope (data page). - return inode::ChunkDescriptor (nOffset - nCapacity, data::capacity(m_rPage.m_aDescr)); - - inode::ChunkScope eScope = m_rPage.scope(nOffset); - if (eScope == inode::SCOPE_INTERNAL) - // Inode page (internal scope). - return inode::ChunkDescriptor (nOffset, m_rPage.capacity()); - else - // Data page (external scope). - return inode::ChunkDescriptor (nOffset - m_rPage.capacity(), data::capacity(m_rPage.m_aDescr)); -} -#endif /* NYI */ - /* * read (external data page). */ diff --git a/store/source/storpage.cxx b/store/source/storpage.cxx index ef88986d0f65..b91528a615df 100644 --- a/store/source/storpage.cxx +++ b/store/source/storpage.cxx @@ -164,71 +164,6 @@ storeError OStorePageManager::find_lookup ( * remove_Impl (possibly down from root). * Internal: Precond: initialized, writeable, exclusive access. */ -#if 0 /* EXP */ -storeError OStorePageManager::remove_Impl (entry & rEntry) -{ - // Find Node and Index. - OStoreBTreeNodeObject aNode; - sal_uInt16 nIndex = 0; - eErrCode = m_aRoot.find_lookup (aNode, nIndex, entry::CompareGreater(rEntry), *this); - - // @@@ - - PageHolderObject< page > xPage (aNode.get()); - page & rPage = (*xPage); - - // Check current page index. - sal_uInt16 i = rPage.find (rEntry), n = rPage.usageCount(); - if (!(i < n)) - { - // Path to entry not exists (Must not happen(?)). - return store_E_NotExists; - } - - // Compare entry. - entry::CompareResult result = rEntry.compare (rPage.m_pData[i]); - - for (; result == entry::COMPARE_GREATER && xPage->depth() > 0; ) - { - // Check next node address. - sal_uInt32 const nAddr = rPage.m_pData[i].m_aLink.location(); - if (nAddr == STORE_PAGE_NULL) - { - // Path to entry not exists (Must not happen(?)). - return store_E_NotExists; - } - - // Load next node page. - eErrCode = loadObjectAt (aNode, nAddr); - - PageHolderObject< page > xNext (aNode.get()); - xNext.swap (xPage); - } - - aNode.remove (nIndex, rEntry, *this); - - - do - { - // Load next node page. - eErrCode = loadObjectAt (aNode, nAddr); - - page const & rPage = (*xPage); - - // Check current page index. - sal_uInt16 i = rPage.find (rEntry), n = rPage.usageCount(); - if (!(i < n)) - { - // Path to entry not exists (Must not happen(?)). - return store_E_NotExists; - } - - // Compare entry. - result = rEntry.compare (rPage.m_pData[i]); - - } while (result == entry::COMPATE_GREATER); -} -#endif /* EXP */ storeError OStorePageManager::remove_Impl (entry & rEntry) { diff --git a/store/source/stortree.cxx b/store/source/stortree.cxx index 58bcebad70b8..508748c3b285 100644 --- a/store/source/stortree.cxx +++ b/store/source/stortree.cxx @@ -125,22 +125,6 @@ void OStoreBTreeNodeData::remove (sal_uInt16 i) } } -#if 0 /* NYI */ -/* - * merge (with right page). - */ -void OStoreBTreeNodeData::merge (const self& rPageR) -{ - sal_uInt16 const n = usageCount(); - sal_uInt16 const m = rPageR.usageCount(); - if ((n + m) <= capacityCount()) - { - memcpy (&(m_pData[n]), &(rPageR.m_pData[0]), m * sizeof(T)); - usageCount (n + m); - } -} -#endif - /* * split (left half copied from right half of left page). */ @@ -281,25 +265,6 @@ storeError OStoreBTreeNodeObject::remove ( } else { -#if 0 /* NYI */ - // Check for right sibling. - sal_uInt16 const nIndexR = nIndexL + 1; - if (nIndexR < rPage.usageCount()) - { - // Load right link node. - self aNodeR; - eErrCode = rBIOS.loadObjectAt (aNodeR, rPage.m_pData[nIndexR].m_aLink.location()); - if (eErrCode == store_E_None) - { - if (rPageL.queryMerge (rPageR)) - { - rPageL.merge (rPageR); - - eErrCode = rBIOS.free (rPageR.location()); - } - } - } -#endif /* NYI */ // Relink. rPage.m_pData[nIndexL].m_aKey = xPageL->m_pData[0].m_aKey; diff --git a/store/source/stortree.hxx b/store/source/stortree.hxx index 63443e098e46..7b9c302b5643 100644 --- a/store/source/stortree.hxx +++ b/store/source/stortree.hxx @@ -222,12 +222,6 @@ struct OStoreBTreeNodeData : public store::OStorePageData void insert (sal_uInt16 i, const T& t); void remove (sal_uInt16 i); -#if 0 /* NYI */ - /** merge (with right page). - */ - void merge (const self& rPageR); -#endif - /** split (left half copied from right half of left page). */ void split (const self& rPageL); diff --git a/store/workben/t_base.cxx b/store/workben/t_base.cxx index b6f286444a01..6a96b7c15bb1 100644 --- a/store/workben/t_base.cxx +++ b/store/workben/t_base.cxx @@ -183,15 +183,6 @@ static void __store_string_newFromUnicode_WithLength ( OUSTRING_TO_OSTRING_CVTFLAGS); } -#if 0 /* UNSUSED */ -static void __store_string_newFromUnicode ( - rtl_String **newString, const rtl_uString *value) -{ - __store_string_newFromUnicode_WithLength ( - newString, value->buffer, value->length); -} -#endif /* UNUSED */ - static void __store_string_newFromUnicode ( rtl_String **newString, const sal_Unicode *value) { diff --git a/store/workben/t_file.cxx b/store/workben/t_file.cxx index ab14b4b1111c..6357e7b8a5a6 100644 --- a/store/workben/t_file.cxx +++ b/store/workben/t_file.cxx @@ -63,28 +63,6 @@ int SAL_CALL main (int argc, char **argv) argv[1], rtl_str_getLength(argv[1]), osl_getThreadTextEncoding()); -#if 0 /* EXP */ - oslFileError result; - rtl::OUString aPath; - - result = osl_getFileURLFromSystemPath(aFilename.pData, &(aPath.pData)); - if (result != osl_File_E_None) - { - // not SystemPath, assume FileUrl. - aPath = aFilename; - } - if (rtl_ustr_ascii_shortenedCompare_WithLength(aPath.pData->buffer, aPath.pData->length, "file://", 7) != 0) - { - // not FileUrl, assume relative path. - rtl::OUString aBase; - (void) osl_getProcessWorkingDir (&(aBase.pData)); - - // absolute FileUrl. - (void) osl_getAbsoluteFileURL(aBase.pData, aPath.pData, &(aPath.pData)); - } - aFilename = aPath; -#endif /* EXP */ - eErrCode = FileLockBytes_createInstance ( xLockBytes, aFilename.pData, store_AccessReadWrite); if (eErrCode != store_E_None) diff --git a/store/workben/t_leak.cxx b/store/workben/t_leak.cxx index 0ec6240fb7e4..32033268d618 100644 --- a/store/workben/t_leak.cxx +++ b/store/workben/t_leak.cxx @@ -12,10 +12,6 @@ { rtl_Locale * pLocale = 0; osl_getProcessLocale (&pLocale); -#if 0 - rtl_TextEncoding te = osl_getThreadTextEncoding(); - (void) te; -#endif return 0; } diff --git a/store/workben/t_page.cxx b/store/workben/t_page.cxx index 8efdf333d5f1..33ca80ea81a9 100644 --- a/store/workben/t_page.cxx +++ b/store/workben/t_page.cxx @@ -127,12 +127,6 @@ SharedCount::Allocator::~Allocator() /*======================================================================*/ -#if 0 /* OLD */ - -typedef store::OStorePageData PageData; - -#else /* NEW */ - #if defined(OSL_BIGENDIAN) #define STORE_DWORD(dword) OSL_SWAPDWORD((dword)) #else @@ -210,8 +204,6 @@ struct PageData } }; -#endif /* NEW */ - class IPageAllocator { public: @@ -707,75 +699,6 @@ public: } }; -/*======================================================================*/ -#if 0 /* NYI */ -BIOS::load (PageObject & rPage, sal_uInt32 nOffset) -{ - result = m_xCache->readPageAt (rPage.get(), nOffset); - if (result == NotExists) - { - result = m_xLockBytes->readPageAt (rPage.get(), nOffset); - if (result != None) - return result; - - result = rPage.verify(); - if (result != None) - return result; - - result = m_xCache->writePageAt (rPage.get(), nOffset); - } - return result; -} -BIOS::save (PageObject & rPage, sal_uInt32 nOffset) -{ - rPage.guard(); - result = m_xLockBytes->writePageAt (rPage.get(), nOffset); - if (result != None) - return result; - - return m_xCache->writePageAt (rPage.get(), nOffset); -} -BIOS::init (rxLockBytes, eAccessMode, nPageSize) -{ - SuperPage super; - if (eAccessMode == store_AccessCreate) - { - sal_uInt16 pagesize = nPageSize; - if ((STORE_MINIMUM_PAGESIZE > pagesize) || (pagesize > STORE_MAXIMUM_PAGESIZE)) - return store_E_InvalidParameter; - - pagesize = ((pagesize + STORE_MINIMUM_PAGESIZE - 1) & ~(STORE_MINIMUM_PAGESIZE - 1)); - rxLockBytes->init (pagesize); - - super = allocator->construct(); - super->guard(); - - rxLockBytes->writeAt (0, super, super->size()); - - } - if (eAccessMode != store_AccessCreate) - { - rxLockBytes->readAt (0, &super, super::theSize); - - super.verify(); - } - if (eErrCode != store_E_NotExists) - - -} -#endif /* NYI */ -/*======================================================================*/ - -#if 0 /* NYI */ -class PageCache -{ - std::set m_pages; -public: - storeError readPageAt (PageObject & rPage, sal_uInt32 nOffset); - storeError writePageAt (PageObject const & rPage, sal_uInt32 nOffset); -}; -#endif /* NYI */ - /*======================================================================*/ class IPageAllocator; @@ -1226,15 +1149,6 @@ storeError MemoryPageAccess::writePageAt_Impl (PageHolder const & rPage, sal_uIn if (!(pagedata != 0)) return store_E_InvalidParameter; -#if 0 /* NYI */ - sal_uInt16 const bytes = pagedata->size(); // Descr.m_nSize; - OSL_ASSERT(bytes >= PageData::thePageSize); - - offset = rPage.location(); // Descr.m_nAddr; - OSL_ASSERT(nOffset == offset); - - OSL_PRECOND(offset % bytes == 0, "Unaligned page write."); -#endif /* NYI */ return pokeAt (nOffset, pagedata, pagedata->size()); } storeError MemoryPageAccess::peekAt_Impl (sal_uInt32 nOffset, void * pBuffer, sal_uInt32 nBytes) @@ -1375,106 +1289,6 @@ void MappedPageAccess::unmapFile (sal_uInt8 * pData, sal_uInt32 nSize) (void) osl_unmapFile (pData, nSize); } -#if 0 /* NYI */ -storeError MemoryPageAccess_createInstance ( - rtl::Reference< IPageAccess > & rxPageAccess, - storeAccessMode eAccessMode, - sal_uInt16 nPageSize -) -{ - rxPageAccess = new MemoryPageAccess(); - if (!rxPageAccess.is()) - return store_E_OutOfMemory; - - return rxPageAccess->initialize (eAccessMode, nPageSize); -} - -storeError FilePageAccess_createInstance ( - rtl::Reference< IPageAccess > & rxPageAccess, - rtl_uString * pFilename, - storeAccessMode eAccessMode, - sal_uInt16 nPageSize -) -{ - // Acquire file handle. - ResourceHolder xFile; - result = xFile.get().initialize (pFilename, MODE_TO_NATIVE(eAccessMode)); - if (result != osl_File_E_None) - return ERROR_FROM_NATIVE(result); - - if (eAccessMode == store_AccessReadOnly) - { - ResourceHolder xMapping; - result = xMapping.get().initialize (xFile.get()); - if (result == osl_File_E_None) - { - const sal_uInt32 nSize = sal::static_int_cast(xMapping.get().m_uSize); - rxPageAccess = new MappedPageAccess (xMapping.get().m_pAddr, nSize); - if (!rxPageAccess.is()) - return store_E_OutOfMemory; - (void) xMapping.release(); - } - } - if (!rxPageAccess.is()) - { - rxPageAccess = new FilePageAccess (xFile.get()); - if (!rxPageAccess.is()) - return store_E_OutOfMemory; - (void) xFile.release(); - } - return rxPageAccess->initialize (eAccessMode, nPageSize); -} -#endif /* NYI */ - -/*======================================================================== - * - * test... - * - *======================================================================*/ -#if 0 /* NYI */ - -struct IDataBlock -{ - virtual sal_uInt16 singleCount() const = 0; - virtual sal_uInt32 singleLink (sal_uInt16 nIndex) const = 0; - virtual void singleLink (sal_uInt16 nIndex, sal_uInt32 nAddr) = 0; - - virtual storeError get() = 0; - virtual storeError put() = 0; - virtual storeError truncate() = 0; -}; - -struct InodePageData : public PageData -{ - virtual INameBlock & getNameBlock() = 0; - virtual IDataBlock & getDataBlock() = 0; -}; - -template< class page_data_type > -page_data_type * query (PageData *, page_data_type *); - -template<> InodePageDataV2* -query (PageData & rData, InodePageDataV2 *) -{ - if (rData.isKindOf(InodePageDataV2::m_nTypeId)) - return static_cast(&rData); - return 0; -} - -class InodePageObject : public PageObject -{ -public: - static InodePageObject createInstance (PageData & rData) - { - if (query(&rData, static_cast(0))) - return InodePageObjectV2 (static_cast(rData)); - else if (query(&rData, static_cast(0))) - return InodePageObjectV1 (static_cast(rData)); - } -}; - -#endif /* NYI */ - /*======================================================================== * * main. @@ -1483,33 +1297,6 @@ public: #include -#if 0 /* EXP */ -class Interface -{ -public: - virtual void deallocate(void *) /* = 0 */; -}; - -class Implementation : public Interface -{ - SharedCount m_count; - -public: - Implementation() : Interface() { printf("Ctor(%p)\n", this); } - ~Implementation() { printf("Dtor(%p)\n", this); } - - Implementation (Implementation const & rhs) : Interface(), m_count (rhs.m_count) { printf("CopyCtor(%p)\n", this); } - - virtual void deallocate(void *) {} -}; - -Interface Interface_createInstance() -{ - Implementation aInst; - return aInst; -} -#endif /* EXP */ - int SAL_CALL main (int argc, char ** argv) { OSL_PRECOND(argc >= 1, "t_page: error: insufficient number of arguments."); @@ -1534,12 +1321,6 @@ int SAL_CALL main (int argc, char ** argv) TestClient aClient; aClient.dwim (aBIOS); } -#if 0 /* EXP */ - { - Interface aIfc1 (Interface_createInstance()); - Interface aIfc2 (aIfc1); - } -#endif /* EXP */ if (argc > 1) { diff --git a/store/workben/t_store.cxx b/store/workben/t_store.cxx index 53b01955fbc2..9f4e83931e52 100644 --- a/store/workben/t_store.cxx +++ b/store/workben/t_store.cxx @@ -500,23 +500,6 @@ int SAL_CALL main (int argc, char **argv) "t_store::main(): store_createDirectory() failed"); if (eErrCode == store_E_None) { -#if 0 /* NYI */ - // Rename directory. - eErrCode = aFile.rename ( - aPath, "demostor-1.dir/", - aPath, "Renamed demostor-1.dir"); - OSL_POSTCOND( - ((eErrCode == store_E_None ) || - (eErrCode == store_E_AlreadyExists) ), - "t_store::main(): store_rename() failed"); - - eErrCode = aFile.rename ( - aPath, "Renamed demostor-1.dir/", - aPath, "demostor-1.dir"); - OSL_POSTCOND( - (eErrCode == store_E_None), - "t_store::main(): store_rename() failed"); -#endif /* NYI */ } } -- cgit