summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-06-27 07:51:25 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-06-27 07:51:51 +0200
commit9a741fcad458875a806295ddbd41b68d82ce9095 (patch)
tree9d8ed908f43b459e221aef8a7d1da4b043ebbe40 /sal
parent3c6e378fd81b2bfd8a35e12557a90fa40428920e (diff)
loplugin:unreffun: also warn about unused function templates
Change-Id: I4a6280f47ca3c4a77b4e42fe05d79ded7fc30ef1
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/oustring/rtl_OUString2.cxx71
1 files changed, 0 insertions, 71 deletions
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<class T>
-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<T>(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<T>(1.0);
- volatile T dSub = nValue - static_cast<T>(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() {