From 9a741fcad458875a806295ddbd41b68d82ce9095 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 27 Jun 2014 07:51:25 +0200 Subject: loplugin:unreffun: also warn about unused function templates Change-Id: I4a6280f47ca3c4a77b4e42fe05d79ded7fc30ef1 --- sal/qa/rtl/oustring/rtl_OUString2.cxx | 71 ----------------------------------- 1 file changed, 71 deletions(-) (limited to 'sal/qa') diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx index 27a06ab43464..95940f7ea3ea 100644 --- a/sal/qa/rtl/oustring/rtl_OUString2.cxx +++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx @@ -212,77 +212,6 @@ public: CPPUNIT_TEST_SUITE_END(); }; // class number -// testing the method toDouble() - -template -sal_Int16 SAL_CALL checkPrecisionSize() -{ - // sal_Int16 nSize = sizeof(T); - volatile T nCalcValue = 1.0; - - // (i + 1) is the current precision - // numerical series - // 1.1 - // 10.1 - // 100.1 - // ... - // 1000...0.1 - - sal_Int16 i = 0; - for (i=0;i<50;i++) - { - nCalcValue *= 10; - volatile T nValue = nCalcValue + static_cast(0.1); - volatile T dSub = nValue - nCalcValue; - // ----- 0.11 ---- 0.1 ---- 0.09 ----- - if (0.11 > dSub && dSub > 0.09) - { - // due to the fact, that the value is break down we sub 1 from the precision value - // but to suppress this, we start at zero, precision is i+1 till here --i; - break; - } - } - - sal_Int16 j= 0; - nCalcValue = 1.0; - - // numerical series - // 1.1 - // 1.01 - // 1.001 - // ... - // 1.000...001 - - for (j=0;j<50;j++) - { - nCalcValue /= 10; - volatile T nValue = nCalcValue + static_cast(1.0); - volatile T dSub = nValue - static_cast(1.0); - // ---- 0.02 ----- 0.01 ---- 0 --- -0.99 ---- -0.98 ---- - // volatile T dSubAbsolut = fabs(dSub); - // ---- 0.02 ----- 0.01 ---- 0 (cut) - if ( dSub == 0) - break; - } - if (i != j) - { - // hmmm.... - // imho i +- 1 == j is a good value - int n = i - j; - if (n < 0) n = -n; - if (n <= 1) - { - return std::min(i,j); - } - else - { - printf("warning: presision differs more than 1!\n"); - } - } - - return i; -} - class toInt: public CppUnit::TestFixture { public: void test() { -- cgit