Closed Bug 791801 Opened 12 years ago Closed 12 years ago

In constructor ‘mozilla::gfx::AlphaBoxBlur::AlphaBoxBlur... ‘mozilla::gfx::AlphaBoxBlur::mStride’ will be initialized after...‘mozilla::gfx::IntRect mozilla::gfx::AlphaBoxBlur::mRect’...Blur.cpp:388:1: warning: when initialized here [-Wreorder

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Newish build warning: { In file included from ../../../mozilla/gfx/2d/Blur.cpp:5:0: ../../dist/include/mozilla/gfx/Blur.h: In constructor ‘mozilla::gfx::AlphaBoxBlur::AlphaBoxBlur(uint8_t*, const mozilla::gfx::Rect&, int32_t, float)’: ../../dist/include/mozilla/gfx/Blur.h:153:11: warning: ‘mozilla::gfx::AlphaBoxBlur::mStride’ will be initialized after [-Wreorder] ../../dist/include/mozilla/gfx/Blur.h:122:11: warning: ‘mozilla::gfx::IntRect mozilla::gfx::AlphaBoxBlur::mRect’ [-Wreorder] ../../../mozilla/gfx/2d/Blur.cpp:388:1: warning: when initialized here [-Wreorder] }
Attached patch fix (deleted) — Splinter Review
Attachment #661882 - Flags: review?
Attachment #661882 - Flags: review? → review?(ajones)
The patch just moves mRect to be first in the init list (before mSpreadRadius), to match the ordering in the .h file: http://mxr.mozilla.org/mozilla-central/source/gfx/2d/Blur.h#119 I verified that this compiles & fixes the build warning locally for me.
Attachment #661882 - Flags: review?(ajones) → review+
Note: The line that this shifted... > mRect(aRect.x, aRect.y, aRect.width, aRect.height) ...looks a bit suspicious -- it's initializing an IntRect from a Rect. So, aRect.x, aRect.y, etc. are all float-valued, and we're copying them to integers. That's potentially-bogus... Anthony, shouldn't we need range-checks and/or NS_Round() calls there? (If so, I'm happy to file a separate bug on that, or feel free to do so yourself)
This is called only from DrawTargetCairo::DrawSurfaceWithShadow() where the values can only be ints. It would make sense to change it to an IntRect or even IntSize.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: