After calling DmInsertionSort, the flowing function
would always fall into second if statement if (diff > 0)
while diff is clearly set to -1. Can someone guess what's going on?





static Int CompareRecord(void *rec1, void *rec2, Int other,
                                                 SortRecordInfoPtr info1, 
SortRecordInfoPtr info2, VoidHand appInfo)
{
    PackedSlipRecord *r1 = (PackedSlipRecord *)rec1;
    PackedSlipRecord *r2 = (PackedSlipRecord *)rec2;
    
    Int diff = -1;
    
    if (diff == 0)
    {
         return 0;
    }
    if (diff > 0)
    {
       return 1;
    }
    if (diff < 0)
    {
         return -1;
    }        
    return diff;
}

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to