gnucash unstable: Fix use of guile function introduced in 2.0.10, not available in Ubuntu14.04.
John Ralls
jralls at code.gnucash.org
Fri Dec 22 14:25:32 EST 2017
Updated via https://github.com/Gnucash/gnucash/commit/19412de2 (commit)
from https://github.com/Gnucash/gnucash/commit/6e9025d2 (commit)
commit 19412de2216a624a6a27e4f1afd4264deb8e57aa
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Dec 22 11:07:29 2017 -0800
Fix use of guile function introduced in 2.0.10, not available in Ubuntu14.04.
Also generalize KVP type detection so that signed and unsigned values\nare appropriately converted.
diff --git a/libgnucash/engine/kvp-scm.cpp b/libgnucash/engine/kvp-scm.cpp
index 2e95e65..07a7859 100644
--- a/libgnucash/engine/kvp-scm.cpp
+++ b/libgnucash/engine/kvp-scm.cpp
@@ -27,16 +27,21 @@ gnc_scm_to_kvp_value_ptr(SCM val)
{
if (scm_is_rational(val))
{
- if (scm_is_exact_integer(val) &&
- scm_is_signed_integer(val, INT64_MIN, INT64_MAX))
+ if (scm_is_exact(val) &&
+ (scm_is_signed_integer(val, INT64_MIN, INT64_MAX) ||
+ scm_is_unsigned_integer(val, INT64_MIN, INT64_MAX)))
{
return new KvpValue{scm_to_int64(val)};
}
else if (scm_is_exact(val) &&
- scm_is_signed_integer(scm_numerator(val),
- INT64_MIN, INT64_MAX) &&
- scm_is_signed_integer(scm_denominator(val),
- INT64_MIN, INT64_MAX))
+ (scm_is_signed_integer(scm_numerator(val),
+ INT64_MIN, INT64_MAX) ||
+ scm_is_unsigned_integer(scm_numerator(val),
+ INT64_MIN, INT64_MAX)) &&
+ (scm_is_signed_integer(scm_denominator(val),
+ INT64_MIN, INT64_MAX) ||
+ (scm_is_unsigned_integer(scm_denominator(val),
+ INT64_MIN, INT64_MAX))))
{
return new KvpValue{gnc_scm_to_numeric(val)};
}
Summary of changes:
libgnucash/engine/kvp-scm.cpp | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
More information about the gnucash-changes
mailing list