Closed Bug 119117 Opened 24 years ago Closed 24 years ago

nsDiskCacheMap.h(250) : warning C4244: 'return' : conversion from 'unsigned char', possible loss of data

Categories

(Core :: Networking: Cache, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: timeless, Assigned: gordon)

References

()

Details

you're converting from a 16bit thing to a 8bit thing, and you're using 0 as magic. 0x00010000 would result in 0. please fix.
Target Milestone: --- → mozilla0.9.9
There's no dataloss because we're just masking off the low 8 bits, but the functions should really be returning PRUint8. Here's the patch: Index: mozilla/netwerk/cache/src/nsDiskCacheMap.h =================================================================== RCS file: /cvsroot/mozilla/netwerk/cache/src/nsDiskCacheMap.h,v retrieving revision 1.7 diff -u -2 -r1.7 nsDiskCacheMap.h --- mozilla/netwerk/cache/src/nsDiskCacheMap.h 4 Jul 2001 07:06:34 -0000 1.7 +++ mozilla/netwerk/cache/src/nsDiskCacheMap.h 24 Jan 2002 01:07:29 -0000 @@ -168,5 +168,5 @@ } - PRUint16 DataFileGeneration() const + PRUint8 DataFileGeneration() const { return (mDataLocation & eFileGenerationMask); @@ -231,5 +231,5 @@ } - PRUint16 MetaFileGeneration() const + PRUint8 MetaFileGeneration() const { return (mMetaLocation & eFileGenerationMask);
sr=darin (looks good)
patch checked in. Marking FIXED.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.