The default bug view has changed. See this FAQ.

1.8 branch build for ppc with gcc 4.0 fails: .../nsCanvasRenderingContext2D.cpp: 1026: error: invalid conversion from 'int' to 'CGImageAlphaInfo'

VERIFIED FIXED in mozilla1.8.1

Status

()

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

People

(Reporter: Mark Mentovai, Assigned: Mark Mentovai)

Tracking

({verified1.8.1.12})

1.8 Branch
mozilla1.8.1
PowerPC
Mac OS X
verified1.8.1.12
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

1.50 KB, patch
vlad
: review+
Samuel Sidler (old account; do not CC)
: approval1.8.1.12+
Details | Diff | Splinter Review
(Assignee)

Description

9 years ago
Camino 1.6, based on the 1.8 branch, may change the compiler used for the ppc portion of the build from gcc 3.3 to gcc 4.0.  (It would continue to use the 10.3.9 SDK and would support 10.3.9 as a minimum on PowerPC instead of the current 10.3.0 permitted with gcc 3.3.)  

During a test build to determine feasability, while compiling mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp:

/lizard/1.8/mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp: In member function ‘virtual nsresult nsCanvasRenderingContext2D::Render(nsIRenderingContext*)’:
/lizard/1.8/mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp:1026: error: invalid conversion from ‘int’ to ‘CGImageAlphaInfo’
/lizard/1.8/mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp:1026: error:   initializing argument 7 of ‘CGImage* CGImageCreate(size_t, size_t, size_t, size_t, size_t, CGColorSpace*, CGImageAlphaInfo, CGDataProvider*, const float*, bool, CGColorRenderingIntent)’
/lizard/1.8/mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp:908: warning: unused variable ‘dest’
/lizard/1.8/mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp:909: warning: unused variable ‘dest_cr’
/lizard/1.8/mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp: At global scope:
/lizard/1.8/mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp:198: warning: ‘PRBool FloatValidate(double, double, double)’ defined but not used
make[5]: *** [nsCanvasRenderingContext2D.o] Error 1
make[5]: Leaving directory `/lizard/1.8/build/camino-ppc-static-40/content/canvas/src'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/lizard/1.8/build/camino-ppc-static-40/content/canvas'
make[3]: *** [libs] Error 2
make[3]: Leaving directory `/lizard/1.8/build/camino-ppc-static-40/content'
make[2]: *** [tier_9] Error 2
make[2]: Leaving directory `/lizard/1.8/build/camino-ppc-static-40'
make[1]: *** [alldep] Error 2
make[1]: Leaving directory `/lizard/1.8/build/camino-ppc-static-40'
make: *** [alldep] Error 2
make: Leaving directory `/lizard/1.8/mozilla'

The code causing the error:

http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp&rev=1.22.2.29&mark=155-164,1024-1026#1020

The problem is that during the ppc build as opposed to the x86 build, CG_BITMAP_BYTE_ORDER_FLAG is not of type CGImageAlphaInfo (an enum), but is instead 0:

http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/canvas/src/nsCanvasRenderingContext2D.cpp&rev=1.22.2.29&mark=155-164,1024-1026#155

gcc 3.3 is satisfied with this, but gcc 4.0 treats it as an error.  A cast should be introduced to ensure that this is buildable with gcc 4.0.  This appears the be the only change necessary to make the current 1.8 branch build for ppc with gcc 4.0, and it's completely safe as it's a simple cast that doesn't even involve a conversion.
(Assignee)

Comment 1

9 years ago
Created attachment 294568 [details] [diff] [review]
Cast to CGImageAlphaInfo
Attachment #294568 - Flags: review?(mrbkap)
(Assignee)

Updated

9 years ago
Target Milestone: --- → mozilla1.8.1
Assignee: mark → nobody
Component: GFX: Mac → Layout: Canvas
QA Contact: mac → layout.canvas
Gah, I hate moving.
Assignee: nobody → mark
Comment on attachment 294568 [details] [diff] [review]
Cast to CGImageAlphaInfo

I think vlad should review this -- this isn't my code.
Attachment #294568 - Flags: review?(mrbkap) → review?(vladimir)
(Assignee)

Comment 4

9 years ago
Smokey, I've got something to alleviate the stripping pains.
Attachment #294568 - Flags: review?(vladimir) → review+
(Assignee)

Comment 5

9 years ago
Comment on attachment 294568 [details] [diff] [review]
Cast to CGImageAlphaInfo

No risk, just a cast, fixes compiler errors in the ppc build when using gcc 4, which we're evaluating for Camino 1.6 based on this branch.
Attachment #294568 - Flags: approval1.8.1.12?
Comment on attachment 294568 [details] [diff] [review]
Cast to CGImageAlphaInfo

Approved for the 1.8.1.12; a=ss for release drivers. Please land on the branch as soon as possible.
Attachment #294568 - Flags: approval1.8.1.12? → approval1.8.1.12+
(Assignee)

Comment 7

9 years ago
Checked in on the MOZILLA_1_8_BRANCH.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Keywords: fixed1.8.1.12
Resolution: --- → FIXED
Verified in source using LXR.
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1.12 → verified1.8.1.12
You need to log in before you can comment on or make changes to this bug.