summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-05-09 20:40:42 -0700
committerCraig Earls <enderw88@gmail.com>2014-05-09 20:40:42 -0700
commit20b915668f7e6d4be9993e11dfc04ae1760a36f7 (patch)
tree668de51ac7625355aaaa8c3c88aed82344c690c3 /src
parent2906a2f759b67363c070161202596e746921f09c (diff)
parentdbfbf2bc893de3c44dcc08c33811bc274f647672 (diff)
downloadfork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.tar.gz
fork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.tar.bz2
fork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.zip
Merge commit 'dbfbf2bc893de3c44dcc08c33811bc274f647672'
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/pool.cc3
-rw-r--r--src/report.h1
-rw-r--r--src/utils.cc8
-rw-r--r--src/xact.cc6
5 files changed, 16 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a77422db..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})
@@ -185,7 +186,6 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
elseif(CMAKE_CXX_COMPILER MATCHES "g\\+\\+")
set(GXX_WARNING_FLAGS
- -ansi
-pedantic
-Wall
-Winvalid-pch
@@ -223,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/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/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);
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);
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()) {