clean up nsXIContext::LoadResources

RESOLVED INVALID

Status

RESOLVED INVALID
15 years ago
10 years ago

People

(Reporter: ajschult784, Assigned: ajschult784)

Tracking

Trunk
x86
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

15 years ago
Among other things, nsXIContext::LoadResources requires the last error number be
hardcoded into the source.  A placeholder can be used in XIErrors instead. 
LoadResources could also do a better job of allocating memory as it's needed. 
The current allocation scheme leaves an uninitialized element dangling on the end.
(Assignee)

Updated

15 years ago
QA Contact: bugzilla → general

Updated

15 years ago
QA Contact: general → agracebush
(Assignee)

Comment 1

15 years ago
Created attachment 147970 [details] [diff] [review]
patch

what I said in comment 0 about the dangling last element wasn't correct; the
code bails from the loop after reading the last error.	But that's silly too,
although not as bad.

Anyway, this seems more transparent to me.  Also, I simplified the placeholder
for the UI strings.
(Assignee)

Updated

15 years ago
Attachment #147970 - Flags: review?(bsmedberg)

Comment 2

14 years ago
Comment on attachment 147970 [details] [diff] [review]
patch

>+    for (i = 0; *strkeys[i]; i++)

while you're touching code, make loop incrementers prefix instead of postfix...
this reduces the amount of work some compilers do (avoids a temporary).

>-    for (i = FIRST_ERR; i >= LAST_ERR; i--)
>+    for (i = FIRST_ERR; i > E_LAST_ERR; i--)

and again
Attachment #147970 - Flags: review?(bsmedberg) → review+
(Assignee)

Updated

14 years ago
Attachment #147970 - Flags: superreview?(dveditz)
(Assignee)

Updated

14 years ago
Blocks: 262229
Product: Browser → Seamonkey
This won't be fixed on the Trunk, where the Sm-linux installer has been discontinued.
Andrew, feel free to REOPEN for the 1.1.x Branch if appropriate.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
QA Contact: agracebush → general
Resolution: --- → INVALID
Attachment #147970 - Flags: superreview?(dveditz)
You need to log in before you can comment on or make changes to this bug.