Last Comment Bug 409849 - 1.8 branch build for ppc with gcc 4.0 fails: .../nsCanvasRenderingContext2D.cpp: 1026: error: invalid conversion from 'int' to 'CGImageAlphaInfo'
: 1.8 branch build for ppc with gcc 4.0 fails: .../nsCanvasRenderingContext2D.c...
Status: VERIFIED FIXED
: verified1.8.1.12
Product: Core
Classification: Components
Component: Canvas: 2D (show other bugs)
: 1.8 Branch
: PowerPC Mac OS X
: -- normal (vote)
: mozilla1.8.1
Assigned To: Mark Mentovai
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-26 07:57 PST by Mark Mentovai
Modified: 2008-01-30 15:22 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Cast to CGImageAlphaInfo (1.50 KB, patch)
2007-12-26 07:58 PST, Mark Mentovai
vladimir: review+
samuel.sidler+old: approval1.8.1.12+
Details | Diff | Splinter Review

Description Mark Mentovai 2007-12-26 07:57:20 PST
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.
Comment 1 Mark Mentovai 2007-12-26 07:58:39 PST
Created attachment 294568 [details] [diff] [review]
Cast to CGImageAlphaInfo
Comment 2 Smokey Ardisson (offline for a while; not following bugs - do not email) 2007-12-26 09:32:41 PST
Gah, I hate moving.
Comment 3 Blake Kaplan (:mrbkap) 2007-12-26 10:45:58 PST
Comment on attachment 294568 [details] [diff] [review]
Cast to CGImageAlphaInfo

I think vlad should review this -- this isn't my code.
Comment 4 Mark Mentovai 2007-12-26 11:51:43 PST
Smokey, I've got something to alleviate the stripping pains.
Comment 5 Mark Mentovai 2008-01-04 18:53:08 PST
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.
Comment 6 Samuel Sidler (old account; do not CC) 2008-01-10 16:13:53 PST
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.
Comment 7 Mark Mentovai 2008-01-11 08:57:56 PST
Checked in on the MOZILLA_1_8_BRANCH.
Comment 8 Al Billings [:abillings] 2008-01-30 15:22:26 PST
Verified in source using LXR.

Note You need to log in before you can comment on or make changes to this bug.