Build break in nsCanvasRenderingContext2D.cpp

RESOLVED FIXED

Status

()

Core
Canvas: 2D
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Peter Weilbacher, Assigned: Peter Weilbacher)

Tracking

Trunk
x86
OS/2
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

9 years ago
Bug 495499 created a build break for us on OS/2. Both GCC 4.3.3 and 4.0.0 give this error:

<path>/nsCanvasRenderingContext2D.cpp: In member
function 'virtual nsresult nsCanvasRenderingContext2D::PutImageData()':
<path>/nsCanvasRenderingContext2D.cpp:3655: error: call of overloaded
                                            'ToUint8(jsint)' is ambiguous
<path>/nsCanvasRenderingContext2D.cpp:3532: note: candidates are:
                                                 PRUint8 ToUint8(PRInt32)
<path>/nsCanvasRenderingContext2D.cpp:3539: note: PRUint8 ToUint8(double)
<path>/nsCanvasRenderingContext2D.cpp:3659: error: call of overloaded
                                            'ToUint8(jsint)' is ambiguous
<path>/nsCanvasRenderingContext2D.cpp:3532: note: candidates are:
                                                 PRUint8 ToUint8(PRInt32)
<path>/nsCanvasRenderingContext2D.cpp:3539: note: PRUint8 ToUint8(double)
<path>/nsCanvasRenderingContext2D.cpp:3663: error: call of overloaded
                                            'ToUint8(jsint)' is ambiguous
<path>/nsCanvasRenderingContext2D.cpp:3532: note: candidates are:
                                                 PRUint8 ToUint8(PRInt32)
<path>/nsCanvasRenderingContext2D.cpp:3539: note: PRUint8 ToUint8(double)
<path>/nsCanvasRenderingContext2D.cpp:3667: error: call of overloaded
                                            'ToUint8(jsint)' is ambiguous
<path>/nsCanvasRenderingContext2D.cpp:3532: note: candidates are:
                                                 PRUint8 ToUint8(PRInt32)
<path>/nsCanvasRenderingContext2D.cpp:3539: note: PRUint8 ToUint8(double)

We have put up with this for two months now without being able to trace the problem in our GCC versions. We have no clue why other compilers work and our doesn't, but I think it's time to fix it in the Mozilla code.
(Assignee)

Comment 1

9 years ago
Created attachment 393345 [details] [diff] [review]
workaround

This is the patch that Rich created and it works, although it's ugly.

Boris, as this is your code, maybe you have a better idea?
Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Attachment #393345 - Flags: review?(bzbarsky)
What type is jsint on your platform, exactly?
And more to the point, should ToUint8 just be changed to take jsint?
(Assignee)

Comment 4

9 years ago
Created attachment 393419 [details] [diff] [review]
change ToUint8()

jsint is int32 (http://hg.mozilla.org/mozilla-central/annotate/1059e3342790/js/src/jspubtd.h#l52) which for some reason resolves to long (http://hg.mozilla.org/mozilla-central/annotate/1059e3342790/nsprpub/pr/include/obsolete/protypes.h#l148).

But yes, changing the function like this works nicely, thanks for the hint.
Attachment #393419 - Flags: review?(bzbarsky)
Comment on attachment 393419 [details] [diff] [review]
change ToUint8()

r=bzbarsky.  Do you need this checked in?
Attachment #393419 - Flags: review?(bzbarsky) → review+
(Assignee)

Updated

9 years ago
Attachment #393345 - Attachment is obsolete: true
Attachment #393345 - Flags: review?(bzbarsky)
(Assignee)

Comment 6

9 years ago
http://hg.mozilla.org/mozilla-central/rev/a2c2235ca124
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Updated

9 years ago
Duplicate of this bug: 505714

Updated

9 years ago
Depends on: 510649
You need to log in before you can comment on or make changes to this bug.