]> www.ginac.de Git - cln.git/commitdiff
Restore ABI from version 1.3.4.
authorRichard Kreckel <kreckel@ginac.de>
Sun, 17 Nov 2019 21:19:14 +0000 (22:19 +0100)
committerRichard Kreckel <kreckel@ginac.de>
Sun, 17 Nov 2019 21:19:14 +0000 (22:19 +0100)
Make all signatures of fprintdecimal and fprinthexadecimal non-inline
functions, as they were before.

include/cln/io.h
src/base/output/cl_output_dec.cc
src/base/output/cl_output_hex.cc

index 0b73636d212410d3f49b64642f565d78c5d5210b..45abfda23682f31a15d4a5176fc2eb5d2d9271aa 100644 (file)
@@ -37,79 +37,27 @@ inline void fprint (std::ostream& stream, const char * string)
 }
 
 
-extern void fprintdecimal_impl (std::ostream& stream, uintptr_t x);
-extern void fprintdecimal_impl (std::ostream& stream, intptr_t x);
+extern void fprintdecimal (std::ostream& stream, unsigned int x);
+extern void fprintdecimal (std::ostream& stream, int x);
 
-inline void fprintdecimal (std::ostream& stream, unsigned int x)
-{
-       fprintdecimal_impl(stream,(uintptr_t)x);
-}
-inline void fprintdecimal (std::ostream& stream, int x)
-{
-       fprintdecimal_impl(stream,(intptr_t)x);
-}
-
-inline void fprintdecimal (std::ostream& stream, unsigned long x)
-{
-       fprintdecimal_impl(stream,(uintptr_t)x);
-}
-inline void fprintdecimal (std::ostream& stream, long x)
-{
-       fprintdecimal_impl(stream,(intptr_t)x);
-}
+extern void fprintdecimal (std::ostream& stream, unsigned long x);
+extern void fprintdecimal (std::ostream& stream, long x);
 
 #ifdef HAVE_LONGLONG
-#if long_long_bitsize <= pointer_bitsize
-inline void fprintdecimal (std::ostream& stream, unsigned long long x)
-{
-       fprintdecimal_impl(stream,(uintptr_t)x);
-}
-inline void fprintdecimal (std::ostream& stream, long long x)
-{
-       fprintdecimal_impl(stream,(intptr_t)x);
-}
-#else
 extern void fprintdecimal (std::ostream& stream, unsigned long long x);
 extern void fprintdecimal (std::ostream& stream, long long x);
 #endif
-#endif
 
-extern void fprinthexadecimal_impl (std::ostream& stream, uintptr_t x);
-extern void fprinthexadecimal_impl (std::ostream& stream, intptr_t x);
+extern void fprinthexadecimal (std::ostream& stream, unsigned int x);
+extern void fprinthexadecimal (std::ostream& stream, int x);
 
-inline void fprinthexadecimal (std::ostream& stream, unsigned int x)
-{
-       fprinthexadecimal_impl(stream,(uintptr_t)x);
-}
-inline void fprinthexadecimal (std::ostream& stream, int x)
-{
-       fprinthexadecimal_impl(stream,(intptr_t)x);
-}
-
-inline void fprinthexadecimal (std::ostream& stream, unsigned long x)
-{
-       fprinthexadecimal_impl(stream,(uintptr_t)x);
-}
-inline void fprinthexadecimal (std::ostream& stream, long x)
-{
-       fprinthexadecimal_impl(stream,(intptr_t)x);
-}
+extern void fprinthexadecimal (std::ostream& stream, unsigned long x);
+extern void fprinthexadecimal (std::ostream& stream, long x);
 
 #ifdef HAVE_LONGLONG
-#if long_long_bitsize <= pointer_bitsize
-inline void fprinthexadecimal (std::ostream& stream, unsigned long long x)
-{
-       fprinthexadecimal_impl(stream,(uintptr_t)x);
-}
-inline void fprinthexadecimal (std::ostream& stream, long long x)
-{
-       fprinthexadecimal_impl(stream,(intptr_t)x);
-}
-#else
 extern void fprinthexadecimal (std::ostream& stream, unsigned long long x);
 extern void fprinthexadecimal (std::ostream& stream, long long x);
 #endif
-#endif
 
 
 struct cl_print_flags;
index 37413277d76d2496733dd07d352b462b8321fc4b..919327bde9b898223d3e8388d9474797f18adc3e 100644 (file)
@@ -14,7 +14,7 @@ namespace cln {
 // We don't use `stream << x' or `stream << dec << x', because an ostream
 // carries so many attributes, and we don't want to modifies these attributes.
 
-void fprintdecimal_impl (std::ostream& stream, uintptr_t x)
+static void fprintdecimal_impl (std::ostream& stream, uintptr_t x)
 {
        #define bufsize (((sizeof(uintptr_t)*53)/22)+1) // 53/22 > 8*log(2)/log(10)
        var char buf[bufsize+1];
@@ -30,7 +30,7 @@ void fprintdecimal_impl (std::ostream& stream, uintptr_t x)
        #undef bufsize
 }
 
-void fprintdecimal_impl (std::ostream& stream, intptr_t x)
+static void fprintdecimal_impl (std::ostream& stream, intptr_t x)
 {
        if (x >= 0)
                fprintdecimal(stream,(uintptr_t)x);
@@ -40,10 +40,31 @@ void fprintdecimal_impl (std::ostream& stream, intptr_t x)
        }
 }
 
-#if defined(HAVE_LONGLONG) && (long_long_bitsize > pointer_bitsize)
+void fprintdecimal (std::ostream& stream, unsigned int x)
+{
+        fprintdecimal_impl(stream,(uintptr_t)x);
+}
+void fprintdecimal (std::ostream& stream, int x)
+{
+        fprintdecimal_impl(stream,(intptr_t)x);
+}
+
+void fprintdecimal (std::ostream& stream, unsigned long x)
+{
+        fprintdecimal_impl(stream,(uintptr_t)x);
+}
+void fprintdecimal (std::ostream& stream, long x)
+{
+        fprintdecimal_impl(stream,(intptr_t)x);
+}
+
+#ifdef HAVE_LONGLONG
 
 void fprintdecimal (std::ostream& stream, unsigned long long x)
 {
+#if long_long_bitsize <= pointer_bitsize
+        fprintdecimal_impl(stream,(uintptr_t)x);
+#else
        #define bufsize (((sizeof(unsigned long long)*53)/22)+1) // 53/22 > 8*log(2)/log(10)
        var char buf[bufsize+1];
        var char* bufptr = &buf[bufsize];
@@ -56,16 +77,21 @@ void fprintdecimal (std::ostream& stream, unsigned long long x)
        } while (x > 0);
        fprint(stream,bufptr);
        #undef bufsize
+#endif
 }
 
 void fprintdecimal (std::ostream& stream, long long x)
 {
+#if long_long_bitsize <= pointer_bitsize
+        fprintdecimal_impl(stream,(intptr_t)x);
+#else
        if (x >= 0)
                fprintdecimal(stream,(unsigned long long)x);
        else {
                fprintchar(stream,'-');
                fprintdecimal(stream,(unsigned long long)(-1-x)+1);
        }
+#endif
 }
 
 #endif
index a463da85c581d36c0d9af3c354a51ccbf137ba19..d71994feadbb452709be23dfb2d17b8059eb4efc 100644 (file)
@@ -11,7 +11,7 @@
 
 namespace cln {
 
-void fprinthexadecimal_impl (std::ostream& stream, uintptr_t x)
+static void fprinthexadecimal_impl (std::ostream& stream, uintptr_t x)
 {
        #define bufsize (sizeof(uintptr_t)*2)
        var char buf[bufsize+1];
@@ -27,7 +27,7 @@ void fprinthexadecimal_impl (std::ostream& stream, uintptr_t x)
        #undef bufsize
 }
 
-void fprinthexadecimal_impl (std::ostream& stream, intptr_t x)
+static void fprinthexadecimal_impl (std::ostream& stream, intptr_t x)
 {
        if (x >= 0)
                fprintdecimal(stream,(uintptr_t)x);
@@ -37,10 +37,31 @@ void fprinthexadecimal_impl (std::ostream& stream, intptr_t x)
        }
 }
 
-#if defined(HAVE_LONGLONG) && (long_long_bitsize > pointer_bitsize)
+void fprinthexadecimal (std::ostream& stream, unsigned int x)
+{
+        fprinthexadecimal_impl(stream,(uintptr_t)x);
+}
+void fprinthexadecimal (std::ostream& stream, int x)
+{
+        fprinthexadecimal_impl(stream,(intptr_t)x);
+}
+
+void fprinthexadecimal (std::ostream& stream, unsigned long x)
+{
+        fprinthexadecimal_impl(stream,(uintptr_t)x);
+}
+void fprinthexadecimal (std::ostream& stream, long x)
+{
+        fprinthexadecimal_impl(stream,(intptr_t)x);
+}
+
+#ifdef HAVE_LONGLONG
 
 void fprinthexadecimal (std::ostream& stream, unsigned long long x)
 {
+#if long_long_bitsize <= pointer_bitsize
+       fprinthexadecimal_impl(stream,(uintptr_t)x);
+#else
        #define bufsize (sizeof(unsigned long long)*2)
        var char buf[bufsize+1];
        var char* bufptr = &buf[bufsize];
@@ -53,16 +74,21 @@ void fprinthexadecimal (std::ostream& stream, unsigned long long x)
        } while (x > 0);
        fprint(stream,bufptr);
        #undef bufsize
+#endif
 }
 
 void fprinthexadecimal (std::ostream& stream, long long x)
 {
+#if long_long_bitsize <= pointer_bitsize
+       fprinthexadecimal_impl(stream,(intptr_t)x);
+#else
        if (x >= 0)
                fprintdecimal(stream,(unsigned long long)x);
        else {
                fprintchar(stream,'-');
                fprintdecimal(stream,(unsigned long long)(-1-x)+1);
        }
+#endif
 }
 
 #endif