Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

style: parenthesise expressions flagged by -Wparentheses

chantologyb671c6cc6425
diff --git a/toonz/sources/image/tzp/toonzrle.cpp b/toonz/sources/image/tzp/toonzrle.cpp
index adba2818c..dc124f7a4 100644
--- a/toonz/sources/image/tzp/toonzrle.cpp
+++ b/toonz/sources/image/tzp/toonzrle.cpp
@@ -202,25 +202,25 @@ start_from_in0:
break;
case 0xA:
- outval = outval & not_colmask | GET_IN0 << col_offs;
+ outval = (outval & not_colmask) | (GET_IN0 << col_offs);
goto start_from_in1;
break;
case 0xB:
- outval = outval & not_penmask | GET_IN0 << pen_offs;
+ outval = (outval & not_penmask) | (GET_IN0 << pen_offs);
goto start_from_in1;
break;
case 0xC:
- outval = outval & not_colmask | *in++ << col_offs;
+ outval = (outval & not_colmask) | (*in++ << col_offs);
goto start_from_in0;
break;
case 0xD:
- outval = outval & not_penmask | *in++ << pen_offs;
+ outval = (outval & not_penmask) | (*in++ << pen_offs);
goto start_from_in0;
break;
@@ -334,27 +334,27 @@ start_from_in1:
break;
case 0xA:
- outval = outval & not_colmask | in1 << col_offs;
+ outval = (outval & not_colmask) | (in1 << col_offs);
goto start_from_in0;
break;
case 0xB:
- outval = outval & not_penmask | in1 << pen_offs;
+ outval = (outval & not_penmask) | (in1 << pen_offs);
goto start_from_in0;
break;
case 0xC:
tmp = in1 << 4;
- outval = outval & not_colmask | (tmp | GET_IN0) << col_offs;
+ outval = (outval & not_colmask) | ((tmp | GET_IN0) << col_offs);
goto start_from_in1;
break;
case 0xD:
tmp = in1 << 4;
- outval = outval & not_penmask | (tmp | GET_IN0) << pen_offs;
+ outval = (outval & not_penmask) | ((tmp | GET_IN0) << pen_offs);
goto start_from_in1;
break;
@@ -423,7 +423,7 @@ static int tif_toonz1_decode_cm24(UCHAR* buf_in, int* buf_in_len,
inval = *in++;
switch (inval) {
case 0xF6:
- outval = outval & not_xubmask | *in++ << xub_offs;
+ outval = (outval & not_xubmask) | (*in++ << xub_offs);
break;
@@ -459,12 +459,12 @@ static int tif_toonz1_decode_cm24(UCHAR* buf_in, int* buf_in_len,
break;
case 0xFC:
- outval = outval & not_colmask | *in++ << col_offs;
+ outval = (outval & not_colmask) | (*in++ << col_offs);
break;
case 0xFD:
- outval = outval & not_penmask | *in++ << pen_offs;
+ outval = (outval & not_penmask) | (*in++ << pen_offs);
break;
diff --git a/toonz/sources/toonz/xshcellmover.cpp b/toonz/sources/toonz/xshcellmover.cpp
index 6ca78179e..9c84817f6 100644
--- a/toonz/sources/toonz/xshcellmover.cpp
+++ b/toonz/sources/toonz/xshcellmover.cpp
@@ -560,11 +560,11 @@ void LevelMoverTool::onClick(const QMouseEvent *e) {
m_qualifiers |= CellsMover::eCopyCells;
if (e->modifiers() & Qt::ShiftModifier ||
// Or Dragging the Frame Cell
- Preferences::instance()->isAlwaysDragFrameCell() &&
- (r0 == r1 && c0 == c1) &&
- xsh->getCell(row, col) != xsh->getCell(row - 1, col) &&
- !(xsh->getCell(row + 1, col).isEmpty() &&
- xsh->getCell(row - 1, col).isEmpty()))
+ (Preferences::instance()->isAlwaysDragFrameCell() &&
+ (r0 == r1 && c0 == c1) &&
+ xsh->getCell(row, col) != xsh->getCell(row - 1, col) &&
+ !(xsh->getCell(row + 1, col).isEmpty() &&
+ xsh->getCell(row - 1, col).isEmpty())))
m_qualifiers |= CellsMover::eInsertCells;
if (e->modifiers() & Qt::AltModifier)
m_qualifiers |= CellsMover::eOverwriteCells;
diff --git a/toonz/sources/toonzlib/fill.cpp b/toonz/sources/toonzlib/fill.cpp
index 2fd0f7e62..3a437c441 100644
--- a/toonz/sources/toonzlib/fill.cpp
+++ b/toonz/sources/toonzlib/fill.cpp
@@ -575,7 +575,7 @@ bool extendNormalFill(const TRasterCM32P &r, const TPoint &p, bool right,
bool toneDown = false;
int pixPaint = pixel->getPaint();
while (tone != 0 && (pixPaint == paintAtClickedPos ||
- pixPaint == paint && !DEF_REGION_WITH_PAINT)) {
+ (pixPaint == paint && !DEF_REGION_WITH_PAINT))) {
points.push_back(TPoint(x, y));
++pixelCount;
if (pixel->isPurePaint()) ++rowPixelCount;
diff --git a/toonz/sources/toonzqt/imageutils.cpp b/toonz/sources/toonzqt/imageutils.cpp
index a199562f7..665726b57 100644
--- a/toonz/sources/toonzqt/imageutils.cpp
+++ b/toonz/sources/toonzqt/imageutils.cpp
@@ -1028,8 +1028,8 @@ bool ShortcutZoomer::exec(QKeyEvent *event) {
if (key == Qt::Key_Control || key == Qt::Key_Shift || key == Qt::Key_Alt)
return false;
- key = key | event->modifiers() &
- (~0xf0000000); // Ignore if the key is a numpad key
+ key = key | (event->modifiers() &
+ (~0xf0000000)); // Ignore if the key is a numpad key
return (key == showHideFullScreenKey) ? toggleFullScreen()
: (key == Qt::Key_Escape) ? toggleFullScreen(true)