r18416 - gnucash/trunk/src/libqof/qof - Bug #540452: Remove inline from function declaration/definition because it contradicts the C99 standard.
Christian Stimming
cstim at code.gnucash.org
Mon Nov 16 16:42:40 EST 2009
Author: cstim
Date: 2009-11-16 16:42:40 -0500 (Mon, 16 Nov 2009)
New Revision: 18416
Trac: http://svn.gnucash.org/trac/changeset/18416
Modified:
gnucash/trunk/src/libqof/qof/qofmath128.c
gnucash/trunk/src/libqof/qof/qofmath128.h
Log:
Bug #540452: Remove inline from function declaration/definition because it contradicts the C99 standard.
Patch by Halton Huo: Remove inline from qofmath128.c and qofmath128.h.
Cstim notes: The way the code is written (.h/.c) we should not have
any "inline" there. If the functions are intended to be used inline
only (and they are, in gnc-numeric.c), the definitions should be moved
into gnc-numeric.c anyway and the declarations removed.
Modified: gnucash/trunk/src/libqof/qof/qofmath128.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofmath128.c 2009-11-16 21:42:23 UTC (rev 18415)
+++ gnucash/trunk/src/libqof/qof/qofmath128.c 2009-11-16 21:42:40 UTC (rev 18416)
@@ -37,7 +37,7 @@
/** Multiply a pair of signed 64-bit numbers,
* returning a signed 128-bit number.
*/
-inline qofint128
+qofint128
mult128 (gint64 a, gint64 b)
{
qofint128 prod;
@@ -106,7 +106,7 @@
}
/** Shift right by one bit (i.e. divide by two) */
-inline qofint128
+qofint128
shift128 (qofint128 x)
{
guint64 sbit = x.hi & 0x1;
@@ -127,7 +127,7 @@
}
/** Shift leftt by one bit (i.e. multiply by two) */
-inline qofint128
+qofint128
shiftleft128 (qofint128 x)
{
guint64 sbit;
@@ -149,7 +149,7 @@
}
/** increment a 128-bit number by one */
-inline qofint128
+qofint128
inc128 (qofint128 a)
{
if (0 == a.isneg)
@@ -176,7 +176,7 @@
/** Divide a signed 128-bit number by a signed 64-bit,
* returning a signed 128-bit number.
*/
-inline qofint128
+qofint128
div128 (qofint128 n, gint64 d)
{
qofint128 quotient;
@@ -215,7 +215,7 @@
* I beleive that ths algo is overflow-free, but should be
* audited some more ...
*/
-inline gint64
+gint64
rem128 (qofint128 n, gint64 d)
{
qofint128 quotient = div128 (n, d);
@@ -228,7 +228,7 @@
}
/** Return true of two numbers are equal */
-inline gboolean
+gboolean
equal128 (qofint128 a, qofint128 b)
{
if (a.lo != b.lo) return 0;
@@ -238,7 +238,7 @@
}
/** Return returns 1 if a>b, -1 if b>a, 0 if a == b */
-inline int
+int
cmp128 (qofint128 a, qofint128 b)
{
if ((0 == a.isneg) && b.isneg) return 1;
@@ -260,7 +260,7 @@
}
/** Return the greatest common factor of two 64-bit numbers */
-inline guint64
+guint64
gcf64(guint64 num, guint64 denom)
{
guint64 t;
@@ -281,7 +281,7 @@
}
/** Return the least common multiple of two 64-bit numbers. */
-inline qofint128
+qofint128
lcm128 (guint64 a, guint64 b)
{
guint64 gcf = gcf64 (a, b);
@@ -290,7 +290,7 @@
}
/** Add a pair of 128-bit numbers, returning a 128-bit number */
-inline qofint128
+qofint128
add128 (qofint128 a, qofint128 b)
{
qofint128 sum;
Modified: gnucash/trunk/src/libqof/qof/qofmath128.h
===================================================================
--- gnucash/trunk/src/libqof/qof/qofmath128.h 2009-11-16 21:42:23 UTC (rev 18415)
+++ gnucash/trunk/src/libqof/qof/qofmath128.h 2009-11-16 21:42:40 UTC (rev 18416)
@@ -41,45 +41,45 @@
} qofint128;
/** Return true of two numbers are equal */
-inline gboolean equal128 (qofint128 a, qofint128 b);
+gboolean equal128 (qofint128 a, qofint128 b);
/** Return returns 1 if a>b, -1 if b>a, 0 if a == b */
-inline int cmp128 (qofint128 a, qofint128 b);
+int cmp128 (qofint128 a, qofint128 b);
/** Shift right by one bit (i.e. divide by two) */
-inline qofint128 shift128 (qofint128 x);
+qofint128 shift128 (qofint128 x);
/** Shift left by one bit (i.e. multiply by two) */
-inline qofint128 shiftleft128 (qofint128 x);
+qofint128 shiftleft128 (qofint128 x);
/** Increment by one */
-inline qofint128 inc128 (qofint128 a);
+qofint128 inc128 (qofint128 a);
/** Add a pair of 128-bit numbers, returning a 128-bit number */
-inline qofint128 add128 (qofint128 a, qofint128 b);
+qofint128 add128 (qofint128 a, qofint128 b);
/** Multiply a pair of signed 64-bit numbers,
* returning a signed 128-bit number.
*/
-inline qofint128 mult128 (gint64 a, gint64 b);
+qofint128 mult128 (gint64 a, gint64 b);
/** Divide a signed 128-bit number by a signed 64-bit,
* returning a signed 128-bit number.
*/
-inline qofint128 div128 (qofint128 n, gint64 d);
+qofint128 div128 (qofint128 n, gint64 d);
/** Return the remainder of a signed 128-bit number modulo
* a signed 64-bit. That is, return n%d in 128-bit math.
* I beleive that ths algo is overflow-free, but should be
* audited some more ...
*/
-inline gint64 rem128 (qofint128 n, gint64 d);
+gint64 rem128 (qofint128 n, gint64 d);
/** Return the greatest common factor of two 64-bit numbers */
-inline guint64 gcf64(guint64 num, guint64 denom);
+guint64 gcf64(guint64 num, guint64 denom);
/** Return the least common multiple of two 64-bit numbers. */
-inline qofint128 lcm128 (guint64 a, guint64 b);
+qofint128 lcm128 (guint64 a, guint64 b);
#endif
More information about the gnucash-changes
mailing list