Closed Bug 727685 Opened 12 years ago Closed 12 years ago

Compile time error for unused variable 'invmatrix' on nsSVGForeignObjectFrame

Categories

(Core :: Layout: Block and Inline, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: sinker, Assigned: sinker)

References

Details

Attachments

(1 file, 2 obsolete files)

invmatrix is only used for assertion.  It dues to a compiling time error for unused variable.
Assignee: nobody → tlee
Status: NEW → ASSIGNED
Attachment #597638 - Flags: review?(roc)
Blocks: 674728
Comment on attachment 597638 [details] [diff] [review]
Fix the compile time error for unused variable invmatrix

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

r+ with that

::: layout/svg/base/src/nsSVGForeignObjectFrame.cpp
@@ +273,5 @@
>    gfx->Multiply(matrixForChildren);
>  
>    // Transform the dirty rect into the rectangle containing the
>    // transformed dirty rect.
> +  mozilla::DebugOnly<gfxMatrix> invmatrix = matrix.Invert();

Instead of a mozilla:: prefix here, just add "using namespace mozilla;" after the #includes.
Attachment #597638 - Flags: review?(roc) → review+
updated as the suggestion of comment 2.
Attachment #597638 - Attachment is obsolete: true
Try run for b6c7a39cd692 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=b6c7a39cd692
Results (out of 133 total builds):
    success: 110
    warnings: 10
    failure: 13
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/tlee@mozilla.com-b6c7a39cd692
I don't like it. matrix.Invert() actually changes the matrix, unnecessarily in opt builds. I'd add a little helper

#ifdef DEBUG
const gfxMatrix&
Inverse(const gfxMatrix& aMatrix)
{
  gfxMatrix matrix = aMatrix;
  return matrix.Invert();
}
#endif

And then change the two assertions in this function by

NS_ASSERTION(!Inverse(matrix).IsSingular(),
             "inverse of non-singular matrix should be non-singular");

Or something like that
This code was removed in bug 727212
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Try run for c0cded1d82ce is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=c0cded1d82ce
Results (out of 212 total builds):
    success: 175
    warnings: 23
    failure: 14
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/tlee@mozilla.com-c0cded1d82ce
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: