diff options
author | John Wiegley <johnw@newartisans.com> | 2009-03-08 01:25:52 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-03-08 02:07:49 -0400 |
commit | c99ab20853b1315d59938c7e16a420bc09407299 (patch) | |
tree | 239ac7868919f7a4a40edd5c9bc563cd1749d42b | |
parent | 6f95dfa6bec4f468dc5345976309fb965a650524 (diff) | |
download | fork-ledger-c99ab20853b1315d59938c7e16a420bc09407299.tar.gz fork-ledger-c99ab20853b1315d59938c7e16a420bc09407299.tar.bz2 fork-ledger-c99ab20853b1315d59938c7e16a420bc09407299.zip |
Fixed a few minor cases of uninitialized variables
-rw-r--r-- | src/generate.cc | 2 | ||||
-rw-r--r-- | src/main.cc | 2 | ||||
-rw-r--r-- | src/predicate.cc | 5 | ||||
-rw-r--r-- | src/pyinterp.cc | 4 |
4 files changed, 7 insertions, 6 deletions
diff --git a/src/generate.cc b/src/generate.cc index 6d1bfb1a..958fc5dd 100644 --- a/src/generate.cc +++ b/src/generate.cc @@ -79,7 +79,7 @@ void generate_posts_iterator::generate_string(std::ostream& out, int len, DEBUG("generate.post.string", "Generating string of length " << len << ", only alpha " << only_alpha); - int last; + int last = -1; bool first = true; for (int i = 0; i < len; i++) { int next = only_alpha ? 3 : three_gen(); diff --git a/src/main.cc b/src/main.cc index 0933abcf..c203a2de 100644 --- a/src/main.cc +++ b/src/main.cc @@ -58,7 +58,7 @@ namespace ledger { int main(int argc, char * argv[], char * envp[]) { - int status; + int status = 1; #ifdef HAVE_BOOST_PYTHON argv0 = argv[0]; diff --git a/src/predicate.cc b/src/predicate.cc index 2ff897e5..49249482 100644 --- a/src/predicate.cc +++ b/src/predicate.cc @@ -37,8 +37,9 @@ string args_to_predicate_expr(value_t::sequence_t::const_iterator& begin, value_t::sequence_t::const_iterator end) { std::ostringstream expr; - bool append_or = false; - bool only_parenthesis; + + bool append_or = false; + bool only_parenthesis = false; while (begin != end) { string arg = (*begin).as_string(); diff --git a/src/pyinterp.cc b/src/pyinterp.cc index fdc22af9..56f9b6af 100644 --- a/src/pyinterp.cc +++ b/src/pyinterp.cc @@ -207,7 +207,7 @@ object python_interpreter_t::eval(std::istream& in, py_eval_mode_t mode) initialize(); try { - int input_mode; + int input_mode = -1; switch (mode) { case PY_EVAL_EXPR: input_mode = Py_eval_input; break; case PY_EVAL_STMT: input_mode = Py_single_input; break; @@ -229,7 +229,7 @@ object python_interpreter_t::eval(const string& str, py_eval_mode_t mode) initialize(); try { - int input_mode; + int input_mode = -1; switch (mode) { case PY_EVAL_EXPR: input_mode = Py_eval_input; break; case PY_EVAL_STMT: input_mode = Py_single_input; break; |