[Yaffs] gimple lint shows errors in yaffs_guts.c

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Cal Page
日付:  
To: yaffs@lists.aleph1.co.uk
題目: [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;