From f994b88a4629e4295788f2c381f1c9064d9cf848 Mon Sep 17 00:00:00 2001 From: thurston Date: Mon, 12 Mar 2007 23:57:56 +0000 Subject: [PATCH] Silence warnings about definite and/or possible use before initialization. git-svn-id: http://svn.complang.org/ragel/trunk@141 052ea7fc-9027-0410-9066-f65837a77df0 --- ragel/parsedata.cpp | 1 + ragel/rlparse.kl | 4 ++-- ragel/rlscan.rl | 2 +- redfsm/xmlscan.rl | 10 +++++----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ragel/parsedata.cpp b/ragel/parsedata.cpp index dd44218..b4e4bb1 100644 --- a/ragel/parsedata.cpp +++ b/ragel/parsedata.cpp @@ -944,6 +944,7 @@ Action *ParseData::newAction( char *name, InlineList *inlineList ) InputLoc loc; loc.line = 1; loc.col = 1; + loc.fileName = ""; Action *action = new Action( loc, name, inlineList, nextCondId++ ); action->actionRefs.append( rootName ); diff --git a/ragel/rlparse.kl b/ragel/rlparse.kl index 3257286..95fb782 100644 --- a/ragel/rlparse.kl +++ b/ragel/rlparse.kl @@ -748,7 +748,7 @@ priority_aug: // Convert the priority number to a long. Check for overflow. errno = 0; //cerr << "PRIOR AUG: " << $1->token.data << endl; - int aug = strtol( $1->token.data, 0, 10 ); + long aug = strtol( $1->token.data, 0, 10 ); if ( errno == ERANGE && aug == LONG_MAX ) { /* Priority number too large. Recover by setting the priority to 0. */ error($1->token.loc) << "priority number " << $1->token.data << @@ -866,7 +866,7 @@ factor_rep_num: TK_UInt final { // Convert the priority number to a long. Check for overflow. errno = 0; - int rep = strtol( $1->data, 0, 10 ); + long rep = strtol( $1->data, 0, 10 ); if ( errno == ERANGE && rep == LONG_MAX ) { // Repetition too large. Recover by returing repetition 1. */ error($1->loc) << "repetition number " << $1->data << " overflows" << endl; diff --git a/ragel/rlscan.rl b/ragel/rlscan.rl index fd68aae..ece2a74 100644 --- a/ragel/rlscan.rl +++ b/ragel/rlscan.rl @@ -842,7 +842,7 @@ void Scanner::do_scan() int curly_count = 0; bool execute = true; bool singleLineSpec = false; - InlineBlockType inlineBlockType; + InlineBlockType inlineBlockType = CurlyDelimited; %% write init; diff --git a/redfsm/xmlscan.rl b/redfsm/xmlscan.rl index 13798ca..f52cd6c 100644 --- a/redfsm/xmlscan.rl +++ b/redfsm/xmlscan.rl @@ -180,11 +180,11 @@ void Scanner::adjustAttrPointers( int distance ) int Scanner::scan( ) { int token = TK_NO_TOKEN; - int space, readlen; - char *attr_id_start; - char *attr_value_start; - int attr_id_len; - int attr_value_len; + int space = 0, readlen = 0; + char *attr_id_start = 0; + char *attr_value_start = 0; + int attr_id_len = 0; + int attr_value_len = 0; attrMkList.empty(); buffer.clear(); -- 2.7.4