[Libreoffice-commits] core.git: sal/osl

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 16 13:57:15 UTC 2019


 sal/osl/unx/file.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit b89187aad86e2be000d2f4c9c380a95bf8430c2e
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Sep 16 15:02:24 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Sep 16 15:56:27 2019 +0200

    Simplify forced memory reads
    
    Change-Id: I68ea0a46bcaaadb455f2f2cc6e53950e2f26a763
    Reviewed-on: https://gerrit.libreoffice.org/79003
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 39d9d16334c7..96a9cfecf2b1 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -1175,19 +1175,18 @@ oslFileError SAL_CALL osl_mapFile(
              * Pagein, touching first byte of every memory page.
              * Note: volatile disables optimizing the loop away.
              */
-            sal_uInt8 *pData(static_cast<sal_uInt8*>(*ppAddr));
+            sal_uInt8 volatile *pData(static_cast<sal_uInt8*>(*ppAddr));
             size_t nSize(nLength);
 
-            volatile sal_uInt8 c = 0;
             while (nSize > nPageSize)
             {
-                c = c ^ pData[0];
+                pData[0];
                 pData += nPageSize;
                 nSize -= nPageSize;
             }
 
             if (nSize > 0)
-                c = c ^ pData[0];
+                pData[0];
         }
     }
 


More information about the Libreoffice-commits mailing list