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.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18416 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2009-11-16 21:42:40 +00:00
parent 8fea558f9a
commit 06dd5634b9
2 changed files with 22 additions and 22 deletions

View File

@ -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 @@ mult128 (gint64 a, gint64 b)
}
/** 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 @@ shift128 (qofint128 x)
}
/** Shift leftt by one bit (i.e. multiply by two) */
inline qofint128
qofint128
shiftleft128 (qofint128 x)
{
guint64 sbit;
@ -149,7 +149,7 @@ shiftleft128 (qofint128 x)
}
/** increment a 128-bit number by one */
inline qofint128
qofint128
inc128 (qofint128 a)
{
if (0 == a.isneg)
@ -176,7 +176,7 @@ inc128 (qofint128 a)
/** 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 @@ div128 (qofint128 n, gint64 d)
* 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 @@ rem128 (qofint128 n, gint64 d)
}
/** 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 @@ equal128 (qofint128 a, qofint128 b)
}
/** 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 @@ cmp128 (qofint128 a, qofint128 b)
}
/** Return the greatest common factor of two 64-bit numbers */
inline guint64
guint64
gcf64(guint64 num, guint64 denom)
{
guint64 t;
@ -281,7 +281,7 @@ gcf64(guint64 num, guint64 denom)
}
/** 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 @@ lcm128 (guint64 a, guint64 b)
}
/** Add a pair of 128-bit numbers, returning a 128-bit number */
inline qofint128
qofint128
add128 (qofint128 a, qofint128 b)
{
qofint128 sum;

View File

@ -41,45 +41,45 @@ typedef struct
} 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