diff --git a/toonz/sources/common/tgeometry/tcurveutil.cpp b/toonz/sources/common/tgeometry/tcurveutil.cpp index 3ba356bc..be1d30fe 100644 --- a/toonz/sources/common/tgeometry/tcurveutil.cpp +++ b/toonz/sources/common/tgeometry/tcurveutil.cpp @@ -396,11 +396,12 @@ int intersect(const TQuadratic &q, return 0; } - if (q.getP2() - q.getP1() == q.getP1() - q.getP0()) //pure il secondo e' unsegmento.... + if (q.getP2() - q.getP1() == q.getP1() - q.getP0()) {//pure il secondo e' unsegmento.... if (firstIsQuad) return intersect(TSegment(q.getP0(), q.getP2()), s, intersections); else return intersect(s, TSegment(q.getP0(), q.getP2()), intersections); + } vector bez, pol; bez.push_back(q.getP0()); diff --git a/toonz/sources/include/tgeometry.h b/toonz/sources/include/tgeometry.h index 4401c4bf..d689575c 100644 --- a/toonz/sources/include/tgeometry.h +++ b/toonz/sources/include/tgeometry.h @@ -885,7 +885,7 @@ template <> inline TRectT::TRectT(const TDimensionT &d) : x0(0.0), y0(0.0), x1(d.lx), y1(d.ly){}; template <> -inline bool TRectT::isEmpty() const { return x0 == x1 && y0 == y1 || x0 > x1 || y0 > y1; } +inline bool TRectT::isEmpty() const { return (x0 == x1 && y0 == y1) || x0 > x1 || y0 > y1; } template <> inline void TRectT::empty() { x0 = y0 = x1 = y1 = 0; } template <> diff --git a/toonz/sources/include/tpixel.h b/toonz/sources/include/tpixel.h index 50173448..49ba0d30 100644 --- a/toonz/sources/include/tpixel.h +++ b/toonz/sources/include/tpixel.h @@ -248,7 +248,7 @@ public: : r(rr), g(gg), b(bb), m(mm){}; inline bool operator==(const TPixelD &p) const { return r == p.r && g == p.g && b == p.b && m == p.m; }; - inline bool operator<(const TPixelD &p) const { return r < p.r || r == p.r && (g < p.g || g == p.g && (b < p.b || b == p.b && (m < p.m))); }; + inline bool operator<(const TPixelD &p) const { return r < p.r || (r == p.r && (g < p.g || (g == p.g && (b < p.b || (b == p.b && (m < p.m)))))); }; inline bool operator>=(const TPixelD &p) const { return !operator<(p); }; inline bool operator!=(const TPixelD &p) const { return !operator==(p); }; diff --git a/toonz/sources/tnztools/skeletonsubtools.cpp b/toonz/sources/tnztools/skeletonsubtools.cpp index ee653be1..f7d309a3 100644 --- a/toonz/sources/tnztools/skeletonsubtools.cpp +++ b/toonz/sources/tnztools/skeletonsubtools.cpp @@ -825,7 +825,7 @@ void IKTool::initEngine(const TPointD &pos) Skeleton::Bone *next = m_skeleton->getBoneByColumnIndex(*it++); for (; it != links.end(); ++it) stack.push_back(std::make_pair(*it, prev)); - if (links.size() > 1 || prev && next && prev->getParent() == bone && next->getParent() == bone) { + if (links.size() > 1 || (prev && next && (prev->getParent() == bone && next->getParent() == bone))) { bone = next; } else { m_joints.push_back(Joint(bone, prev, sign)); diff --git a/toonz/sources/tnztools/typetool.cpp b/toonz/sources/tnztools/typetool.cpp index a8cd536d..e9bf9c04 100644 --- a/toonz/sources/tnztools/typetool.cpp +++ b/toonz/sources/tnztools/typetool.cpp @@ -1218,13 +1218,14 @@ void TypeTool::leftButtonDown(const TPointD &pos, const TMouseEvent &) if (!vi && !ti) return; - if (m_isFrameCreated) + if (m_isFrameCreated) { if (vi) m_undo = new UndoTypeTool(0, 0, getApplication()->getCurrentLevel()->getSimpleLevel(), getCurrentFid(), m_isFrameCreated, m_isLevelCreated); else m_undo = new RasterUndoTypeTool(0, 0, getApplication()->getCurrentLevel()->getSimpleLevel(), getCurrentFid(), m_isFrameCreated, m_isLevelCreated); + } // closeImeWindow(); // if(m_viewer) m_viewer->enableIme(true); diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cpp index b8561917..48396dc2 100644 --- a/toonz/sources/toonz/iocommand.cpp +++ b/toonz/sources/toonz/iocommand.cpp @@ -570,7 +570,7 @@ void substituteLevel(TXsheet *xsh, TXshLevel *srcLevel, TXshLevel *dstLevel) xsh->getCells(r0, c, rowCount, &cells[0]); bool changed = false; for (int i = 0; i < rowCount; i++) { - if (!cells[i].isEmpty()) + if (!cells[i].isEmpty()) { if (cells[i].m_level.getPointer() == srcLevel) { cells[i].m_level = dstLevel; changed = true; @@ -583,6 +583,7 @@ void substituteLevel(TXsheet *xsh, TXshLevel *srcLevel, TXshLevel *dstLevel) substitutedSubs.insert(childLevel); } } + } } if (changed) xsh->setCells(r0, c, rowCount, &cells[0]); diff --git a/toonz/sources/toonzlib/doubleparamcmd.cpp b/toonz/sources/toonzlib/doubleparamcmd.cpp index eec0c252..3e1ddb65 100644 --- a/toonz/sources/toonzlib/doubleparamcmd.cpp +++ b/toonz/sources/toonzlib/doubleparamcmd.cpp @@ -250,14 +250,14 @@ void KeyframeSetter::getRotatingSpeedHandles( } } // SpeedInOut * Linear * - if (ty[0] == 2 && ty[1] == 1 || ty[1] == 2 && ty[2] == 1) { + if ((ty[0] == 2 && ty[1] == 1) || (ty[1] == 2 && ty[2] == 1)) { int k = ty[1] == 1 ? kIndex - 1 : kIndex; double speed = getNorm(param->getSpeedIn(k)); if (speed > epsilon) rotatingSpeeds.push_back(std::make_pair(-speed, k)); } // * Linear * SpeedInOut - if (ty[1] == 1 && ty[2] == 2 || ty[2] == 1 && ty[3] == 2) { + if ((ty[1] == 1 && ty[2] == 2) || (ty[2] == 1 && ty[3] == 2)) { int k = ty[2] == 2 ? kIndex : kIndex + 1; double speed = getNorm(param->getSpeedOut(k)); if (speed > epsilon) @@ -623,7 +623,7 @@ void KeyframeSetter::setSpeedIn(const TPointD &speedIn) double outNorm = getNorm(m_keyframe.m_speedOut); if (m_kIndex + 1 == m_param->getKeyframeCount() || isSpeedInOut(m_kIndex) || - m_keyframe.m_type == TDoubleKeyframe::Expression && m_keyframe.m_expressionText.find("cycle") != string::npos) { + (m_keyframe.m_type == TDoubleKeyframe::Expression && m_keyframe.m_expressionText.find("cycle") != string::npos)) { // update next segment speed vector double inNorm = getNorm(m_keyframe.m_speedIn); if (inNorm < eps) diff --git a/toonz/sources/toonzlib/tstageobject.cpp b/toonz/sources/toonzlib/tstageobject.cpp index 4005c7dc..92ba32c4 100644 --- a/toonz/sources/toonzlib/tstageobject.cpp +++ b/toonz/sources/toonzlib/tstageobject.cpp @@ -1925,11 +1925,11 @@ void TStageObject::loadData(TIStream &is) if (tnzVersion < VersionNumber(1, 16) && !keyframes.empty()) { std::map::iterator itKf = keyframes.begin(); std::set keyframeIndexSet; - for (itKf; itKf != keyframes.end(); itKf++) + for (; itKf != keyframes.end(); itKf++) if (is52FullKeyframe(itKf->first)) keyframeIndexSet.insert(itKf->first); std::set::iterator itKfInd = keyframeIndexSet.begin(); - for (itKfInd; itKfInd != keyframeIndexSet.end(); itKfInd++) + for (; itKfInd != keyframeIndexSet.end(); itKfInd++) setkey(m_scale, *itKfInd); } updateKeyframes(); diff --git a/toonz/sources/toonzqt/functionpaneltools.cpp b/toonz/sources/toonzqt/functionpaneltools.cpp index 5261ccb6..c47da719 100644 --- a/toonz/sources/toonzqt/functionpaneltools.cpp +++ b/toonz/sources/toonzqt/functionpaneltools.cpp @@ -382,10 +382,10 @@ void MoveHandleDragTool::drag(QMouseEvent *e) if (m_nSpeed != QPointF(0, 0)) { QPointF delta = posF - p0; posF -= m_nSpeed * (delta.x() * m_nSpeed.x() + delta.y() * m_nSpeed.y()); - if (m_handle == FunctionPanel::SpeedIn && posF.x() > p0.x() || m_handle == FunctionPanel::SpeedOut && posF.x() < p0.x()) + if ((m_handle == FunctionPanel::SpeedIn && posF.x() > p0.x()) || (m_handle == FunctionPanel::SpeedOut && posF.x() < p0.x())) posF = p0; } else { - if (m_handle == FunctionPanel::SpeedIn && posF.x() > p0.x() || m_handle == FunctionPanel::SpeedOut && posF.x() < p0.x()) + if ((m_handle == FunctionPanel::SpeedIn && posF.x() > p0.x()) || (m_handle == FunctionPanel::SpeedOut && posF.x() < p0.x())) posF.setX(p0.x()); } diff --git a/toonz/sources/toonzqt/functionselection.cpp b/toonz/sources/toonzqt/functionselection.cpp index 28415042..da71db18 100644 --- a/toonz/sources/toonzqt/functionselection.cpp +++ b/toonz/sources/toonzqt/functionselection.cpp @@ -590,8 +590,8 @@ void FunctionSelection::doCut() if (i + 1 < n && kk.contains(i + 1) && !cellsSelection) delta += curve->keyframeIndexToFrame(i) - curve->keyframeIndexToFrame(i + 1); } else { - if (cellsSelection && bottomRow <= curve->keyframeIndexToFrame(i) || - !cellsSelection && delta != 0) + if ((cellsSelection && bottomRow <= curve->keyframeIndexToFrame(i)) || + (!cellsSelection && delta != 0)) moveUndo->addMovement(curve, j, delta); j++; }