From b89187aad86e2be000d2f4c9c380a95bf8430c2e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 16 Sep 2019 15:02:24 +0200 Subject: Simplify forced memory reads Change-Id: I68ea0a46bcaaadb455f2f2cc6e53950e2f26a763 Reviewed-on: https://gerrit.libreoffice.org/79003 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sal/osl/unx/file.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sal') 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(*ppAddr)); + sal_uInt8 volatile *pData(static_cast(*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]; } } -- cgit