The default bug view has changed. See this FAQ.

GCC 4.6 build warning: "gfxASurface.cpp:533:16: warning: variable ‘size’ set but not used [-Wunused-but-set-variable]"

RESOLVED FIXED in mozilla8

Status

()

Core
Graphics
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

Trunk
mozilla8
x86_64
Linux
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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!
(Assignee)

Comment 1

6 years ago
Created attachment 553244 [details] [diff] [review]
fix: remove unused variable
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #553244 - Flags: review?(jones.chris.g)
Attachment #553244 - Flags: review?(jones.chris.g) → review+
(Assignee)

Comment 2

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/4d9fe0a94ba2
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/4d9fe0a94ba2
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
(Assignee)

Updated

6 years ago
Blocks: 187528
You need to log in before you can comment on or make changes to this bug.