Hello,

Is it me, or does the declaration of difference as an unsigned int
prevent the if statements just below from working correctly?
Should it not be a normal int?

>From postgresql-7.0.2/contrib/fulltextindex/fti.c
======
bool
is_stopword(char *text)
{
        char      **StopLow;            /* for list of stop-words */
        char      **StopHigh;
        char      **StopMiddle;
        unsigned int difference;

        StopLow = &StopWords[0];        /* initialize stuff for binary search */
        StopHigh = endof(StopWords);

        if (lengthof(StopWords) == 0)
                return false;

        while (StopLow <= StopHigh)
        {
                StopMiddle = StopLow + (StopHigh - StopLow) / 2;
                difference = strcmp(*StopMiddle, text);
                if (difference == 0)
                        return (true);
                else if (difference < 0)
                        StopLow = StopMiddle + 1;
                else
                        StopHigh = StopMiddle - 1;
        }

        return (false);
}
======


-- 
Paul McGarry            mailto:[EMAIL PROTECTED] 
Systems Integrator      http://www.opentec.com.au 
Opentec Pty Ltd         http://www.iebusiness.com.au
6 Lyon Park Road        Phone: (02) 9878 1744 
North Ryde NSW 2113     Fax:   (02) 9878 1755

Reply via email to