fixes
This commit is contained in:
parent
048d59afbc
commit
019a42f199
3 changed files with 7 additions and 43 deletions
12
amount.cc
12
amount.cc
|
|
@ -572,16 +572,6 @@ amount_t::operator std::string() const
|
||||||
return s.str();
|
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)
|
void parse_quantity(std::istream& in, std::string& value)
|
||||||
{
|
{
|
||||||
static char buf[256];
|
static char buf[256];
|
||||||
|
|
@ -605,7 +595,7 @@ void parse_commodity(std::istream& in, std::string& symbol)
|
||||||
assert(0);
|
assert(0);
|
||||||
} else {
|
} else {
|
||||||
READ_INTO(in, buf, 256, c, ! std::isspace(c) && ! std::isdigit(c) &&
|
READ_INTO(in, buf, 256, c, ! std::isspace(c) && ! std::isdigit(c) &&
|
||||||
c != '-' && c != '.');
|
c != '-' && c != '.');
|
||||||
}
|
}
|
||||||
symbol = buf;
|
symbol = buf;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
28
textual.cc
28
textual.cc
|
|
@ -4,6 +4,7 @@
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "option.h"
|
#include "option.h"
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
@ -17,32 +18,15 @@ namespace ledger {
|
||||||
|
|
||||||
#define MAX_LINE 1024
|
#define MAX_LINE 1024
|
||||||
|
|
||||||
std::string path;
|
std::string path;
|
||||||
unsigned int linenum;
|
unsigned int linenum;
|
||||||
|
|
||||||
#ifdef TIMELOG_SUPPORT
|
#ifdef TIMELOG_SUPPORT
|
||||||
static std::time_t time_in;
|
static std::time_t time_in;
|
||||||
static account_t * last_account;
|
static account_t * last_account;
|
||||||
static std::string last_desc;
|
static std::string last_desc;
|
||||||
#endif
|
#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)
|
inline char * next_element(char * buf, bool variable = false)
|
||||||
{
|
{
|
||||||
for (char * p = buf; *p; p++) {
|
for (char * p = buf; *p; p++) {
|
||||||
|
|
|
||||||
10
valexpr.cc
10
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);
|
value_expr_t * parse_value_term(std::istream& in);
|
||||||
|
|
||||||
inline value_expr_t * parse_value_term(const char * p) {
|
inline value_expr_t * parse_value_term(const char * p) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue