Closed Bug 347927 Opened 18 years ago Closed 17 years ago

Using JS_ARRAY_LENGTH and JS_ARRAY_END

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

Details

Attachments

(1 file)

[This is a spin-off of bug 322135 comment 29]

The fixes for bug 322135 introduced 2 new macros,  JS_ARRAY_LENGTH/JS_ARRAY_END, to get the length and end pointer of a C array. It would be nice if the current code that uses explicit sizeof array/sizeof array[0] calculations would be changed to use the macros.
Except for char arrays, as noted in bug 322135 comment 32.

/be
Attached patch v1Splinter Review
The patch switches the remaining places with sizeof x / sizeof x[0] pattern to use the JS_ARRAY_LENGTH macro.
Attachment #290040 - Flags: review?(brendan)
Attachment #290040 - Flags: review?(brendan)
Attachment #290040 - Flags: review+
Attachment #290040 - Flags: approval1.9+
I checked in the patch from comment 2 to the trunk:

http://bonsai.mozilla.org/cvsquery.cgi?module=PhoenixTinderbox&branch=HEAD&cvsroot=%2Fcvsroot&date=explicit&mindate=1196090242&maxdate=1196090340&who=igor%mir2.org

Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: