Closed Bug 742581 Opened 9 years ago Closed 9 years ago

nsStyleCoord::GetCoordValue() signature is inconsistent (nscoord vs PRInt32)

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(1 file)

I just noticed that the method-signature for nsStyleCoord::GetCoordValue doesn't match, between the function declaration & the function definition.  (nscoord vs PRInt32)

Relevant code:
> 90  class nsStyleCoord {
[...]
> 162   nscoord     GetCoordValue() const;
[...]
> 185 };
[...]
> 290 inline PRInt32 nsStyleCoord::GetCoordValue() const
> 291 {
> 292   NS_ASSERTION((mUnit == eStyleUnit_Coord), "not a coord value");
> 293   if (mUnit == eStyleUnit_Coord) {
> 294     return mValue.mInt;
> 295   }
> 296   return 0;
> 297 }

Of course, nscoord and PRInt32 end up evaluating to the same type, but we should make that consistent.
This actually dates back to the original version of this file in CVS, from 1998, it looks like:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/style/nsStyleCoord.h&rev=3.1
Attached patch fixSplinter Review
This changes the definition to use "nscoord" (to match the function declaration).

This also makes it symmetric with SetCoordValue, which takes an nscoord-typed argument.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #613017 - Flags: review?(dbaron)
OS: Linux → All
Hardware: x86_64 → All
Comment on attachment 613017 [details] [diff] [review]
fix

r=dbaron
Attachment #613017 - Flags: review?(dbaron) → review+
https://hg.mozilla.org/mozilla-central/rev/be20d1f8c8a3
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.