Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


On 08/21/2015 10:30 PM, Matteo Casalin wrote:
commit eb4cbea657b9038c488f1b1bcf5107cc226a6681
Author: Matteo Casalin <matteo.casalin@yahoo.com>
Date:   Sun Aug 16 16:32:13 2015 +0200

     Silence some conversion warnings

     Change-Id: I676ed010576f3a24b193ffc6c28a319bcc5ac968

[...]
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx
index 395870f..78a51a1 100644
--- a/store/source/storbase.hxx
+++ b/store/source/storbase.hxx
@@ -512,9 +512,9 @@ struct PageData
      void guard (sal_uInt32 nAddr)
      {
          sal_uInt32 nCRC32 = 0;
-        nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+        nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, 
static_cast<sal_uInt32>(sizeof(sal_uInt32)));

What compiler/switch is it that warns there? It does not look like that particular compiler/switch is very useful. sizeof(sal_uInt32) is a known, small integer at compile time. It should be apparent to both the compiler and humans that it fits into the sal_uInt32 argument to rtl_crc32 without needing the static_cast noise.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.