diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-01-26 20:50:51 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2013-01-26 20:51:09 +0100 |
commit | b780e8307bfeabf182225f302bb9d62934f0c597 (patch) | |
tree | 4ca206356c7a0c6e72d82a1d2c7f0c2bc3eecbc2 /store | |
parent | d77bcb13c4afce1f894aadc6a3b058695641c2e1 (diff) |
Some cppcheck cleaning
Diffstat (limited to 'store')
-rw-r--r-- | store/workben/t_page.cxx | 88 | ||||
-rw-r--r-- | store/workben/t_store.cxx | 2 |
2 files changed, 44 insertions, 46 deletions
diff --git a/store/workben/t_page.cxx b/store/workben/t_page.cxx index 83be15044d98..d36df003b2c9 100644 --- a/store/workben/t_page.cxx +++ b/store/workben/t_page.cxx @@ -1305,60 +1305,58 @@ void MappedPageAccess::unmapFile (sal_uInt8 * pData, sal_uInt32 nSize) int SAL_CALL main (int argc, char ** argv) { - OSL_PRECOND(argc >= 1, "t_page: error: insufficient number of arguments."); - if (argc < 1) - return 0; + OSL_PRECOND(argc >= 1, "t_page: error: insufficient number of arguments."); + if (argc < 1) + return 0; - { - void *a = (void*)1, *b = (void*)2; - swap<void*>(a, b); - } - { - PageObject a; - PageObject b (a); - PageObject c; - - c = b; - a = a; + { + void *a = (void*)1, *b = (void*)2; + swap<void*>(a, b); + } + { + PageObject a; + PageObject b (a); + PageObject c; - } - { - TestBIOS aBIOS; - TestClient aClient; - aClient.dwim (aBIOS); - } + c = b; + a = a; + } + { + TestBIOS aBIOS; + TestClient aClient; + aClient.dwim (aBIOS); + } - if (argc > 1) - { - rtl_uString * pFilename = 0; - rtl_uString_newFromAscii (&pFilename, argv[1]); - storeAccessMode eAccessMode = store_AccessReadOnly; - - // Acquire file handle. - ResourceHolder<FileHandle> h1; - oslFileError result = h1.get().initialize (pFilename, FilePageAccess::MODE_TO_NATIVE(eAccessMode)); - if (result == osl_File_E_None) + if (argc > 1) { - ResourceHolder<FileHandle> h2 (h1); - h1 = h2; + rtl_uString * pFilename = 0; + rtl_uString_newFromAscii (&pFilename, argv[1]); + storeAccessMode eAccessMode = store_AccessReadOnly; + + // Acquire file handle. + ResourceHolder<FileHandle> h1; + oslFileError result = h1.get().initialize (pFilename, FilePageAccess::MODE_TO_NATIVE(eAccessMode)); + if (result == osl_File_E_None) + { + ResourceHolder<FileHandle> h2 (h1); + h1 = h2; - if (eAccessMode == store_AccessReadOnly) - { - ResourceHolder<FileMapping> m1; - result = m1.get().initialize (h1.get()); + if (eAccessMode == store_AccessReadOnly) + { + ResourceHolder<FileMapping> m1; + result = m1.get().initialize (h1.get()); - const sal_uInt32 nSize = sal::static_int_cast<sal_uInt32>(m1.get().m_uSize); - (void) nSize; // UNUSED + const sal_uInt32 nSize = sal::static_int_cast<sal_uInt32>(m1.get().m_uSize); + (void) nSize; // UNUSED - ResourceHolder<FileMapping> m2 (m1); - m1 = m2; + ResourceHolder<FileMapping> m2 (m1); + m1 = m2; - result = osl_File_E_None; - } + return result; + } + } } - } - - return 0; + return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/store/workben/t_store.cxx b/store/workben/t_store.cxx index 6e7bc63af7ce..7709c58b8c40 100644 --- a/store/workben/t_store.cxx +++ b/store/workben/t_store.cxx @@ -182,7 +182,7 @@ sal_Bool DirectoryTraveller::visit (const iter& it) if (m_nOptions & OPTION_DUMP) { rtl::OString aName (it.m_pszName, it.m_nLength, RTL_TEXTENCODING_UTF8); - printf ("Visit(%d,%d): %s [0x%08x] %d [Bytes]\n", + printf ("Visit(%u,%u): %s [0x%08x] %d [Bytes]\n", m_nLevel, m_nCount, aName.pData->buffer, (unsigned int)(it.m_nAttrib), (unsigned int)(it.m_nSize)); } |