From 07b206bf6abe582ff155a4094fd81d002469ba5d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 27 Apr 2014 20:30:12 -0500 Subject: Add the --no-pager option --- src/report.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/report.h b/src/report.h index 120a7020..c500fb9b 100644 --- a/src/report.h +++ b/src/report.h @@ -302,6 +302,7 @@ public: HANDLER(market).report(out); HANDLER(meta_).report(out); HANDLER(monthly).report(out); + HANDLER(no_pager).report(out); HANDLER(no_rounding).report(out); HANDLER(no_titles).report(out); HANDLER(no_total).report(out); -- cgit v1.2.3 From 73caafa2c540384f19669567ed95b598fcf42463 Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Wed, 7 May 2014 19:08:06 +0200 Subject: fix debug build for gcc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -ansi ≡ -std=c++98 ;) --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a77422db..e8b2af53 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -185,7 +185,6 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") elseif(CMAKE_CXX_COMPILER MATCHES "g\\+\\+") set(GXX_WARNING_FLAGS - -ansi -pedantic -Wall -Winvalid-pch -- cgit v1.2.3 From 1aa0e03a9e7f9f1a51395a60fc1336bea3ca2aa9 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 7 May 2014 20:49:45 +0000 Subject: Fix build for building with g++ 4.8 --- CMakeLists.txt | 2 +- acprep | 6 +++--- default.nix | 2 +- src/CMakeLists.txt | 2 ++ src/utils.cc | 8 ++++++++ 5 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/CMakeLists.txt b/CMakeLists.txt index a6e52f95..8740e140 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ PROJECT(ledger) set(Ledger_VERSION_MAJOR 3) set(Ledger_VERSION_MINOR 0) set(Ledger_VERSION_PATCH 2) -set(Ledger_VERSION_DATE 20140417) +set(Ledger_VERSION_DATE 20140507) enable_testing() diff --git a/acprep b/acprep index f9fb74d7..0155ec73 100755 --- a/acprep +++ b/acprep @@ -875,9 +875,9 @@ class PrepareBuild(CommandLineApp): if self.options.boost_include: conf_args.append('-DBOOST_INCLUDEDIR=%s' % self.options.boost_include) - if self.options.build_dir: - conf_args.append('-DBUILD_DIR=%s' % - self.options.build_dir) + # if self.options.build_dir: + # conf_args.append('-DBUILD_DIR=%s' % + # self.options.build_dir) if self.prefix_directory(): conf_args.append('-DCMAKE_INSTALL_PREFIX=%s' % self.prefix_directory()) diff --git a/default.nix b/default.nix index f1745ce4..cf45b06e 100644 --- a/default.nix +++ b/default.nix @@ -2,7 +2,7 @@ , texinfo, gnused }: let - rev = "20140417"; + rev = "20140507"; in stdenv.mkDerivation { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e8b2af53..9752b052 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -167,6 +167,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") if(BUILD_LIBRARY) list(APPEND _args ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) endif() + list(APPEND _args "-std=c++11 ") list(APPEND _args "-x c++-header " ${_inc}) list(APPEND _args -c ${_header_filename} -o ${_pch_filename}) @@ -222,6 +223,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") list(APPEND _args ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) endif() list(APPEND _args ${GXX_WARNING_FLAGS}) + list(APPEND _args "-std=c++11 ") list(APPEND _args "-x c++-header " ${_inc}) list(APPEND _args -c ${_header_filename} -o ${_gch_filename}) diff --git a/src/utils.cc b/src/utils.cc index 2256d22a..741ce79d 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -229,7 +229,11 @@ static void trace_delete_func(void * ptr, const char * which) //#if !defined(__has_feature) || !__has_feature(address_sanitizer) +#ifdef _GLIBCXX_THROW +void * operator new(std::size_t size) _GLIBCXX_THROW(std::bad_alloc) { +#else void * operator new(std::size_t size) throw (std::bad_alloc) { +#endif void * ptr = std::malloc(size); if (DO_VERIFY() && ledger::memory_tracing_active) ledger::trace_new_func(ptr, "new", size); @@ -241,7 +245,11 @@ void * operator new(std::size_t size, const std::nothrow_t&) throw() { ledger::trace_new_func(ptr, "new", size); return ptr; } +#ifdef _GLIBCXX_THROW +void * operator new[](std::size_t size) _GLIBCXX_THROW(std::bad_alloc) { +#else void * operator new[](std::size_t size) throw (std::bad_alloc) { +#endif void * ptr = std::malloc(size); if (DO_VERIFY() && ledger::memory_tracing_active) ledger::trace_new_func(ptr, "new[]", size); -- cgit v1.2.3 From bd8a1a67560f1ff8c443351b55b4731f1be04126 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 8 May 2014 19:22:17 +0000 Subject: Use the POST_COST_VIRTUAL flag when exchange commodities Fixes #999 --- src/pool.cc | 3 ++- src/xact.cc | 6 +++--- test/regress/999.test | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 test/regress/999.test (limited to 'src') diff --git a/src/pool.cc b/src/pool.cc index 4526ac0c..71bfab72 100644 --- a/src/pool.cc +++ b/src/pool.cc @@ -267,7 +267,8 @@ commodity_pool_t::exchange(const amount_t& amount, // Do not record commodity exchanges where amount's commodity has a // fixated price, since this does not establish a market value for the // base commodity. - if (! per_unit_cost.is_realzero() && + if (add_price && + ! per_unit_cost.is_realzero() && (current_annotation == NULL || ! (current_annotation->price && current_annotation->has_flags(ANNOTATION_PRICE_FIXATED))) && diff --git a/src/xact.cc b/src/xact.cc index c7a9c6e3..eec4cff3 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -292,9 +292,9 @@ bool xact_base_t::finalize() _("A posting's cost must be of a different commodity than its amount")); cost_breakdown_t breakdown = - commodity_pool_t::current_pool->exchange - (post->amount, *post->cost, false, ! post->has_flags(POST_COST_VIRTUAL), - datetime_t(date(), time_duration(0, 0, 0, 0))); + commodity_pool_t::current_pool->exchange( + post->amount, *post->cost, false, ! post->has_flags(POST_COST_VIRTUAL), + datetime_t(date(), time_duration(0, 0, 0, 0))); if (post->amount.has_annotation() && post->amount.annotation().price) { if (breakdown.basis_cost.commodity() == breakdown.final_cost.commodity()) { diff --git a/test/regress/999.test b/test/regress/999.test new file mode 100644 index 00000000..9865eeed --- /dev/null +++ b/test/regress/999.test @@ -0,0 +1,6 @@ +2012-03-10 My Brother + Assets:Brokerage 1000 AAPL (@) $1 + Income:Gifts Received + +test prices +end test -- cgit v1.2.3