From 780135281dfdf3f8088f6e4279e84dc86eb94907 Mon Sep 17 00:00:00 2001 From: Nathan Jones Date: Sun, 11 May 2008 19:53:20 -0400 Subject: Fix compile errors with gcc 4.3 --- amount.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'amount.cc') diff --git a/amount.cc b/amount.cc index 4f07b0b0..f9b6fc29 100644 --- a/amount.cc +++ b/amount.cc @@ -4,6 +4,7 @@ #include #include #include +#include #include -- cgit v1.2.3 From 7ddb1415b678a4ef00c6391f5c35e8598926ff3d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 13 Jul 2008 22:50:21 -0400 Subject: Added #include lines for building on Debian lenny. --- amount.cc | 1 - amount.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'amount.cc') diff --git a/amount.cc b/amount.cc index f9b6fc29..4f07b0b0 100644 --- a/amount.cc +++ b/amount.cc @@ -4,7 +4,6 @@ #include #include #include -#include #include diff --git a/amount.h b/amount.h index dfe8d2df..3df04c1d 100644 --- a/amount.h +++ b/amount.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 6815aac361180be49f671c2a39106c723a861247 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 17 Jul 2008 17:44:26 -0400 Subject: Removed unnecessary assert. --- amount.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'amount.cc') diff --git a/amount.cc b/amount.cc index 4f07b0b0..69d26477 100644 --- a/amount.cc +++ b/amount.cc @@ -1830,7 +1830,6 @@ bool compare_amount_commodities::operator()(const amount_t * left, // The two annotated commodities don't differ enough to matter. This // should make this identical. - assert(0); return true; } } -- cgit v1.2.3 From 6cb519231fba70ae5b84c1ae60aa8a653b14aa2e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 17 Jul 2008 20:52:20 -0400 Subject: If AMOUNT_PARSE_NO_MIGRATE is set, do not set a commodity's precision even if this is the first time a commodity is being seen. The reason is that it's quite possible (especially in bug reports) for the cost of a priced transaction to contain the first occurrence of a commodity. --- amount.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'amount.cc') diff --git a/amount.cc b/amount.cc index 69d26477..1ac2f407 100644 --- a/amount.cc +++ b/amount.cc @@ -1170,14 +1170,13 @@ void amount_t::parse(std::istream& in, unsigned char flags) // Set the commodity's flags and precision accordingly - if (newly_created || ! (flags & AMOUNT_PARSE_NO_MIGRATE)) { + if (! (flags & AMOUNT_PARSE_NO_MIGRATE)) { commodity().add_flags(comm_flags); if (quantity->prec > commodity().precision()) commodity().set_precision(quantity->prec); - } - - if (flags & AMOUNT_PARSE_NO_MIGRATE) + } else { quantity->flags |= BIGINT_KEEP_PREC; + } // Now we have the final number. Remove commas and periods, if // necessary. -- cgit v1.2.3