summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2019-01-14 17:29:50 -0800
committerGitHub <noreply@github.com>2019-01-14 17:29:50 -0800
commitb29d07ac62a9e7df427ab71a789cfcc96de9f4db (patch)
tree7d0c769098f5b69dd80b24c8a831d7255d70a71c /src
parentccb7019c8b014b907d88bbcfb802b7f1458383b6 (diff)
parent88fd3a38b9456998c59dd49bb225504156274c83 (diff)
downloadfork-ledger-b29d07ac62a9e7df427ab71a789cfcc96de9f4db.tar.gz
fork-ledger-b29d07ac62a9e7df427ab71a789cfcc96de9f4db.tar.bz2
fork-ledger-b29d07ac62a9e7df427ab71a789cfcc96de9f4db.zip
Merge branch 'next' into move-have-edit
Diffstat (limited to 'src')
-rw-r--r--src/error.h2
-rw-r--r--src/mask.cc3
-rw-r--r--src/output.cc7
-rw-r--r--src/py_value.cc8
-rw-r--r--src/query.cc1
-rw-r--r--src/system.hh.in4
-rw-r--r--src/utils.h6
7 files changed, 9 insertions, 22 deletions
diff --git a/src/error.h b/src/error.h
index ba278519..bc9953cd 100644
--- a/src/error.h
+++ b/src/error.h
@@ -47,7 +47,7 @@ namespace ledger {
extern std::ostringstream _desc_buffer;
template <typename T>
-inline void throw_func(const string& message) {
+[[ noreturn ]] inline void throw_func(const string& message) {
_desc_buffer.clear();
_desc_buffer.str("");
throw T(message);
diff --git a/src/mask.cc b/src/mask.cc
index 434acad6..35e690de 100644
--- a/src/mask.cc
+++ b/src/mask.cc
@@ -75,9 +75,8 @@ mask_t& mask_t::assign_glob(const string& pat)
if (i + 1 < len) {
re_pat += pat[++i];
break;
- } else {
- // fallthrough...
}
+ // fallthrough...
default:
re_pat += pat[i];
break;
diff --git a/src/output.cc b/src/output.cc
index c2fa83ac..09d3ad9e 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -284,8 +284,9 @@ void report_accounts::flush()
std::ostream& out(report.output_stream);
format_t prepend_format;
std::size_t prepend_width;
+ bool do_prepend_format;
- if (report.HANDLED(prepend_format_)) {
+ if ((do_prepend_format = report.HANDLED(prepend_format_))) {
prepend_format.parse_format(report.HANDLER(prepend_format_).str());
prepend_width = report.HANDLED(prepend_width_)
? lexical_cast<std::size_t>(report.HANDLER(prepend_width_).str())
@@ -293,7 +294,7 @@ void report_accounts::flush()
}
foreach (accounts_pair& entry, accounts) {
- if (prepend_format) {
+ if (do_prepend_format) {
bind_scope_t bound_scope(report, *entry.first);
out.width(static_cast<std::streamsize>(prepend_width));
out << prepend_format(bound_scope);
diff --git a/src/py_value.cc b/src/py_value.cc
index f4f63946..486228c0 100644
--- a/src/py_value.cc
+++ b/src/py_value.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -88,12 +88,6 @@ namespace {
return buf.str();
}
- string py_dump_relaxed(const value_t& value) {
- std::ostringstream buf;
- value.dump(buf, true);
- return buf.str();
- }
-
void py_set_string(value_t& value, const string& str) {
return value.set_string(str);
}
diff --git a/src/query.cc b/src/query.cc
index fc1d4ff0..883bea40 100644
--- a/src/query.cc
+++ b/src/query.cc
@@ -155,6 +155,7 @@ query_t::lexer_t::next_token(query_t::lexer_t::token_t::kind_t tok_context)
case ')':
if (! consume_next && tok_context == token_t::TOK_EXPR)
goto test_ident;
+ // fall through...
case '(':
case '&':
case '|':
diff --git a/src/system.hh.in b/src/system.hh.in
index 3c1187d9..c093e334 100644
--- a/src/system.hh.in
+++ b/src/system.hh.in
@@ -59,9 +59,7 @@
#define HAVE_GETTEXT @HAVE_GETTEXT@
-#cmakedefine HAVE_ACCESS
#cmakedefine HAVE_EDIT
-#cmakedefine HAVE_REALPATH
#cmakedefine HAVE_GETPWUID
#cmakedefine HAVE_GETPWNAM
#cmakedefine HAVE_IOCTL
@@ -143,7 +141,6 @@ typedef std::ostream::pos_type ostream_pos_type;
#undef isspace(c)
#endif
-#include <sys/stat.h>
#if defined(_WIN32) || defined(__CYGWIN__)
#include <io.h>
#else
@@ -243,7 +240,6 @@ typedef std::ostream::pos_type ostream_pos_type;
#include <boost/python/detail/wrap_python.hpp>
#include <datetime.h>
-#include <unicodeobject.h>
#include <boost/python/module_init.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
diff --git a/src/utils.h b/src/utils.h
index 857b8289..c9146dd7 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -500,10 +500,6 @@ inline T& downcast(U& object) {
path resolve_path(const path& pathname);
-#ifdef HAVE_REALPATH
-extern "C" char * realpath(const char *, char resolved_path[]);
-#endif
-
inline const string& either_or(const string& first,
const string& second) {
return first.empty() ? second : first;