Open Bug 388409 Opened 18 years ago Updated 2 years ago

Skipped / original type error

Categories

(Core :: Graphics: Text, defect)

defect

Tracking

()

People

(Reporter: aaronlev, Unassigned)

Details

My understanding is that original offsets should be PRInt32 and skipped offsets should be PRUInt32, but that means these 2 methods should not be the same: In gfxSkipChars.h 277 PRUint32 ConvertOriginalToSkipped(PRInt32 aOriginalStringOffset) { 278 SetOriginalOffset(aOriginalStringOffset); 279 return GetSkippedOffset(); 280 } 281 PRUint32 ConvertSkippedToOriginal(PRInt32 aSkippedStringOffset) { 282 SetSkippedOffset(aSkippedStringOffset); 283 return GetOriginalOffset(); 284 } I think the second one should change both the return value and param types: PRInt32 ConvertSkippedToOriginal(PRUint32 aSkippedStringOffset) { This system is not really working in any case. There will likely be future hard-to-find errors where developers confuse which type of offset they should be using with which method. The PRUint32/PRInt32 is not catching any errors for us. Right now I'm working on bug 348901 where we had such an offset usage error that would cause bugs, but only a careful read of the code finds it.
Roc, do you agree with the reporter or is this WONTFIX?
I agree with the reporter. ConvertSkippedToOriginal should take a PRUInt32 and return PRInt32.
Severity: normal → S3
Component: Graphics → Graphics: Text
You need to log in before you can comment on or make changes to this bug.