Closed Bug 242908 Opened 20 years ago Closed 16 years ago

clean up nsXIContext::LoadResources

Categories

(SeaMonkey :: Installer, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: ajschult784, Assigned: ajschult784)

References

Details

Attachments

(1 file)

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.
QA Contact: bugzilla → general
QA Contact: general → agracebush
Attached patch patchSplinter Review
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.
Attachment #147970 - Flags: review?(bsmedberg)
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+
Attachment #147970 - Flags: superreview?(dveditz)
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
Closed: 16 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.

Attachment

General

Creator:
Created:
Updated:
Size: