The default bug view has changed. See this FAQ.

Fix Azure build errors about Uint8ClampedArray on Android

RESOLVED FIXED in Firefox 16

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

Trunk
mozilla16
ARM
Android
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(firefox16 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
* 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
(Assignee)

Comment 1

5 years ago
Created attachment 637290 [details] [diff] [review]
fix-android-azure-build.patch

Fix Azure build errors about Uint8ClampedArray on Android. Fix some uninitialized variable warnings.
Attachment #637290 - Flags: review?(peterv)
(Assignee)

Updated

5 years ago
Blocks: 762654
Status: NEW → ASSIGNED
Can those default cases be reached? If not, they should get a MOZ_NOT_REACHED.
(Assignee)

Comment 3

5 years ago
(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.
(Assignee)

Comment 4

5 years ago
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.
Attachment #637290 - Attachment is obsolete: true
Attachment #637290 - Flags: review?(peterv)
Attachment #638033 - Flags: review?(peterv)
(Assignee)

Comment 5

5 years ago
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+

Updated

5 years ago
Duplicate of this bug: 769953
https://hg.mozilla.org/mozilla-central/rev/a86ce9b348b8
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
(Assignee)

Updated

5 years ago
status-firefox16: affected → fixed
You need to log in before you can comment on or make changes to this bug.