Closed Bug 688238 Opened 13 years ago Closed 13 years ago

Move Init() arguments into the constructor

Categories

(Core :: Graphics: ImageLib, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Details

Attachments

(1 file)

This makes the lifetime of the arguments more clear. i.e. that they stay the same for the lifetime of the decoder.
Attachment #561535 - Flags: review?(joe)
Comment on attachment 561535 [details] [diff] [review]
Move Init() arguments into the constructor

Review of attachment 561535 [details] [diff] [review]:
-----------------------------------------------------------------

::: modules/libpr0n/decoders/nsBMPDecoder.cpp
@@ +63,5 @@
>  #define LINE(row) ((mBIH.height < 0) ? (-mBIH.height - (row)) : ((row) - 1))
>  #define PIXEL_OFFSET(row, col) (LINE(row) * mBIH.width + col)
>  
> +nsBMPDecoder::nsBMPDecoder(RasterImage *aImage, imgIDecoderObserver* aObserver) :
> +    Decoder(aImage, aObserver)

: on the same line as Decoder(. Do this throughout.

::: modules/libpr0n/src/Decoder.h
@@ +56,5 @@
>    /**
>     * Initialize an image decoder. Decoders may not be re-initialized.
>     *
>     * @param aContainer The image container to decode to.
>     * @param aObserver The observer for decode notification events.

This documentation needs to be moved to the constructor.

@@ +68,5 @@
>     * Initializes a decoder whose aImage and aObserver is already being used by a
>     * parent decoder. Decoders may not be re-initialized.
>     *
>     * @param aContainer The image container to decode to.
>     * @param aObserver The observer for decode notification events.

Ditto.
Attachment #561535 - Flags: review?(joe) → review+
https://hg.mozilla.org/mozilla-central/rev/cd9a14388367
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee: nobody → jmuizelaar
Target Milestone: --- → mozilla10
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: