Closed Bug 409849 Opened 14 years ago Closed 14 years ago

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


(Core :: Canvas: 2D, defect)

1.8 Branch
Not set





(Reporter: mark, Assigned: mark)


(Keywords: verified1.8.1.12)


(1 file)

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:,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:,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.
Attachment #294568 - Flags: review?(mrbkap)
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)
Smokey, I've got something to alleviate the stripping pains.
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; 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+
Checked in on the MOZILLA_1_8_BRANCH.
Closed: 14 years ago
Keywords: fixed1.8.1.12
Resolution: --- → FIXED
Verified in source using LXR.
You need to log in before you can comment on or make changes to this bug.