The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla14

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
mozilla14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
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.
(Assignee)

Comment 1

5 years ago
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
(Assignee)

Comment 2

5 years ago
Created attachment 613017 [details] [diff] [review]
fix

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)
(Assignee)

Updated

5 years ago
OS: Linux → All
Hardware: x86_64 → All
Comment on attachment 613017 [details] [diff] [review]
fix

r=dbaron
Attachment #613017 - Flags: review?(dbaron) → review+
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/be20d1f8c8a3
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/be20d1f8c8a3
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.