tdf#145759 Use symbolic constants instead of magic numerical constants
1.4142... -> M_SQRT2 0.4142... -> M_SQRT2 - 1 3.1415... -> M_PI 2.7182... -> M_E Change-Id: If5b19aa38d9902b1a4b717f89f18bdf2f73a47cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129745 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <sal/config.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <string_view>
|
||||
@@ -57,6 +58,7 @@
|
||||
#include "multi.hxx"
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <cmath>
|
||||
|
||||
using namespace osl;
|
||||
using namespace cppu;
|
||||
@@ -376,7 +378,7 @@ static bool performTest(
|
||||
assign(
|
||||
static_cast<TestElement &>(aData), true, '@', 17, 0x1234, 0xFEDC,
|
||||
0x12345678, 0xFEDCBA98, SAL_CONST_INT64(0x123456789ABCDEF0),
|
||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, M_PI,
|
||||
TestEnum_LOLA, STRING_TEST_CONSTANT, 18, 0x5678, xI,
|
||||
Any(&xI, cppu::UnoType<XInterface>::get()));
|
||||
bRet &= check(aData.Any == xI, "### unexpected any!");
|
||||
@@ -732,19 +734,19 @@ static bool performTest(
|
||||
assign(
|
||||
_arStruct[0], true, '@', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98,
|
||||
SAL_CONST_INT64(0x123456789ABCDEF0),
|
||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, M_PI,
|
||||
TestEnum_LOLA, STRING_TEST_CONSTANT, 18, 0x5678, _arObj[0],
|
||||
Any(&_arObj[0], cppu::UnoType<XInterface>::get()));
|
||||
assign(
|
||||
_arStruct[1], true, 'A', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98,
|
||||
SAL_CONST_INT64(0x123456789ABCDEF0),
|
||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, M_PI,
|
||||
TestEnum_TWO, STRING_TEST_CONSTANT, 18, 0x5678, _arObj[1],
|
||||
Any(&_arObj[1], cppu::UnoType<XInterface>::get()));
|
||||
assign(
|
||||
_arStruct[2], true, 'B', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98,
|
||||
SAL_CONST_INT64(0x123456789ABCDEF0),
|
||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359,
|
||||
SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, M_PI,
|
||||
TestEnum_CHECK, STRING_TEST_CONSTANT, 18, 0x5678, _arObj[2],
|
||||
Any(&_arObj[2], cppu::UnoType<XInterface>::get()));
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#using <cli_uretypes.dll>
|
||||
#using <cli_ure.dll>
|
||||
#using <cli_types_bridgetest.dll>
|
||||
#include <cmath>
|
||||
|
||||
using namespace System;
|
||||
using namespace System::Diagnostics;
|
||||
@@ -375,7 +376,7 @@ static bool performTest(XBridgeTest* xLBT)
|
||||
assign( static_cast<TestElement*>(aData),
|
||||
true, '@', 17, 0x1234, 0xfedc, 0x12345678, 0xfedcba98,
|
||||
0x123456789abcdef0, 0xfedcba9876543210,
|
||||
17.0815f, 3.1415926359, TestEnum::LOLA,
|
||||
17.0815f, M_PI, TestEnum::LOLA,
|
||||
Constants::STRING_TEST_CONSTANT, xI,
|
||||
aAny);
|
||||
|
||||
@@ -650,15 +651,15 @@ static bool performSequenceTest(XBridgeTest* xBT)
|
||||
arStruct[0] = new TestElement(); arStruct[1] = new TestElement();
|
||||
arStruct[2] = new TestElement();
|
||||
assign( arStruct[0], true, '@', 17, 0x1234, 0xfedc, 0x12345678, 0xfedcba98,
|
||||
0x123456789abcdef0, 0xfedcba9876543210, 17.0815f, 3.1415926359,
|
||||
0x123456789abcdef0, 0xfedcba9876543210, 17.0815f, M_PI,
|
||||
TestEnum::LOLA, Constants::STRING_TEST_CONSTANT, 18, 0x5678, arObject[0],
|
||||
Any( __typeof(Object), arObject[0]) );
|
||||
assign( arStruct[1], true, 'A', 17, 0x1234, 0xfedc, 0x12345678, 0xfedcba98,
|
||||
0x123456789abcdef0, 0xfedcba9876543210, 17.0815f, 3.1415926359,
|
||||
0x123456789abcdef0, 0xfedcba9876543210, 17.0815f, M_PI,
|
||||
TestEnum::TWO, Constants::STRING_TEST_CONSTANT, 18, 0x5678, arObject[1],
|
||||
Any( __typeof(Object), arObject[1]) );
|
||||
assign( arStruct[2], true, 'B', 17, 0x1234, 0xfedc, 0x12345678, 0xfedcba98,
|
||||
0x123456789abcdef0, 0xfedcba9876543210, 17.0815f, 3.1415926359,
|
||||
0x123456789abcdef0, 0xfedcba9876543210, 17.0815f, M_PI,
|
||||
TestEnum::CHECK, Constants::STRING_TEST_CONSTANT, 18, 0x5678, arObject[2],
|
||||
Any( __typeof(Object), arObject[2] ) );
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user