[Libreoffice-commits] core.git: include/tools

Matteo Casalin matteo.casalin at yahoo.com
Wed Jul 29 02:13:06 PDT 2015


 include/tools/solar.h |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 029fa6477bfed71881c3287799f5bdffd3285f92
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Wed Jul 22 23:22:56 2015 +0200

    solar.h: avoid some Wconversion warnings
    
    Change-Id: Id41bd4e759dea72b37db5f329e29ff5c18c75a66
    Reviewed-on: https://gerrit.libreoffice.org/17306
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/include/tools/solar.h b/include/tools/solar.h
index c8d83ac..717ad78 100644
--- a/include/tools/solar.h
+++ b/include/tools/solar.h
@@ -47,12 +47,14 @@ typedef sal_uInt8   SVBT64[8];
 
 #ifdef __cplusplus
 
-inline sal_uInt16 SVBT16ToShort( const SVBT16 p ) { return (sal_uInt16)p[0]
-                                                   + ((sal_uInt16)p[1] <<  8); }
-inline sal_uInt32 SVBT32ToUInt32 ( const SVBT32 p ) { return (sal_uInt32)p[0]
+inline sal_uInt16 SVBT16ToShort( const SVBT16 p ) { return static_cast<sal_uInt16>
+                                                     ((sal_uInt16)p[0]
+                                                   + ((sal_uInt16)p[1] <<  8)); }
+inline sal_uInt32 SVBT32ToUInt32 ( const SVBT32 p ) { return static_cast<sal_uInt32>
+                                                     ((sal_uInt32)p[0]
                                                    + ((sal_uInt32)p[1] <<  8)
                                                    + ((sal_uInt32)p[2] << 16)
-                                                   + ((sal_uInt32)p[3] << 24); }
+                                                   + ((sal_uInt32)p[3] << 24)); }
 #if defined OSL_LITENDIAN
 inline double   SVBT64ToDouble( const SVBT64 p ) { double n;
                                                     reinterpret_cast<sal_uInt8*>(&n)[0] = p[0];


More information about the Libreoffice-commits mailing list