Last Comment Bug 769080 - Fix Azure build errors about Uint8ClampedArray on Android
: Fix Azure build errors about Uint8ClampedArray on Android
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: ARM Android
: -- normal (vote)
: mozilla16
Assigned To: Chris Peterson [:cpeterson]
:
Mentors:
: 769953 (view as bug list)
Depends on:
Blocks: 762654
  Show dependency treegraph
 
Reported: 2012-06-27 15:43 PDT by Chris Peterson [:cpeterson]
Modified: 2012-07-02 01:53 PDT (History)
5 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed


Attachments
fix-android-azure-build.patch (2.14 KB, patch)
2012-06-27 15:44 PDT, Chris Peterson [:cpeterson]
no flags Details | Diff | Splinter Review
fix-android-build-v2.patch (2.42 KB, patch)
2012-06-29 15:35 PDT, Chris Peterson [:cpeterson]
Ms2ger: review+
Details | Diff | Splinter Review

Description Chris Peterson [:cpeterson] 2012-06-27 15:43:34 PDT
* nsCanvasRenderingContext2DAzure.cpp needs to #include <mozilla/dom/TypedArray.h>

mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp: In member function 'void nsCanvasRenderingContext2DAzure::PutImageData(JSContext*, mozilla::dom::ImageData*, double, double, mozilla::ErrorResult&)':
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp:4335: error: 'Uint8ClampedArray' is not a member of 'mozilla::dom'
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp:4335: error: expected ';' before 'arr'
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp:4339: error: 'arr' was not declared in this scope
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp: In member function 'void nsCanvasRenderingContext2DAzure::PutImageData(JSContext*, mozilla::dom::ImageData*, double, double, double, double, double, double, mozilla::ErrorResult&)':
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp:4355: error: 'Uint8ClampedArray' is not a member of 'mozilla::dom'
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp:4355: error: expected ';' before 'arr'
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp:4359: error: 'arr' was not declared in this scope
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp: In function 'already_AddRefed<mozilla::dom::ImageData> CreateImageData(JSContext*, nsCanvasRenderingContext2DAzure*, uint32_t, uint32_t, mozilla::ErrorResult&)':
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp:4531: error: 'Uint8ClampedArray' has not been declared


* Fix some warnings about uninitialized variables in some switch code paths:

mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp: In function 'JS::Value WrapStyle(JSContext*, JSObject*, nsIDOMCanvasRenderingContext2D::CanvasMultiGetterType, nsAString_internal&, nsISupports*, mozilla::ErrorResult&)':
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp:1557: warning: 'ok' may be used uninitialized in this function

mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp: In member function 'nsresult nsCanvasRenderingContext2DAzure::DrawOrMeasureText(const nsAString_internal&, float, float, const mozilla::dom::Optional<double>&, nsCanvasRenderingContext2DAzure::TextDrawOperation, float*)':
mozilla/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp:3303: warning: 'anchorY' may be used uninitialized in this function
Comment 1 Chris Peterson [:cpeterson] 2012-06-27 15:44:55 PDT
Created attachment 637290 [details] [diff] [review]
fix-android-azure-build.patch

Fix Azure build errors about Uint8ClampedArray on Android. Fix some uninitialized variable warnings.
Comment 2 :Ms2ger 2012-06-28 05:39:36 PDT
Can those default cases be reached? If not, they should get a MOZ_NOT_REACHED.
Comment 3 Chris Peterson [:cpeterson] 2012-06-28 11:01:12 PDT
(In reply to :Ms2ger from comment #2)
> Can those default cases be reached? If not, they should get a
> MOZ_NOT_REACHED.

Ms2ger, good question. I double-checked and these default cases should not be reachable. The two switch statements have case labels for every enum value of TextBaseline and CanvasMultiGetterType, respectively.

I post a new patch, though the breaking Azure code has been backed out of mozilla-inbound.
Comment 4 Chris Peterson [:cpeterson] 2012-06-29 15:35:38 PDT
Created attachment 638033 [details] [diff] [review]
fix-android-build-v2.patch

Patch v2:

1. Fix Android build error by #including <mozilla/dom/TypedArray.h>.

2. Fix (false positive) uninitialized variable warnings by adding MOZ_NOT_REACHED() to default switch cases.
Comment 5 Chris Peterson [:cpeterson] 2012-06-29 21:08:11 PDT
For some reason, this file builds successfully on the Android tinderbox, but not locally on my Mac. The Android tinderbox builds run on Linux, so maybe there is something different about my local dev configuration?
Comment 6 :Ms2ger 2012-07-01 02:00:49 PDT
Comment on attachment 638033 [details] [diff] [review]
fix-android-build-v2.patch

Review of attachment 638033 [details] [diff] [review]:
-----------------------------------------------------------------

Land it.
Comment 7 :Ms2ger 2012-07-01 02:01:02 PDT
*** Bug 769953 has been marked as a duplicate of this bug. ***
Comment 8 Ryan VanderMeulen [:RyanVM] 2012-07-01 06:17:50 PDT
https://hg.mozilla.org/mozilla-central/rev/a86ce9b348b8

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