]> www.ginac.de Git - cln.git/commitdiff
Remove internal inline versions of numerator/denominator(cl_RA).
authorRichard Kreckel <kreckel@ginac.de>
Mon, 19 Oct 2020 18:36:33 +0000 (20:36 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Mon, 19 Oct 2020 18:36:33 +0000 (20:36 +0200)
These functions were not used internally, but they broke LTO because
they were declared extern publicly.

See <https://www.ginac.de/pipermail/cln-list/2020-September/000772.html>.

src/float/lfloat/elem/cl_LF_RA_div.cc
src/float/lfloat/elem/cl_LF_RA_mul.cc
src/float/lfloat/elem/cl_RA_LF_div.cc
src/rational/cl_RA.h
src/rational/elem/cl_RA_denominator.cc
src/rational/elem/cl_RA_numerator.cc

index b637eed8763310454838eaf795a9107fb0f88160..a0fae065b43f33aac42db6bb7fb563e697ee6fa7 100644 (file)
@@ -24,8 +24,8 @@ const cl_LF cl_LF_RA_div (const cl_LF& x, const cl_RA& y)
                return cl_LF_I_div(x,y);
        } else {
                DeclareType(cl_RT,y);
-               var const cl_I& u = TheRatio(y)->numerator; // u /= 0
-               var const cl_I& v = TheRatio(y)->denominator; // v /= 0
+               var const cl_I& u = numerator(y); // u /= 0
+               var const cl_I& v = denominator(y); // v /= 0
                return cl_LF_I_div(The(cl_LF)(cl_LF_I_mul(x,v)),u);
        }
 }
index 8abc945d3e30340aa7e47a22df8c0a522300b52f..04ecc0f91dcbe3cf7fbf20b06e9cfbb18fbfeedd 100644 (file)
@@ -23,8 +23,8 @@ const cl_R cl_LF_RA_mul (const cl_LF& x, const cl_RA& y)
                return cl_LF_I_mul(x,y);
        } else {
                DeclareType(cl_RT,y);
-               var const cl_I& u = TheRatio(y)->numerator; // u /= 0
-               var const cl_I& v = TheRatio(y)->denominator; // v /= 0
+               var const cl_I& u = numerator(y); // u /= 0
+               var const cl_I& v = denominator(y); // v /= 0
                return cl_LF_I_div(The(cl_LF)(cl_LF_I_mul(x,u)),v);
        }
 }
index db29e7f976511e267873ec36fb597a9945169655..51b2f662017539ab6ea41f32e2c83fa1c6f38e7e 100644 (file)
@@ -23,8 +23,8 @@ const cl_R cl_RA_LF_div (const cl_RA& x, const cl_LF& y)
                return cl_I_LF_div(x,y);
        } else {
                DeclareType(cl_RT,x);
-               var const cl_I& u = TheRatio(x)->numerator;
-               var const cl_I& v = TheRatio(x)->denominator; // v /= 0
+               var const cl_I& u = numerator(x);
+               var const cl_I& v = denominator(x); // v /= 0
                return cl_I_LF_div(u,The(cl_LF)(cl_LF_I_mul(y,v)));
        }
 }
index e0adf30fbe7ede2632e3b3b0e5f1019134d9119a..9b60b957399fb15977bff00f63135073b31092b2 100644 (file)
@@ -133,27 +133,6 @@ inline bool eq (const cl_RA& x, sint32 y)
 // I_I_div_RA(a,b)
   extern const cl_RA I_I_div_RA (const cl_I& a, const cl_I& b);
 
-// Liefert den Zähler einer rationalen Zahl.
-// numerator(r)
-inline const cl_I numerator (const cl_RA& r)
-{
-       if (integerp(r)) {
-               DeclareType(cl_I,r);
-               return r;
-       } else
-               return TheRatio(r)->numerator;
-}
-
-// Liefert den Nenner einer rationalen Zahl.
-// denominator(r)
-inline const cl_I denominator (const cl_RA& r)
-{
-       if (integerp(r))
-               return 1;
-       else
-               return TheRatio(r)->denominator;
-}
-
 // Liefert Zähler und Nenner einer rationalen Zahl.
 // RA_numden_I_I(r, num=,den=);
 // > r: rationale Zahl
index 78e23cd35a800506f8129cd3b272f4b328253d25..cd8d6ff19b75aa205abef278544e039aa2b5269c 100644 (file)
@@ -9,15 +9,16 @@
 
 // Implementation.
 
-#define denominator inline_denominator
 #include "rational/cl_RA.h"
-#undef denominator
 
 namespace cln {
 
 const cl_I denominator (const cl_RA& r)
 {
-       return inline_denominator(r);
+       if (integerp(r))
+               return 1;
+       else
+               return TheRatio(r)->denominator;
 }
 
 }  // namespace cln
index f009301fa7359abb3dfe78d8f535381d8a096517..b123dc93c9f36af1a2730eea0cb348d20bd9ef92 100644 (file)
@@ -9,15 +9,17 @@
 
 // Implementation.
 
-#define numerator inline_numerator
 #include "rational/cl_RA.h"
-#undef numerator
 
 namespace cln {
 
 const cl_I numerator (const cl_RA& r)
 {
-       return inline_numerator(r);
+       if (integerp(r)) {
+               DeclareType(cl_I,r);
+               return r;
+       } else
+               return TheRatio(r)->numerator;
 }
 
 }  // namespace cln