Closed Bug 769080 Opened 12 years ago Closed 12 years ago

Fix Azure build errors about Uint8ClampedArray on Android

Categories

(Core :: DOM: Core & HTML, defect)

ARM
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16
Tracking Status
firefox16 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file, 1 obsolete file)

* 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
Attached patch fix-android-azure-build.patch (obsolete) — Splinter Review
Fix Azure build errors about Uint8ClampedArray on Android. Fix some uninitialized variable warnings.
Attachment #637290 - Flags: review?(peterv)
Blocks: 762654
Status: NEW → ASSIGNED
Can those default cases be reached? If not, they should get a MOZ_NOT_REACHED.
(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.
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.
Attachment #637290 - Attachment is obsolete: true
Attachment #637290 - Flags: review?(peterv)
Attachment #638033 - Flags: review?(peterv)
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 on attachment 638033 [details] [diff] [review]
fix-android-build-v2.patch

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

Land it.
Attachment #638033 - Flags: review?(peterv) → review+
https://hg.mozilla.org/mozilla-central/rev/a86ce9b348b8
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: