The default bug view has changed. See this FAQ.

C++0x narrowing conversion inside {} compilation error in nsDocumentViewer.cpp

RESOLVED FIXED in mozilla6

Status

()

Core
Layout
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

Trunk
mozilla6
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

6 years ago
Created attachment 527783 [details] [diff] [review]
Patch

This is similar to bug 502301.

The failure looks like the following:
../../../layout/base/nsDocumentViewer.cpp: In member function 'virtual nsresult DocumentViewerImpl::SetMinFontSize(PRInt32)':
../../../layout/base/nsDocumentViewer.cpp:2870:45: error: narrowing conversion of 'aMinFontSize' from 'PRInt32' to 'float' inside { }

See https://bugzilla.mozilla.org/show_bug.cgi?id=502301#c4 as to why this is invalid C++0x.
Attachment #527783 - Flags: review?
(Assignee)

Updated

6 years ago
Attachment #527783 - Flags: review? → review?(dbaron)
Comment on attachment 527783 [details] [diff] [review]
Patch

Oops, this shouldn't be using ZoomInfo at all.  Instead it should have its own struct that has a PRInt32 member.
Attachment #527783 - Flags: review?(dbaron) → review-
(Assignee)

Comment 2

6 years ago
Note this also affects aurora.
(Assignee)

Comment 3

6 years ago
Created attachment 527804 [details] [diff] [review]
Patch

This should work, and is how e.g. SetChildHintCharacterSetSource does it.
Attachment #527783 - Attachment is obsolete: true
Attachment #527804 - Flags: review?(dbaron)
Comment on attachment 527804 [details] [diff] [review]
Patch

Use NS_INT32_TO_PTR() at the incoming end instead of just a void* cast, and r=dbaron.
Attachment #527804 - Flags: review?(dbaron) → review+
(Assignee)

Comment 5

6 years ago
Two questions:
- do you want other similar void* casts changed at the same time? (there's SetChildHintCharacterSetSource and SetChildBidiOptions)
- do you want this fix on aurora ?
(Assignee)

Comment 6

6 years ago
Arg, I missed the mDocument->EnumerateExternalResources(SetExtResourceMinFontSize, &ZoomInfo); a few lines later.
(Assignee)

Comment 7

6 years ago
Created attachment 527810 [details] [diff] [review]
Patch v3

Changing other similar void* casts, and fixing EnumerateExternalResources call.
Assignee: nobody → mh+mozilla
Attachment #527804 - Attachment is obsolete: true
Attachment #527810 - Flags: review?(dbaron)
Comment on attachment 527810 [details] [diff] [review]
Patch v3

r=dbaron
Attachment #527810 - Flags: review?(dbaron) → review+
(Do you have a good reason this ought to be fixed on Aurora?)
(Assignee)

Comment 10

6 years ago
(In reply to comment #9)
> (Do you have a good reason this ought to be fixed on Aurora?)

None particularly, I can apply the patch locally. I merely asked if you had a wish to fix this on aurora.
(Assignee)

Comment 11

6 years ago
http://hg.mozilla.org/mozilla-central/rev/503696b78379
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
You need to log in before you can comment on or make changes to this bug.