summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-03-05 17:38:52 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-03-06 08:28:58 +0100
commit936308d3ef4f43d9c525401cb1cfca197df13b0f (patch)
tree74d6affe5628b8c1d76796de84e82ac92d0cf656 /include
parentefcf8149b5762d95b158a809430a3d053bb2d41d (diff)
Introduce Int32ToSVBT32 for cases that apparently want to write a signed value
...and clean up some other (legitimate) uses of UInt32ToSVBT32 to not use a (somewhat misleading) static_cast<long>(...) Change-Id: Ifd0c3f771c3f6e20eef3413b9c27fd2514dc0c13 Reviewed-on: https://gerrit.libreoffice.org/68767 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/tools/solar.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/tools/solar.h b/include/tools/solar.h
index 3fd676acbc2a..721573287685 100644
--- a/include/tools/solar.h
+++ b/include/tools/solar.h
@@ -94,6 +94,7 @@ inline void UInt32ToSVBT32 ( sal_uInt32 n, SVBT32 p )
p[2] = static_cast<sal_uInt8>(n >> 16);
p[3] = static_cast<sal_uInt8>(n >> 24);
}
+inline void Int32ToSVBT32 ( sal_Int32 n, SVBT32 p ) { UInt32ToSVBT32(sal_uInt32(n), p); }
#if defined OSL_LITENDIAN
inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = reinterpret_cast<sal_uInt8*>(&n)[0];
p[1] = reinterpret_cast<sal_uInt8*>(&n)[1];