[Yaffs] gimple lint shows errors in yaffs_guts.c

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Cal Page
Date:  
To: yaffs@lists.aleph1.co.uk
Subject: [Yaffs] gimple lint shows errors in yaffs_guts.c
lint showed error 650 (see their web site). basically, you are comparing
a signed with 0x8...

The fix is to cast the int to unsigned int.

Here are the snippits of code from yaffs_guts.c

Cal Page

***        if(ok && cp.objectId == ~0)
            done = 1;
        else if(ok){
            T(YAFFS_TRACE_CHECKPOINT,(TSTR("Read object %d parent %d 
type %d" TENDSTR),


---

            /* Determine the highest sequence number */
            if (dev->isYaffs2 &&
                sequenceNumber >= YAFFS_LOWEST_SEQUENCE_NUMBER &&
 ***               sequenceNumber < YAFFS_HIGHEST_SEQUENCE_NUMBER) {


                blockIndex[nBlocksToScan].seq = sequenceNumber;
                blockIndex[nBlocksToScan].block = blk;


        } else if (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING) {


---

            /* Determine the highest sequence number */
            if (dev->isYaffs2 &&
                sequenceNumber >= YAFFS_LOWEST_SEQUENCE_NUMBER &&
***                sequenceNumber < YAFFS_HIGHEST_SEQUENCE_NUMBER) {


                blockIndex[nBlocksToScan].seq = sequenceNumber;
                blockIndex[nBlocksToScan].block = blk;