You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Craig Noah <Cr...@sterling.com> on 2000/03/07 16:47:31 UTC

bug swatting: -1 assigned to array of unsigned int

Can someone explain the following code to me? It comes from
DFAContentModel.cpp, lines 744 through 755.  Specifically, why is -1
being assigned to an array of unsigned ints?

Here is the code:
//
//  -1 is used to represent bad transitions in the transition table
entry for
//  each state. So each entry is initialized to an all -1 array. This
method
//  creates a new entry and initializes it.
//
unsigned int* DFAContentModel::makeDefStateList() const
{
    unsigned int* retArray = new unsigned int[fElemMapSize];
    for (unsigned int index = 0; index < fElemMapSize; index++)
        retArray[index] = -1;
    return retArray;
}

-- 
Craig Noah	            INTERNET: Craig.Noah@sterling.com
Software Engineer

                Sterling Software ITD 
1404 Fort Crook Road South     Phone:    (402) 291-8300 x 284
Bellevue,  NE   68005-2969     FAX:      (402) 291-4362