From ecddbe3cad8c726dd65522b7b5050ba2ec5e6e07 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 20 Jul 2010 10:10:25 +0000 Subject: [PATCH] lib: fix compiler warnings svn path=/trunk/boinc/; revision=22013 --- checkin_notes | 6 ++++++ lib/parse.cpp | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/checkin_notes b/checkin_notes index 4cda2fb491..6691f1d03b 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5284,3 +5284,9 @@ David 19 Jul 2010 lib/ notice.cpp parse.cpp,h + +Charlie 19 Jul 2010 + - lib: fix compiler warnings. + + lib/ + parse.cpp diff --git a/lib/parse.cpp b/lib/parse.cpp index 124edc42de..848d2ae089 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -640,7 +640,7 @@ bool XML_PARSER::get(char* buf, int len, bool& is_tag, char* attr_buf, int attr_ bool XML_PARSER::parse_str( char* parsed_tag, const char* start_tag, char* buf, int len ) { - bool is_tag, eof; + bool is_tag = false, eof; char end_tag[256], tag[256], tmp[64000]; // handle the archaic form , which means empty string @@ -701,7 +701,7 @@ bool XML_PARSER::parse_string( // bool XML_PARSER::parse_int(char* parsed_tag, const char* start_tag, int& i) { char buf[256], *end; - bool is_tag, eof; + bool is_tag = false, eof; char end_tag[256], tag[256]; if (strcmp(parsed_tag, start_tag)) return false; @@ -736,7 +736,7 @@ bool XML_PARSER::parse_int(char* parsed_tag, const char* start_tag, int& i) { // bool XML_PARSER::parse_double(char* parsed_tag, const char* start_tag, double& x) { char buf[256], *end; - bool is_tag, eof; + bool is_tag = false, eof; char end_tag[256], tag[256]; if (strcmp(parsed_tag, start_tag)) return false; @@ -769,7 +769,7 @@ bool XML_PARSER::parse_double(char* parsed_tag, const char* start_tag, double& x // bool XML_PARSER::parse_bool(char* parsed_tag, const char* start_tag, bool& b) { char buf[256], *end; - bool is_tag, eof; + bool is_tag = false, eof; char end_tag[256], tag[256]; // handle the archaic form , which means true @@ -805,7 +805,7 @@ bool XML_PARSER::parse_bool(char* parsed_tag, const char* start_tag, bool& b) { // bool XML_PARSER::parse_start(const char* start_tag) { char tag[256]; - bool eof, is_tag; + bool eof, is_tag = false; eof = get(tag, sizeof(tag), is_tag); if (eof || !is_tag ) { @@ -861,7 +861,7 @@ void XML_PARSER::skip_unexpected( const char* start_tag, bool verbose, const char* where ) { char tag[256], end_tag[256]; - bool is_tag; + bool is_tag = false; if (verbose) { fprintf(stderr, "Unrecognized XML in %s: %s\n", where, start_tag); @@ -883,7 +883,7 @@ void XML_PARSER::skip_unexpected( #if 0 void parse(FILE* f) { char tag[256]; - bool is_tag, flag; + bool is_tag = false, flag; MIOFILE mf; XML_PARSER xp(&mf); char name[256];