Closed
Bug 652139
Opened 14 years ago
Closed 14 years ago
C++0x narrowing conversion inside {} compilation error in nsDocumentViewer.cpp
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla6
People
(Reporter: glandium, Assigned: glandium)
References
Details
Attachments
(1 file, 2 obsolete files)
3.84 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
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•14 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•14 years ago
|
||
Note this also affects aurora.
Assignee | ||
Comment 3•14 years ago
|
||
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•14 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•14 years ago
|
||
Arg, I missed the mDocument->EnumerateExternalResources(SetExtResourceMinFontSize, &ZoomInfo); a few lines later.
Assignee | ||
Comment 7•14 years ago
|
||
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•14 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•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
You need to log in
before you can comment on or make changes to this bug.
Description
•