Closed Bug 791777 Opened 13 years ago Closed 11 years ago

Remove NS_finite() and use mozilla::IsFinite

Categories

(Core :: XPCOM, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: nenolod, Assigned: anujagarwal464, Mentored)

Details

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20100101 Firefox/15.0.1 Build ID: 20120905151427 Steps to reproduce: ::isfinite() / std::isfinite() is supported across all platforms other than windows as it is a component of both C99 and POSIX 2008.
Nathan suggested: "I think a more reasonable thing to do would be to remove NS_finite completely and use mozilla::IsFinite from mfbt/FloatingPoint.h." Anuj expressed some interest in this. Let me know if you need some help figuring this out, I'll try taking a look at the relevant code in the next day or two.
Assignee: nobody → anujagarwal464
Mentor: continuation
Summary: [patch] please use POSIX-mandated isfinite() in xpcom's NS_finite() on all platforms other than windows → Remove NS_finite() and use mozilla::IsFinite
Attached patch bug791777-part1.diff (obsolete) — Splinter Review
Attachment #8496029 - Flags: feedback?(nfroyd)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 8496029 [details] [diff] [review] bug791777-part1.diff Review of attachment 8496029 [details] [diff] [review]: ----------------------------------------------------------------- This looks like a good start. I'm assuming you're planning on replacing the other instances, too?
Attachment #8496029 - Flags: feedback?(nfroyd) → feedback+
I suggested he start with one file and get feedback on it to make sure he was on the right track before writing the full patch. :)
Attached patch bug791777.diff (obsolete) — Splinter Review
Attachment #8496029 - Attachment is obsolete: true
Attachment #8496177 - Flags: review?(nfroyd)
Comment on attachment 8496177 [details] [diff] [review] bug791777.diff Review of attachment 8496177 [details] [diff] [review]: ----------------------------------------------------------------- r=me with the changes below. ::: content/base/public/nsContentUtils.h @@ +2356,5 @@ > * series of additions will not be finite if any one of the operands in the > * series is not finite. > */ > #define NS_ENSURE_FINITE(f, rv) \ > + if (!IsFinite(f)) { \ These NS_ENSURE_FINITE* macros should use the mozilla:: prefix on IsFinite to avoid namespace conflicts. Also, please indent the trailing slashes on the lines you change to line up with the rest of the trailing slashes in the macro.
Attachment #8496177 - Flags: review?(nfroyd) → review+
Attachment #8496177 - Attachment is obsolete: true
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: