Closed
Bug 666984
Opened 15 years ago
Closed 15 years ago
Remove/substitute NS_FloatIsFinite since it's the same as NS_finite
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla8
People
(Reporter: Ms2ger, Assigned: emorley)
Details
Attachments
(1 file, 3 obsolete files)
|
29.90 KB,
patch
|
emorley
:
review+
|
Details | Diff | Splinter Review |
One of these is more than enough... CC'ing somebody who might be interested :)
| Assignee | ||
Updated•15 years ago
|
Assignee: nobody → bmo
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•15 years ago
|
||
http://mxr.mozilla.org/mozilla-central/search?string=NS_FloatIsFinite
http://mxr.mozilla.org/mozilla-central/search?string=NS_finite
First pass at this, let me know if this wasn't the intended approach.
Compiles fine locally, with no warnings on the changed lines (the rest of /content/svg/ is another matter, but don't get me started! More to do in bug 187528, but anyway).
However, slight query about how liberal I should be about #includes ? ie: I've added a few to make it compile, but should I be including nsMathUtils.h in absolutely every file I've added NS_finite into, to prevent it only being included by chance via another file?
Likewise, in the files where I've s/NS_FloatIsFinite/NS_finite/g, I've removed the existing #include "nsContentUtils.h", on the premise that NS_FloatIsFinite is no longer being used. However it's plausible that nsContentUtils.h is being used for other stuff and it only compiles by chance inclusion elsewhere.
Basically I don't want to make the bug 557565 / bug 634839 type situation any worse - and don't know what the recommendations are here?
Attachment #544512 -
Flags: feedback?(Ms2ger)
| Reporter | ||
Comment 2•15 years ago
|
||
The "no bootlegging" principle would suggest including nsMathUtils.h everywhere. For nsContentUtils.h, I'd remove it (unless the file uses an nsContentUtils::* function, of course).
| Reporter | ||
Comment 3•15 years ago
|
||
Comment on attachment 544512 [details] [diff] [review]
Patch v1
>--- a/content/svg/content/src/SVGLength.h
>+++ b/content/svg/content/src/SVGLength.h
>-#include "nsContentUtils.h"
>--- a/content/svg/content/src/SVGPoint.h
>+++ b/content/svg/content/src/SVGPoint.h
>-#include "nsContentUtils.h"
Excellent.
>--- a/xpcom/ds/nsMathUtils.h
>+++ b/xpcom/ds/nsMathUtils.h
>+/*
/**, please.
>+ * Check whether a floating point number is finite (not +/-infinity and not a
>+ * NaN value).
>+ */
> inline NS_HIDDEN_(bool) NS_finite(double d)
> {
> #ifdef WIN32
> // NOTE: '!!' casts an int to bool without spamming MSVC warning C4800.
> return !!_finite(d);
> #else
> return finite(d);
> #endif
Looks great!
Attachment #544512 -
Flags: feedback?(Ms2ger) → feedback+
| Assignee | ||
Comment 4•15 years ago
|
||
Thanks Ms2ger :-)
Same as prior patch, other than nsMathUtils.h being included everywhere to avoid bootlegging + the nit for the nsMathUtils.h comment style.
Attachment #544512 -
Attachment is obsolete: true
Attachment #544578 -
Flags: review?(jwatt)
| Assignee | ||
Updated•15 years ago
|
Summary: s/NS_FloatIsFinite/NS_finite/g → Remove/substitute NS_FloatIsFinite since it's the same as NS_finite
| Assignee | ||
Comment 5•15 years ago
|
||
| Assignee | ||
Updated•15 years ago
|
Flags: in-testsuite-
| Assignee | ||
Comment 6•15 years ago
|
||
Ping for review. Thanks :-)
| Assignee | ||
Updated•15 years ago
|
Attachment #544578 -
Flags: review?(Olli.Pettay)
Comment 7•15 years ago
|
||
Comment on attachment 544578 [details] [diff] [review]
Patch v2
Sorry, totally forgot about this. r=jwatt although it would be nice if you could tidy up the trailing "\" chars on the lines in nsContentUtils.h.
Attachment #544578 -
Flags: review?(jwatt)
Attachment #544578 -
Flags: review?(Olli.Pettay)
Attachment #544578 -
Flags: review+
| Assignee | ||
Comment 8•15 years ago
|
||
Updated to tip, tidied nsContentUtils.h trailing "\" chars; carrying forwards r+.
Thanks Jonathan :-)
Attachment #544578 -
Attachment is obsolete: true
Attachment #549823 -
Flags: review+
| Assignee | ||
Comment 9•15 years ago
|
||
Added missing #include "nsMathUtils.h" in nsSVGIntegerPair.cpp after updating to tip. Carrying forwards r+.
Attachment #549823 -
Attachment is obsolete: true
Attachment #549830 -
Flags: review+
| Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Comment 10•15 years ago
|
||
Keywords: checkin-needed
Comment 11•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•