Opened 9 years ago

Closed 9 years ago

#12756 closed bug (fixed)

[Patch] kits/print/PicturePrinter.cpp: fix gcc6 build

Reported by: mt Owned by: phoudoin
Priority: normal Milestone: Unscheduled
Component: Printing Version: R1/Development
Keywords: kits/print Cc:
Blocked By: Blocking:
Platform: All

Description

Add curly braces to fix '-Werror=misleading-indentation' warnings.

C++ /home/haiku/haiku/haiku/generated-gcc6/objects/haiku/x86/release/kits/print/PicturePrinter.o 
/home/haiku/haiku/haiku/src/kits/print/PicturePrinter.cpp: In member function 'virtual void PicturePrinter::SetClippingRects(BRect*, uint32)':
/home/haiku/haiku/haiku/src/kits/print/PicturePrinter.cpp:205:2: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
  if (numRects == 0) Print("none"); Cr();
  ^~
/home/haiku/haiku/haiku/src/kits/print/PicturePrinter.cpp:205:36: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
  if (numRects == 0) Print("none"); Cr();
                                    ^~
cc1plus: all warnings being treated as errors

Attachments (2)

0010-PicturePrinter.cpp-fix-gcc6-build.patch (839 bytes ) - added by mt 9 years ago.
0009-PicturePrinter.cpp-fix-gcc6-build.patch (841 bytes ) - added by mt 9 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by mt, 9 years ago

patch: 01

comment:2 by korli, 9 years ago

This doesn't fit our coding style, and it looks wrong anyway. "Print("none");" and "Cr();" are meant to be in the same block, aren't?

in reply to:  2 comment:3 by mt, 9 years ago

Replying to korli:

This doesn't fit our coding style, and it looks wrong anyway. "Print("none");" and "Cr();" are meant to be in the same block, aren't?

Hi, korli. I think PicturePrinter::SetClippingRects() generates "SetClippingRects " + Cr or "SetClippingRects none " + Cr, so I think Cr() is not in if block.

comment:4 by korli, 9 years ago

Correct. Could you fix the coding style though?

in reply to:  4 comment:5 by mt, 9 years ago

Replying to korli:

Correct. Could you fix the coding style though?

Hi, korli. I updated patch.

comment:6 by waddlesplash, 9 years ago

Resolution: fixed
Status: newclosed

Applied in hrev50308. Thanks!

Note: See TracTickets for help on using tickets.