diff options
author | OmkarAcharekar <omkaracharekar12@gmail.com> | 2022-10-22 01:47:10 +0530 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-10-25 08:12:26 +0200 |
commit | 4cec1ec1d575ff0328f014de57abb591e3c7ae11 (patch) | |
tree | 9104b29f0d18bd0eb83a9287a97f59fcc14de5f4 /stoc | |
parent | 0d47b49c93283d4e5cf4372dd0e981180b995972 (diff) |
tdf#145759 Use symbolic constants instead of magic numerical constants
Change-Id: I68f9dd0bbe5a98de35253220dc33382139b4950e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141657
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/test/testconv.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/stoc/test/testconv.cxx b/stoc/test/testconv.cxx index 165f073912ed..5549779db117 100644 --- a/stoc/test/testconv.cxx +++ b/stoc/test/testconv.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/reflection/FieldAccessMode.hpp> #include <com/sun/star/registry/XImplementationRegistration.hpp> +#include <cmath> #include <float.h> #include <stdio.h> @@ -465,12 +466,12 @@ static sal_Int32 initBlocks( ConvBlock * pTestBlocks ) // st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa aVal <<= OUString("+.7071067811865"); pTestBlocks[nElems++] = ConvBlock( aVal, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 ); - aVal <<= (float)( .7071067811865 ); + aVal <<= (float)( M_SQRT1_2 ); pTestBlocks[nElems++] = ConvBlock( aVal, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 ); // st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa aVal <<= OUString("3.14159265359"); pTestBlocks[nElems++] = ConvBlock( aVal, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 ); - aVal <<= (float)( 3.14159265359 ); + aVal <<= (float)( M_PI ); pTestBlocks[nElems++] = ConvBlock( aVal, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 ); // st,do,fl,u3,i3,u1,i1,by,bo,ch,tc,si,sa aVal <<= (float)( 5 ); |