You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by James Berry <jb...@criticalpath.com> on 2000/07/19 06:01:51 UTC

Bug: semicolon hitchhiking in NodeIDMap

My compiler complains of a possibly unwanted semicolon at the end of the
first for loop. I happen to agree.

Gee, ain't compiler warnings nice?

Of course we're talking some rather big numbers before we'd hit this
bug. It'd be nice to see some intermediate primes in there, especially
above the 10K level. Those order of magnitude leaps get pretty big.

-jdb

File: NodeIDMap.cpp

static const int gPrimes[] = {997, 9973, 99991, 999983, 0 };  // To do -
add a few more.

NodeIDMap::NodeIDMap(int initialSize)
{
    for (fSizeIndex = 0; gPrimes[fSizeIndex] < initialSize;
fSizeIndex++);
    {
        if (gPrimes[fSizeIndex] == 0)
        {
            // We need a bigger size than the largest available one.
            //   Big trouble.
            fSizeIndex--;
            throw "NodeIDMap::NodeIDMap - big trouble.";
        }
    }

    fSize = gPrimes[fSizeIndex];
    fNumEntries = 0;
    fMaxEntries = (unsigned long)(float(fSize) * gMaxFill);

    fTable = new AttrImpl *[fSize];
    unsigned int i;
    for (i=0; i<fSize; i++)
        fTable[i] = 0;
};



Re: semicolon hitchhiking in NodeIDMap

Posted by Joe Polastre <jp...@apache.org>.
I fixed the semicolon and checked it into CVS.

-Joe Polastre  (jpolast@apache.org)
IBM Cupertino, XML Technology Group


----- Original Message ----- 
From: "James Berry" <jb...@criticalpath.com>
To: "Xerces-c-dev" <xe...@xml.apache.org>
Sent: Tuesday, July 18, 2000 9:01 PM
Subject: Bug: semicolon hitchhiking in NodeIDMap


> My compiler complains of a possibly unwanted semicolon at the end of the
> first for loop. I happen to agree.
> 
> Gee, ain't compiler warnings nice?
> 
> Of course we're talking some rather big numbers before we'd hit this
> bug. It'd be nice to see some intermediate primes in there, especially
> above the 10K level. Those order of magnitude leaps get pretty big.
> 
> -jdb
> 
> File: NodeIDMap.cpp
> 
> static const int gPrimes[] = {997, 9973, 99991, 999983, 0 };  // To do -
> add a few more.
> 
> NodeIDMap::NodeIDMap(int initialSize)
> {
>     for (fSizeIndex = 0; gPrimes[fSizeIndex] < initialSize;
> fSizeIndex++);
>     {
>         if (gPrimes[fSizeIndex] == 0)
>         {
>             // We need a bigger size than the largest available one.
>             //   Big trouble.
>             fSizeIndex--;
>             throw "NodeIDMap::NodeIDMap - big trouble.";
>         }
>     }
> 
>     fSize = gPrimes[fSizeIndex];
>     fNumEntries = 0;
>     fMaxEntries = (unsigned long)(float(fSize) * gMaxFill);
> 
>     fTable = new AttrImpl *[fSize];
>     unsigned int i;
>     for (i=0; i<fSize; i++)
>         fTable[i] = 0;
> };
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
>