Silence warnings about definite and/or possible use before initialization.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Mon, 12 Mar 2007 23:57:56 +0000 (23:57 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Mon, 12 Mar 2007 23:57:56 +0000 (23:57 +0000)
git-svn-id: http://svn.complang.org/ragel/trunk@141 052ea7fc-9027-0410-9066-f65837a77df0

ragel/parsedata.cpp
ragel/rlparse.kl
ragel/rlscan.rl
redfsm/xmlscan.rl

index dd44218..b4e4bb1 100644 (file)
@@ -944,6 +944,7 @@ Action *ParseData::newAction( char *name, InlineList *inlineList )
        InputLoc loc;
        loc.line = 1;
        loc.col = 1;
+       loc.fileName = "<NONE>";
 
        Action *action = new Action( loc, name, inlineList, nextCondId++ );
        action->actionRefs.append( rootName );
index 3257286..95fb782 100644 (file)
@@ -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;
index fd68aae..ece2a74 100644 (file)
@@ -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;
 
index 13798ca..f52cd6c 100644 (file)
@@ -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();