From 029fa6477bfed71881c3287799f5bdffd3285f92 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Wed, 22 Jul 2015 23:22:56 +0200 Subject: solar.h: avoid some Wconversion warnings Change-Id: Id41bd4e759dea72b37db5f329e29ff5c18c75a66 Reviewed-on: https://gerrit.libreoffice.org/17306 Tested-by: Jenkins Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- include/tools/solar.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/tools/solar.h b/include/tools/solar.h index c8d83ac4c4bc..717ad78aded6 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)p[0] + + ((sal_uInt16)p[1] << 8)); } +inline sal_uInt32 SVBT32ToUInt32 ( const SVBT32 p ) { return static_cast + ((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(&n)[0] = p[0]; -- cgit v1.2.3