Last Comment Bug 679091 - GCC 4.6 build warning: "gfxASurface.cpp:533:16: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]"
: GCC 4.6 build warning: "gfxASurface.cpp:533:16: warning: variable ‘size’ set ...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: mozilla8
Assigned To: Daniel Holbert [:dholbert]
:
Mentors:
Depends on:
Blocks: buildwarning 635035
  Show dependency treegraph
 
Reported: 2011-08-15 12:38 PDT by Daniel Holbert [:dholbert]
Modified: 2011-09-14 12:24 PDT (History)
1 user (show)
khuey: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix: remove unused variable (1.02 KB, patch)
2011-08-15 12:42 PDT, Daniel Holbert [:dholbert]
cjones.bugs: review+
Details | Diff | Splinter Review

Description Daniel Holbert [:dholbert] 2011-08-15 12:38:50 PDT
Build warning reported by GCC 4.6:
{
gfx/thebes/gfxASurface.cpp: In member function ‘void gfxASurface::FastMovePixels(const nsIntRect&, const nsIntPoint&)’:
gfx/thebes/gfxASurface.cpp:533:16: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]
}

Looks like this variable was unused in the patch that added it:
====
+void
+gfxASurface::MovePixels(const nsIntRect& aSourceRect,
+                        const nsIntPoint& aDestTopLeft)
+{
+    gfxIntSize size = GetSize();
+    nsIntRect dest(aDestTopLeft, aSourceRect.Size());
+    // Assume that our cairo backend already knows how to properly
+    // self-copy.  gfxASurface subtypes whose backend can't self-copy
+    // need their own implementations, or their backends need to be
+    // fixed.
+    nsRefPtr<gfxContext> ctx = new gfxContext(this);
+    ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
+    nsIntPoint srcOrigin = dest.TopLeft() - aSourceRect.TopLeft();
+    ctx->SetSource(this, gfxPoint(srcOrigin.x, srcOrigin.y));
+    ctx->Rectangle(gfxRect(dest.x, dest.y, dest.width, dest.height));
+    ctx->Fill();
+}
https://hg.mozilla.org/mozilla-central/rev/173971a4af7e
====

Begone with you, unused variable!
Comment 1 Daniel Holbert [:dholbert] 2011-08-15 12:42:12 PDT
Created attachment 553244 [details] [diff] [review]
fix: remove unused variable
Comment 2 Daniel Holbert [:dholbert] 2011-08-15 17:17:31 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/4d9fe0a94ba2
Comment 3 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-16 04:06:41 PDT
http://hg.mozilla.org/mozilla-central/rev/4d9fe0a94ba2

Note You need to log in before you can comment on or make changes to this bug.