summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-17 16:10:48 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-17 16:10:48 -0400
commit019a42f199494c86b0aeea59caf9421d96a2c009 (patch)
tree33174f3a5d8cb742dd2e704aedb175fe94c60d82
parent048d59afbccb859186112f2e6079d85b258d6e6b (diff)
downloadfork-ledger-019a42f199494c86b0aeea59caf9421d96a2c009.tar.gz
fork-ledger-019a42f199494c86b0aeea59caf9421d96a2c009.tar.bz2
fork-ledger-019a42f199494c86b0aeea59caf9421d96a2c009.zip
fixes
-rw-r--r--amount.cc12
-rw-r--r--textual.cc28
-rw-r--r--valexpr.cc10
3 files changed, 7 insertions, 43 deletions
diff --git a/amount.cc b/amount.cc
index 8aaab7d9..a8f128cf 100644
--- a/amount.cc
+++ b/amount.cc
@@ -572,16 +572,6 @@ amount_t::operator std::string() const
return s.str();
}
-static inline char peek_next_nonws(std::istream& in)
-{
- char c = in.peek();
- while (! in.eof() && std::isspace(c)) {
- in.get(c);
- c = in.peek();
- }
- return c;
-}
-
void parse_quantity(std::istream& in, std::string& value)
{
static char buf[256];
@@ -605,7 +595,7 @@ void parse_commodity(std::istream& in, std::string& symbol)
assert(0);
} else {
READ_INTO(in, buf, 256, c, ! std::isspace(c) && ! std::isdigit(c) &&
- c != '-' && c != '.');
+ c != '-' && c != '.');
}
symbol = buf;
}
diff --git a/textual.cc b/textual.cc
index 15aa33e0..88a1720a 100644
--- a/textual.cc
+++ b/textual.cc
@@ -4,6 +4,7 @@
#include "error.h"
#include "option.h"
#include "timing.h"
+#include "util.h"
#include <fstream>
#include <sstream>
@@ -17,32 +18,15 @@ namespace ledger {
#define MAX_LINE 1024
-std::string path;
-unsigned int linenum;
+std::string path;
+unsigned int linenum;
#ifdef TIMELOG_SUPPORT
-static std::time_t time_in;
-static account_t * last_account;
-static std::string last_desc;
+static std::time_t time_in;
+static account_t * last_account;
+static std::string last_desc;
#endif
-inline char * skip_ws(char * ptr)
-{
- while (*ptr == ' ' || *ptr == '\t' || *ptr == '\n')
- ptr++;
- return ptr;
-}
-
-inline char peek_next_nonws(std::istream& in)
-{
- char c = in.peek();
- while (! in.eof() && std::isspace(c) && c != '\n') {
- in.get(c);
- c = in.peek();
- }
- return c;
-}
-
inline char * next_element(char * buf, bool variable = false)
{
for (char * p = buf; *p; p++) {
diff --git a/valexpr.cc b/valexpr.cc
index 74d4587b..5dfac952 100644
--- a/valexpr.cc
+++ b/valexpr.cc
@@ -323,16 +323,6 @@ void value_expr_t::compute(balance_t& result, const details_t& details) const
}
}
-inline char peek_next_nonws(std::istream& in)
-{
- char c = in.peek();
- while (! in.eof() && std::isspace(c) && c != '\n') {
- in.get(c);
- c = in.peek();
- }
- return c;
-}
-
value_expr_t * parse_value_term(std::istream& in);
inline value_expr_t * parse_value_term(const char * p) {