Closed Bug 1021790 Opened 9 years ago Closed 9 years ago
Cleanup naming for scalar and typed array types
There are currently two separate enums, ArrayBufferView::ViewType in jsfriendapi.h and ScalarTypeDescr::Type in TypedObject.h, which encode almost (but not quite) the same set of values for the various primitive scalar types like uint8, float32, and so forth. There is no real consistency to how these enums are used in the engine, so we end up with cases where the enums are cast into each other, cast into and then back out of ints, mixed uses of the two enums within the same file, and so forth. This is a mess. The attached patch changes things so that there is a single new enum, Scalar::Type in jsfriendapi.h, which is used throughout the engine and by API clients. I tried to be economical with the naming (e.g. Scalar::Int32 instead of ArrayBufferView::TYPE_INT32) and also removed all the casts of this enum into or out of primitive types which I could.
Attachment #8435881 - Flags: review?(sphink)
mcMerge absolutely refuses to comment to this bug. Landed https://hg.mozilla.org/integration/mozilla-inbound/rev/4d482d201608
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Attachment #8435881 - Flags: review?(sphink) → review+
Assignee: nobody → bhackett1024
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.