[Libreoffice-commits] .: store/workben

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Jan 26 11:55:00 PST 2013


 store/workben/t_page.cxx  |   88 ++++++++++++++++++++++------------------------
 store/workben/t_store.cxx |    2 -
 2 files changed, 44 insertions(+), 46 deletions(-)

New commits:
commit b780e8307bfeabf182225f302bb9d62934f0c597
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Jan 26 20:50:51 2013 +0100

    Some cppcheck cleaning

diff --git a/store/workben/t_page.cxx b/store/workben/t_page.cxx
index 83be150..d36df00 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 6e7bc63..7709c58 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));
     }


More information about the Libreoffice-commits mailing list