Closed Bug 268321 Opened 20 years ago Closed 20 years ago

Small cleanup of gfx\src\os2

Categories

(Core Graveyard :: GFX: OS/2, defect)

x86
OS/2
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mozilla, Assigned: mkaply)

Details

Attachments

(1 file, 2 obsolete files)

When building gfx\src\os2 I get lots of warnings about unused variables,
variables that might be used uninitialized, and missing casts. Nothing is
anywhere critical, but it was difficult to find the real error messages among
all those warnings. ;-)
Attached patch minor cleanup, diff (obsolete) — Splinter Review
Assignee: mkaply → mozilla
Status: NEW → ASSIGNED
Comment on attachment 165078 [details] [diff] [review]
minor cleanup, diff

Mike, can you especially have a look if I interpreted the missing casts in
nsImageOS2.cpp correctly? I tested the patch and did not notice any problems
afterwards, but you never know...
Attachment #165078 - Flags: review?(mkaply)
Isn't it better to change the PRINTDLG member variables and function parameters
to be consistent, instead of using casts all around?
Hmm, I guess you think about numPrinter and related (mQueueCount etc.)? In this
patch I have converted everything that deals with the number of printers to
ULONG, as this is what SplEnumQueue requires. (Seems that I have to update the
patch to bug 199763 as well which originally led me to do this.)
Attachment #165078 - Attachment is obsolete: true
Attachment #165078 - Flags: review?(mkaply)
I only notice now how stupid it is to assign bugs to myself, even if I create
the patches. I cannot check them in myself anyway and then mkaply is not sent
mail to be reminded of reviews and checkin requirements...
Assignee: mozilla → mkaply
Status: ASSIGNED → NEW
Attachment #166046 - Flags: superreview?(mkaply)
Attachment #166046 - Flags: review?(mkaply)
Comment on attachment 166046 [details] [diff] [review]
2nd try, make every printer number ULONG

r=mkaply, sr=blizzard (platform specific), a=mkaply for 1.8
Attachment #166046 - Flags: superreview?(mkaply)
Attachment #166046 - Flags: superreview+
Attachment #166046 - Flags: review?(mkaply)
Attachment #166046 - Flags: review+
Attachment #166046 - Flags: approval1.8a5+
>      if (!str) {
> -      for (int i = count - 1; i >= 0; i--) 
> +      for (ULONG i = count - 1; i >= 0; i--) 
>          nsMemory::Free(array[i]);

Hey, with ULONG i will never be less than 0! Hang due to infinite loop.
I guess it is better to make this loop to go in opposite direction.
      for (ULONG i = 0 ; i < count ; i++)

Yes, absolutely correct. Stupid me just blindly changed all relevant ints to
ULONGs in the for loops instead of looking closely at what they are doing.
Attachment #166046 - Attachment is obsolete: true
Comment on attachment 166579 [details] [diff] [review]
corrected loop, final patch

Carrying over r/sr/a. Mike, can you check this in please? Or someone else?
Attachment #166579 - Flags: superreview+
Attachment #166579 - Flags: review+
Attachment #166579 - Flags: approval1.8a5+
Fix checked in.

This is trunk only.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: