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/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 ---- 5 files changed, 271 deletions(-) (limited to 'store/workben') 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