lib: fix compiler warnings

svn path=/trunk/boinc/; revision=22013
This commit is contained in:
Charlie Fenton 2010-07-20 10:10:25 +00:00
parent 0c948a656a
commit ecddbe3cad
2 changed files with 13 additions and 7 deletions

View File

@ -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

View File

@ -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 <tag/>, 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 <tag/>, 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];