summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-28 04:54:54 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-28 04:54:54 -0400
commit38122c22241cb8fe64f0d17cd3b084418f49edaa (patch)
tree9383f2082602f2d71dde5328fa8bcf3f6609a5b7 /src/utils.h
parentfb129fa7a1b293d3a04513aee3ca4a489f094754 (diff)
downloadfork-ledger-38122c22241cb8fe64f0d17cd3b084418f49edaa.tar.gz
fork-ledger-38122c22241cb8fe64f0d17cd3b084418f49edaa.tar.bz2
fork-ledger-38122c22241cb8fe64f0d17cd3b084418f49edaa.zip
Corrected warnings g++-4.3.3 was complaining about
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/utils.h b/src/utils.h
index 86cd56df..323d82b4 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -525,7 +525,7 @@ inline char * skip_ws(char * ptr) {
inline char * trim_ws(char * ptr) {
std::size_t len = std::strlen(ptr);
int i = int(len) - 1;
- while (i >= 0 && ptr[i] == ' ' || ptr[i] == '\t' || ptr[i] == '\n')
+ while (i >= 0 && (ptr[i] == ' ' || ptr[i] == '\t' || ptr[i] == '\n'))
ptr[i--] = '\0';
return skip_ws(ptr);
}
@@ -552,17 +552,17 @@ inline char * next_element(char * buf, bool variable = false) {
}
inline char peek_next_nonws(std::istream& in) {
- char c = in.peek();
+ char c = static_cast<char>(in.peek());
while (in.good() && ! in.eof() && std::isspace(c)) {
in.get(c);
- c = in.peek();
+ c = static_cast<char>(in.peek());
}
return c;
}
#define READ_INTO(str, targ, size, var, cond) { \
char * _p = targ; \
- var = str.peek(); \
+ var = static_cast<char>(str.peek()); \
while (str.good() && ! str.eof() && var != '\n' && \
(cond) && _p - targ < size) { \
str.get(var); \
@@ -574,14 +574,14 @@ inline char peek_next_nonws(std::istream& in) {
break; \
} \
*_p++ = var; \
- var = str.peek(); \
+ var = static_cast<char>(str.peek()); \
} \
*_p = '\0'; \
}
#define READ_INTO_(str, targ, size, var, idx, cond) { \
char * _p = targ; \
- var = str.peek(); \
+ var = static_cast<char>(str.peek()); \
while (str.good() && ! str.eof() && var != '\n' && \
(cond) && _p - targ < size) { \
str.get(var); \
@@ -595,7 +595,7 @@ inline char peek_next_nonws(std::istream& in) {
idx++; \
} \
*_p++ = var; \
- var = str.peek(); \
+ var = static_cast<char>(str.peek()); \
} \
*_p = '\0'; \
}