# HG changeset patch # User Teemu Piippo # Date 1405273224 -10800 # Node ID d077dd19bf9a8f81ecf97e93c060e0e60b15a7ef # Parent 5f822ad6187531b97e08937b7410c07f01844a1e - changed `&&` and `||` operators to their named variants `and` and `or` diff -r 5f822ad61875 -r d077dd19bf9a src/actions.cc --- a/src/actions.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/actions.cc Sun Jul 13 20:40:24 2014 +0300 @@ -354,7 +354,7 @@ continue; // For subfiles, type check is not enough, we check the name of the document as well. - if (type == OBJ_Subfile && not subfilenames.contains (obj.staticCast()->fileInfo()->name())) + if (type == OBJ_Subfile and not subfilenames.contains (obj.staticCast()->fileInfo()->name())) continue; obj->select(); @@ -511,7 +511,7 @@ QString fname = QFileDialog::getSaveFileName (g_win, "Save Screencap", defaultname, "PNG images (*.png);;JPG images (*.jpg);;BMP images (*.bmp);;All Files (*.*)"); - if (not fname.isEmpty() && not img.save (fname)) + if (not fname.isEmpty() and not img.save (fname)) critical (format ("Couldn't open %1 for writing to save screencap: %2", fname, strerror (errno))); delete[] imgdata; @@ -719,7 +719,7 @@ int idx = QInputDialog::getInt (null, "Go to line", "Go to line:", defval, 1, getCurrentDocument()->getObjectCount(), 1, &ok); - if (not ok || (obj = getCurrentDocument()->getObject (idx - 1)) == null) + if (not ok or (obj = getCurrentDocument()->getObject (idx - 1)) == null) return; getCurrentDocument()->clearSelection(); @@ -781,7 +781,7 @@ QString text = format (tr ("The directory %1 is suggested for " "subfiles. This directory does not exist, create it?"), desiredPath); - if (QDir (desiredPath).exists() || confirm (title, text)) + if (QDir (desiredPath).exists() or confirm (title, text)) { subdirname = desiredPath; QDir().mkpath (subdirname); @@ -819,7 +819,7 @@ digits.prepend ("0"); fullsubname = subdirname + "/" + basename (parentpath) + "s" + digits + ".dat"; - } while (findDocument ("s\\" + basename (fullsubname)) != null || QFile (fullsubname).exists()); + } while (findDocument ("s\\" + basename (fullsubname)) != null or QFile (fullsubname).exists()); } // Determine the BFC winding type used in the main document - it is to @@ -831,7 +831,7 @@ LDBFC::Statement a = obj.staticCast()->statement(); - if (a == LDBFC::CertifyCCW || a == LDBFC::CertifyCW || a == LDBFC::NoCertify) + if (a == LDBFC::CertifyCCW or a == LDBFC::CertifyCW or a == LDBFC::NoCertify) { bfctype = a; break; @@ -914,7 +914,7 @@ { LDSubfilePtr ref = obj.dynamicCast(); - if (ref == null || not ref->fileInfo()->isImplicit()) + if (ref == null or not ref->fileInfo()->isImplicit()) continue; ref->fileInfo()->setImplicit (false); diff -r 5f822ad61875 -r d077dd19bf9a src/actionsEdit.cc --- a/src/actionsEdit.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/actionsEdit.cc Sun Jul 13 20:40:24 2014 +0300 @@ -127,7 +127,7 @@ // inlined contents. long idx = obj->lineNumber(); - if (idx == -1 || obj->type() != OBJ_Subfile) + if (idx == -1 or obj->type() != OBJ_Subfile) continue; LDObjectList objs = obj.staticCast()->inlineContents (deep, false); @@ -258,7 +258,7 @@ { const LDObjectType type = obj->type(); - if (type != OBJ_Quad && type != OBJ_Triangle) + if (type != OBJ_Quad and type != OBJ_Triangle) continue; LDLinePtr lines[4]; @@ -605,8 +605,8 @@ v.apply ([&](Axis ax, double& coord) { - if (not sel.contains (ax) || - (not any && coord != search)) + if (not sel.contains (ax) or + (not any and coord != search)) { return; } @@ -688,7 +688,7 @@ { for (LDObjectPtr obj : getCurrentDocument()->objects()) { - if (obj->isColored() && obj->color() == color) + if (obj->isColored() and obj->color() == color) return true; } @@ -702,7 +702,7 @@ int colnum = 0; LDColor color; - for (colnum = 0; colnum < numLDConfigColors() && ((color = LDColor::fromIndex (colnum)) == null || isColorUsed (color)); colnum++) + for (colnum = 0; colnum < numLDConfigColors() and ((color = LDColor::fromIndex (colnum)) == null or isColorUsed (color)); colnum++) ; if (colnum >= numLDConfigColors()) @@ -751,15 +751,15 @@ // Find a spot to place the new comment for (obj = getCurrentDocument()->getObject (0); - obj != null && obj->next() != null && not obj->next()->isScemantic(); + obj != null and obj->next() != null and not obj->next()->isScemantic(); obj = obj->next()) { LDCommentPtr comm = obj.dynamicCast(); - if (comm != null && comm->text().startsWith ("!HISTORY ")) + if (comm != null and comm->text().startsWith ("!HISTORY ")) ishistory = true; - if (prevIsHistory && not ishistory) + if (prevIsHistory and not ishistory) { // Last line was history, this isn't, thus insert the new history // line here. @@ -774,7 +774,7 @@ // If we're adding a history line right before a scemantic object, pad it // an empty line - if (obj && obj->next() && obj->next()->isScemantic()) + if (obj and obj->next() and obj->next()->isScemantic()) getCurrentDocument()->insertObj (idx, LDEmptyPtr (spawn())); buildObjList(); @@ -794,7 +794,7 @@ for (LDObjectPtr obj : selection()) { - if (obj->type() != OBJ_Line && obj->type() != OBJ_CondLine) + if (obj->type() != OBJ_Line and obj->type() != OBJ_CondLine) continue; QVector newsegs; diff -r 5f822ad61875 -r d077dd19bf9a src/addObjectDialog.cc --- a/src/addObjectDialog.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/addObjectDialog.cc Sun Jul 13 20:40:24 2014 +0300 @@ -132,7 +132,7 @@ if (obj != null) _color = obj->color(); else - _color = (type == OBJ_CondLine || type == OBJ_Line) ? edgecolor() : maincolor(); + _color = (type == OBJ_CondLine or type == OBJ_Line) ? edgecolor() : maincolor(); pb_color = new QPushButton; setButtonBackground (pb_color, _color); @@ -291,7 +291,7 @@ setlocale (LC_ALL, "C"); // FIXME: Redirect to Edit Raw - if (obj && obj->type() == OBJ_Error) + if (obj and obj->type() == OBJ_Error) return; if (type == OBJ_Empty) @@ -301,7 +301,7 @@ Matrix transform = g_identity; AddObjectDialog dlg (type, obj); - assert (obj == null || obj->type() == type); + assert (obj == null or obj->type() == type); if (dlg.exec() == QDialog::Rejected) return; diff -r 5f822ad61875 -r d077dd19bf9a src/colorSelector.cc --- a/src/colorSelector.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/colorSelector.cc Sun Jul 13 20:40:24 2014 +0300 @@ -119,7 +119,7 @@ numtext->setDefaultTextColor ((luma (col) < 80) ? Qt::white : Qt::black); numtext->setPos (x, y); - if (selection() && i == selection().index()) + if (selection() and i == selection().index()) { auto curspic = m_scene->addPixmap (getIcon ("colorcursor")); curspic->setPos (x, y); @@ -159,7 +159,7 @@ #ifdef TRANSPARENT_DIRECT_COLORS ui->transparentDirectColor->setEnabled (selection().isDirect()); - ui->transparentDirectColor->setChecked (selection().isDirect() && selection().faceColor().alphaF() < 1.0); + ui->transparentDirectColor->setChecked (selection().isDirect() and selection().faceColor().alphaF() < 1.0); #else ui->transparentDirectColor->setChecked (false); ui->transparentDirectColor->setEnabled (false); @@ -174,11 +174,11 @@ // currently selected color. We cannot do this in the constructor because the // height is not set properly there. Though don't do this if we selected a // direct color. - if (m_firstResize && selection().index() >= numLDConfigColors()) + if (m_firstResize and selection().index() >= numLDConfigColors()) { int visibleColors = (ui->viewport->height() / g_squareSize) * g_numColumns; - if (selection() && selection().index() >= visibleColors) + if (selection() and selection().index() >= visibleColors) { int y = (selection().index() / g_numColumns) * g_squareSize; ui->viewport->verticalScrollBar()->setValue (y); @@ -236,7 +236,7 @@ // void ColorSelector::transparentCheckboxClicked() { - if (selection() == null || not selection().isDirect()) + if (selection() == null or not selection().isDirect()) return; selectDirectColor (selection().faceColor()); @@ -248,7 +248,7 @@ { ColorSelector dlg (defval, parent); - if (dlg.exec() && dlg.selection() != null) + if (dlg.exec() and dlg.selection() != null) { val = dlg.selection(); return true; diff -r 5f822ad61875 -r d077dd19bf9a src/colors.cc --- a/src/colors.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/colors.cc Sun Jul 13 20:40:24 2014 +0300 @@ -59,13 +59,13 @@ void LDColor::addLDConfigColor (qint32 index, LDColor color) { - assert (index >= 0 && index < countof (g_LDConfigColors)); + assert (index >= 0 and index < countof (g_LDConfigColors)); g_LDConfigColors[index] = color; } LDColor LDColor::fromIndex (qint32 index) { - if (index < countof (g_LDConfigColors) && g_LDConfigColors[index] != null) + if (index < countof (g_LDConfigColors) and g_LDConfigColors[index] != null) return g_LDConfigColors[index]; if (index > 0x2000000) diff -r 5f822ad61875 -r d077dd19bf9a src/configDialog.cc --- a/src/configDialog.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/configDialog.cc Sun Jul 13 20:40:24 2014 +0300 @@ -397,7 +397,7 @@ ui->quickColorList->addItem (item); quickColorItems << item; - if (sel && &entry == sel) + if (sel and &entry == sel) { ui->quickColorList->setCurrentItem (item); ui->quickColorList->scrollToItem (item); @@ -477,7 +477,7 @@ int idx = getItemRow (item, quickColorItems); int dest = up ? (idx - 1) : (idx + 1); - if (dest < 0 || dest >= quickColorItems.size()) + if (dest < 0 or dest >= quickColorItems.size()) return; // destination out of bounds LDQuickColor tmp = quickColors[dest]; diff -r 5f822ad61875 -r d077dd19bf9a src/dialogs.cc --- a/src/dialogs.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/dialogs.cc Sun Jul 13 20:40:24 2014 +0300 @@ -154,7 +154,7 @@ void OverlayDialog::slot_dimensionsChanged() { - bool enable = (ui->width->value() != 0) || (ui->height->value() != 0); + bool enable = (ui->width->value() != 0) or (ui->height->value() != 0); ui->buttonBox->button (QDialogButtonBox::Ok)->setEnabled (enable); } diff -r 5f822ad61875 -r d077dd19bf9a src/editHistory.cc --- a/src/editHistory.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/editHistory.cc Sun Jul 13 20:40:24 2014 +0300 @@ -33,7 +33,7 @@ // void History::undo() { - if (m_changesets.isEmpty() || position() == -1) + if (m_changesets.isEmpty() or position() == -1) return; // Don't take the changes done here as actual edits to the document diff -r 5f822ad61875 -r d077dd19bf9a src/editmodes/abstractEditMode.cc --- a/src/editmodes/abstractEditMode.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/editmodes/abstractEditMode.cc Sun Jul 13 20:40:24 2014 +0300 @@ -89,7 +89,7 @@ if (Super::mouseReleased (data)) return true; - if ((data.releasedButtons & Qt::MidButton) && (_drawedVerts.size() < 4) && (not data.mouseMoved)) + if ((data.releasedButtons & Qt::MidButton) and (_drawedVerts.size() < 4) and (not data.mouseMoved)) { // Find the closest vertex to our cursor double minimumDistance = 1024.0; @@ -141,7 +141,7 @@ return true; } - if ((data.releasedButtons & Qt::RightButton) && (not _drawedVerts.isEmpty())) + if ((data.releasedButtons & Qt::RightButton) and (not _drawedVerts.isEmpty())) { // Remove the last vertex _drawedVerts.removeLast(); diff -r 5f822ad61875 -r d077dd19bf9a src/editmodes/circleMode.cc --- a/src/editmodes/circleMode.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/editmodes/circleMode.cc Sun Jul 13 20:40:24 2014 +0300 @@ -61,7 +61,7 @@ { if (transform[i] == 2) transform[i] = scale; - elif (transform[i] == 1 && renderer()->camera() >= 3) + elif (transform[i] == 1 and renderer()->camera() >= 3) transform[i] = -1; } @@ -88,7 +88,7 @@ transform = getCircleDrawMatrix (dist0); circleOrDisc = true; } - elif (dist0 == 0 || dist1 == 0) + elif (dist0 == 0 or dist1 == 0) { // If either radii is 0, use a disc. refFile = getDocument ("4-4disc.dat"); @@ -159,7 +159,7 @@ } } - if (circleOrDisc && refFile != null) + if (circleOrDisc and refFile != null) { LDSubfilePtr ref = spawn(); ref->setFileInfo (refFile); diff -r 5f822ad61875 -r d077dd19bf9a src/editmodes/magicWandMode.cc --- a/src/editmodes/magicWandMode.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/editmodes/magicWandMode.cc Sun Jul 13 20:40:24 2014 +0300 @@ -46,7 +46,7 @@ // of candidates. for (auto it = candidates.begin(); it != candidates.end(); ++it) { - if (not eq ((*it)->type(), OBJ_Line, OBJ_CondLine) || (*it)->vertex (0) == (*it)->vertex (1)) + if (not eq ((*it)->type(), OBJ_Line, OBJ_CondLine) or (*it)->vertex (0) == (*it)->vertex (1)) continue; int matches = 0; @@ -130,10 +130,10 @@ // If we're doing this on lines, we need exact type match. Surface types (quads and // triangles) can be mixed. Also don't consider self a candidate, and don't consider // objects we have already processed. - if ((candidate == obj) || - (candidate->color() != obj->color()) || - (_selection.contains (candidate)) || - (matchesneeded == 1 && (candidate->type() != objtype)) || + if ((candidate == obj) or + (candidate->color() != obj->color()) or + (_selection.contains (candidate)) or + (matchesneeded == 1 and (candidate->type() != objtype)) or ((candidate->numVertices() > 2) ^ (matchesneeded == 2))) { throw 0; @@ -160,7 +160,7 @@ // Check if a boundary gets in between the objects. for (auto boundary : boundaries) { - if (eq (matches[0], std::get<0> (boundary), std::get<1> (boundary)) && + if (eq (matches[0], std::get<0> (boundary), std::get<1> (boundary)) and eq (matches[1], std::get<0> (boundary), std::get<1> (boundary))) { throw 0; @@ -203,7 +203,7 @@ if (Super::mouseReleased (data)) return true; - if (data.releasedButtons & Qt::LeftButton && not data.mouseMoved) + if (data.releasedButtons & Qt::LeftButton and not data.mouseMoved) { MagicType wandtype = MagicWandMode::Set; diff -r 5f822ad61875 -r d077dd19bf9a src/editmodes/selectMode.cc --- a/src/editmodes/selectMode.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/editmodes/selectMode.cc Sun Jul 13 20:40:24 2014 +0300 @@ -64,7 +64,7 @@ if (not _rangepick) _addpick = (data.keymods & Qt::ControlModifier); - if (not data.mouseMoved || _rangepick) + if (not data.mouseMoved or _rangepick) { QRect area; int const mx = data.ev->x(); diff -r 5f822ad61875 -r d077dd19bf9a src/extPrograms.cc --- a/src/extPrograms.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/extPrograms.cc Sun Jul 13 20:40:24 2014 +0300 @@ -120,7 +120,7 @@ ExtProgPathPrompt* dlg = new ExtProgPathPrompt (g_extProgNames[prog]); - if (dlg->exec() && not dlg->getPath().isEmpty()) + if (dlg->exec() and not dlg->getPath().isEmpty()) { path = dlg->getPath(); return true; @@ -221,7 +221,7 @@ for (LDObjectPtr obj : getCurrentDocument()->objects()) { - if (not obj->isColored() || obj->color() != color) + if (not obj->isColored() or obj->color() != color) continue; objects << obj; @@ -364,7 +364,7 @@ QString inDATName, outDATName; // Make temp files for the input and output files - if (not mkTempFile (indat, inDATName) || not mkTempFile (outdat, outDATName)) + if (not mkTempFile (indat, inDATName) or not mkTempFile (outdat, outDATName)) return; // Compose the command-line arguments @@ -408,7 +408,7 @@ QString inDATName, outDATName; // Make temp files for the input and output files - if (not mkTempFile (indat, inDATName) || not mkTempFile (outdat, outDATName)) + if (not mkTempFile (indat, inDATName) or not mkTempFile (outdat, outDATName)) return; // Compose arguments @@ -481,10 +481,10 @@ QTemporaryFile indat, cutdat, outdat, outdat2, edgesdat; QString inDATName, cutDATName, outDATName, outDAT2Name, edgesDATName; - if (not mkTempFile (indat, inDATName) || - not mkTempFile (cutdat, cutDATName) || - not mkTempFile (outdat, outDATName) || - not mkTempFile (outdat2, outDAT2Name) || + if (not mkTempFile (indat, inDATName) or + not mkTempFile (cutdat, cutDATName) or + not mkTempFile (outdat, outDATName) or + not mkTempFile (outdat2, outDAT2Name) or not mkTempFile (edgesdat, edgesDATName)) { return; @@ -522,10 +522,10 @@ insertOutput (outDATName, false, {inCol}); - if (repeatInverse && runUtilityProcess (Intersector, cfg::intersectorPath, argv_inverse)) + if (repeatInverse and runUtilityProcess (Intersector, cfg::intersectorPath, argv_inverse)) insertOutput (outDAT2Name, false, {cutCol}); - if (ui.cb_edges->isChecked() && checkProgPath (Isecalc) && + if (ui.cb_edges->isChecked() and checkProgPath (Isecalc) and runUtilityProcess (Isecalc, cfg::isecalcPath, join ( {inDATName, cutDATName, edgesDATName}))) { insertOutput (edgesDATName, false, {}); @@ -569,8 +569,8 @@ QTemporaryFile in1dat, in2dat, outdat; QString in1DATName, in2DATName, outDATName; - if (not mkTempFile (in1dat, in1DATName) || - not mkTempFile (in2dat, in2DATName) || + if (not mkTempFile (in1dat, in1DATName) or + not mkTempFile (in2dat, in2DATName) or not mkTempFile (outdat, outDATName)) { return; @@ -635,8 +635,8 @@ QTemporaryFile in1dat, in2dat, outdat; QString in1DATName, in2DATName, outDATName; - if (not mkTempFile (in1dat, in1DATName) || - not mkTempFile (in2dat, in2DATName) || + if (not mkTempFile (in1dat, in1DATName) or + not mkTempFile (in2dat, in2DATName) or not mkTempFile (outdat, outDATName)) { return; @@ -674,7 +674,7 @@ QTemporaryFile in, out; QString inName, outName; - if (not mkTempFile (in, inName) || not mkTempFile (out, outName)) + if (not mkTempFile (in, inName) or not mkTempFile (out, outName)) return; int unmatched = ui.unmatched->currentIndex(); diff -r 5f822ad61875 -r d077dd19bf9a src/glCompiler.cc --- a/src/glCompiler.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/glCompiler.cc Sun Jul 13 20:40:24 2014 +0300 @@ -180,7 +180,7 @@ { // The color was unknown. Use main color to make the polygon at least // not appear pitch-black. - if (poly.num != 2 && poly.num != 5) + if (poly.num != 2 and poly.num != 5) qcol = GLRenderer::getMainColor(); else qcol = Qt::black; @@ -280,7 +280,7 @@ { if (it.key() == null) it = m_objectInfo.erase (it); - elif (it.key().toStrongRef()->document() == getCurrentDocument() && not it.key().toStrongRef()->isHidden()) + elif (it.key().toStrongRef()->document() == getCurrentDocument() and not it.key().toStrongRef()->isHidden()) vbodata += it->data[vbonum]; } @@ -313,7 +313,7 @@ { // print ("Compile %1\n", g_objectOrigins[obj]); - if (obj == null || obj->document() == null || obj->document().toStrongRef()->isImplicit()) + if (obj == null or obj->document() == null or obj->document().toStrongRef()->isImplicit()) return; ObjectVBOInfo info; diff -r 5f822ad61875 -r d077dd19bf9a src/glRenderer.cc --- a/src/glRenderer.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/glRenderer.cc Sun Jul 13 20:40:24 2014 +0300 @@ -360,7 +360,7 @@ zoomAllToFit(); } - if (cfg::drawWireframe && not isPicking()) + if (cfg::drawWireframe and not isPicking()) glPolygonMode (GL_FRONT_AND_BACK, GL_LINE); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -375,7 +375,7 @@ glOrtho (-m_virtWidth, m_virtWidth, -m_virtHeight, m_virtHeight, -100.0f, 100.0f); glTranslatef (pan (X), pan (Y), 0.0f); - if (camera() != EFrontCamera && camera() != EBackCamera) + if (camera() != EFrontCamera and camera() != EBackCamera) { glRotatef (90.0f, g_FixedCameras[camera()].glrotate[0], g_FixedCameras[camera()].glrotate[1], @@ -470,9 +470,9 @@ void GLRenderer::drawVBOs (EVBOSurface surface, EVBOComplement colors, GLenum type) { // Filter this through some configuration options - if ((eq (surface, VBOSF_Quads, VBOSF_Triangles) && cfg::drawSurfaces == false) || - (surface == VBOSF_Lines && cfg::drawEdgeLines == false) || - (surface == VBOSF_CondLines && cfg::drawConditionalLines == false)) + if ((eq (surface, VBOSF_Quads, VBOSF_Triangles) and cfg::drawSurfaces == false) or + (surface == VBOSF_Lines and cfg::drawEdgeLines == false) or + (surface == VBOSF_CondLines and cfg::drawConditionalLines == false)) { return; } @@ -610,7 +610,7 @@ } #endif - if (camera() != EFreeCamera && not isPicking()) + if (camera() != EFreeCamera and not isPicking()) { // Paint the overlay image if we have one const LDGLOverlay& overlay = currentDocumentData().overlays[camera()]; @@ -648,7 +648,7 @@ for (CameraIcon& info : m_cameraIcons) { // Don't draw the free camera icon when in draw mode - if (&info == &m_cameraIcons[EFreeCamera] && not m_editmode->allowFreeCamera()) + if (&info == &m_cameraIcons[EFreeCamera] and not m_editmode->allowFreeCamera()) continue; paint.drawPixmap (info.destRect, *info.img, info.srcRect); @@ -723,7 +723,7 @@ // void GLRenderer::mouseReleaseEvent (QMouseEvent* ev) { - const bool wasLeft = (m_lastButtons & Qt::LeftButton) && not (ev->buttons() & Qt::LeftButton); + const bool wasLeft = (m_lastButtons & Qt::LeftButton) and not (ev->buttons() & Qt::LeftButton); Qt::MouseButtons releasedbuttons = m_lastButtons & ~ev->buttons(); @@ -789,14 +789,14 @@ mid = ev->buttons() & Qt::MidButton, shift = ev->modifiers() & Qt::ShiftModifier; - if (mid || (left && shift)) + if (mid or (left and shift)) { pan (X) += 0.03f * dx * (zoom() / 7.5f); pan (Y) -= 0.03f * dy * (zoom() / 7.5f); m_panning = true; setCameraMoving (true); } - elif (left && camera() == EFreeCamera) + elif (left and camera() == EFreeCamera) { rot (X) = rot (X) + dy; rot (Y) = rot (Y) + dx; @@ -872,7 +872,7 @@ void GLRenderer::setCamera (const ECamera cam) { // The edit mode may forbid the free camera. - if (cam == EFreeCamera && not m_editmode->allowFreeCamera()) + if (cam == EFreeCamera and not m_editmode->allowFreeCamera()) return; m_camera = cam; @@ -1003,14 +1003,14 @@ // void GLRenderer::setEditMode (EditModeType a) { - if (m_editmode != null && m_editmode->type() == a) + if (m_editmode != null and m_editmode->type() == a) return; delete m_editmode; m_editmode = AbstractEditMode::createByType (this, a); // If we cannot use the free camera, use the top one instead. - if (camera() == EFreeCamera && not m_editmode->allowFreeCamera()) + if (camera() == EFreeCamera and not m_editmode->allowFreeCamera()) setCamera (ETopCamera); g_win->updateEditModeActions(); @@ -1285,7 +1285,7 @@ { zoom() = 30.0f; - if (document() == null || m_width == -1 || m_height == -1) + if (document() == null or m_width == -1 or m_height == -1) return; bool lastfilled = false; @@ -1304,7 +1304,7 @@ while (--runaway) { - if (zoom() > 10000.0 || zoom() < 0.0) + if (zoom() > 10000.0 or zoom() < 0.0) { // Obviously, there's nothing to draw if we get here. // Default to 30.0f and break out. @@ -1323,7 +1323,7 @@ // Check the top and bottom rows for (int i = 0; i < w; ++i) { - if (imgdata[i] != white || imgdata[((h - 1) * w) + i] != white) + if (imgdata[i] != white or imgdata[((h - 1) * w) + i] != white) { filled = true; break; @@ -1335,7 +1335,7 @@ { for (int i = 0; i < h; ++i) { - if (imgdata[i * w] != white || imgdata[(i * w) + w - 1] != white) + if (imgdata[i * w] != white or imgdata[(i * w) + w - 1] != white) { filled = true; break; @@ -1357,7 +1357,7 @@ { // If this run filled the screen and the last one did not, the // last run had ideal zoom - zoom a bit back and we should reach it. - if (filled && not lastfilled) + if (filled and not lastfilled) { zoomNotch (false); break; @@ -1365,7 +1365,7 @@ // If this run did not fill the screen and the last one did, we've // now reached ideal zoom so we're done here. - if (not filled && lastfilled) + if (not filled and lastfilled) break; inward = not filled; @@ -1409,7 +1409,7 @@ { LDOverlayPtr ovlobj = obj.dynamicCast(); - if (ovlobj != null && obj.staticCast()->camera() == cam) + if (ovlobj != null and obj.staticCast()->camera() == cam) return ovlobj; } @@ -1430,13 +1430,13 @@ LDGLOverlay& meta = currentDocumentData().overlays[cam]; LDOverlayPtr ovlobj = findOverlayObject (cam); - if (ovlobj == null && meta.img != null) + if (ovlobj == null and meta.img != null) { delete meta.img; meta.img = null; } - elif (ovlobj != null && - (meta.img == null || meta.fname != ovlobj->fileName()) && + elif (ovlobj != null and + (meta.img == null or meta.fname != ovlobj->fileName()) and not meta.invalid) { setupOverlay (cam, ovlobj->fileName(), ovlobj->x(), @@ -1457,19 +1457,19 @@ LDGLOverlay& meta = currentDocumentData().overlays[cam]; LDOverlayPtr ovlobj = findOverlayObject (cam); - if (meta.img == null && ovlobj != null) + if (meta.img == null and ovlobj != null) { // If this is the last overlay image, we need to remove the empty space after it as well. LDObjectPtr nextobj = ovlobj->next(); - if (nextobj && nextobj->type() == OBJ_Empty) + if (nextobj and nextobj->type() == OBJ_Empty) nextobj->destroy(); // If the overlay object was there and the overlay itself is // not, remove the object. ovlobj->destroy(); } - elif (meta.img != null && ovlobj == null) + elif (meta.img != null and ovlobj == null) { // Inverse case: image is there but the overlay object is // not, thus create the object. @@ -1509,7 +1509,7 @@ } } - if (meta.img != null && ovlobj != null) + if (meta.img != null and ovlobj != null) { ovlobj->setCamera (cam); ovlobj->setFileName (meta.fname); @@ -1528,14 +1528,14 @@ // void GLRenderer::highlightCursorObject() { - if (not cfg::highlightObjectBelowCursor && objectAtCursor() == null) + if (not cfg::highlightObjectBelowCursor and objectAtCursor() == null) return; LDObjectWeakPtr newObject; LDObjectWeakPtr oldObject = objectAtCursor(); qint32 newIndex; - if (isCameraMoving() || not cfg::highlightObjectBelowCursor) + if (isCameraMoving() or not cfg::highlightObjectBelowCursor) { newIndex = 0; } @@ -1569,13 +1569,13 @@ void GLRenderer::dragEnterEvent (QDragEnterEvent* ev) { - if (g_win != null && ev->source() == g_win->getPrimitivesTree() && g_win->getPrimitivesTree()->currentItem() != null) + if (g_win != null and ev->source() == g_win->getPrimitivesTree() and g_win->getPrimitivesTree()->currentItem() != null) ev->acceptProposedAction(); } void GLRenderer::dropEvent (QDropEvent* ev) { - if (g_win != null && ev->source() == g_win->getPrimitivesTree()) + if (g_win != null and ev->source() == g_win->getPrimitivesTree()) { QString primName = static_cast (g_win->getPrimitivesTree()->currentItem())->primitive()->name; LDSubfilePtr ref = spawn(); diff -r 5f822ad61875 -r d077dd19bf9a src/ldConfig.cc --- a/src/ldConfig.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/ldConfig.cc Sun Jul 13 20:40:24 2014 +0300 @@ -56,7 +56,7 @@ { QString line = QString::fromUtf8 (fp->readLine()); - if (line.isEmpty() || line[0] != '0') + if (line.isEmpty() or line[0] != '0') continue; // empty or illogical line.remove ('\r'); @@ -69,8 +69,8 @@ QString name, facename, edgename, valuestr; // Check 0 !COLOUR, parse the name - if (not pars.tokenCompare (0, "0") || - not pars.tokenCompare (1, "!COLOUR") || + if (not pars.tokenCompare (0, "0") or + not pars.tokenCompare (1, "!COLOUR") or not pars.getToken (name, 2)) { continue; @@ -87,18 +87,18 @@ bool ok; code = valuestr.toShort (&ok); - if (not ok || code < 0 || code >= 512) + if (not ok or code < 0 or code >= 512) continue; // VALUE and EDGE tags - if (not parseLDConfigTag (pars, "VALUE", facename) || not parseLDConfigTag (pars, "EDGE", edgename)) + if (not parseLDConfigTag (pars, "VALUE", facename) or not parseLDConfigTag (pars, "EDGE", edgename)) continue; // Ensure that our colors are correct QColor faceColor (facename), edgeColor (edgename); - if (not faceColor.isValid() || not edgeColor.isValid()) + if (not faceColor.isValid() or not edgeColor.isValid()) continue; // Parse alpha if given. diff -r 5f822ad61875 -r d077dd19bf9a src/ldDocument.cc --- a/src/ldDocument.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/ldDocument.cc Sun Jul 13 20:40:24 2014 +0300 @@ -192,7 +192,7 @@ LDSubfilePtr ref = obj.toStrongRef().dynamicCast(); - if (ref != null && ref->fileInfo() == self()) + if (ref != null and ref->fileInfo() == self()) count++; } } @@ -202,7 +202,7 @@ // If the current document just became implicit (e.g. it was 'closed'), // we need to get a new current document. - if (current() == self() && isImplicit()) + if (current() == self() and isImplicit()) { if (explicitDocuments().isEmpty()) newFile(); @@ -225,7 +225,7 @@ { for (LDDocumentWeakPtr file : g_allDocuments) { - if (file != null && file.toStrongRef()->name() == name) + if (file != null and file.toStrongRef()->name() == name) return file.toStrongRef(); } @@ -295,7 +295,7 @@ for (QString s : g_specialSubdirectories) { - if ((proptop == s && reltop != s) || (reltop == s && proptop != s)) + if ((proptop == s and reltop != s) or (reltop == s and proptop != s)) { bogus = true; break; @@ -408,14 +408,14 @@ // Parse up to 300 lines per iteration int max = i + 300; - for (; i < max && i < (int) lines().size(); ++i) + for (; i < max and i < (int) lines().size(); ++i) { QString line = lines()[i]; // Trim the trailing newline QChar c; - while (line.endsWith ("\n") || line.endsWith ("\r")) + while (line.endsWith ("\n") or line.endsWith ("\r")) line.chop (1); LDObjectPtr obj = parseLine (line); @@ -699,7 +699,7 @@ // We cannot open this file if the document this would replace is not // safe to close. - if (documentToReplace != null && not documentToReplace->isSafeToClose()) + if (documentToReplace != null and not documentToReplace->isSafeToClose()) return; g_loadingMainFile = true; @@ -755,7 +755,7 @@ // If the second object in the list holds the file name, update that now. LDObjectPtr nameObject = getObject (1); - if (nameObject != null && nameObject->type() == OBJ_Comment) + if (nameObject != null and nameObject->type() == OBJ_Comment) { LDCommentPtr nameComment = nameObject.staticCast(); @@ -838,7 +838,7 @@ tokens[i].toDouble (&ok); // Also check scientific notation, e.g. 7.99361e-15 - if (not ok && not scient.exactMatch (tokens[i])) + if (not ok and not scient.exactMatch (tokens[i])) { throw QString (format ("Token #%1 was `%2`, expected a number (matched length: %3)", (i + 1), tokens[i], scient.matchedLength())); @@ -887,7 +887,7 @@ return spawn(); } - if (tokens[0].length() != 1 || not tokens[0][0].isDigit()) + if (tokens[0].length() != 1 or not tokens[0][0].isDigit()) throw QString ("Illogical line code"); int num = tokens[0][0].digitValue(); @@ -901,7 +901,7 @@ QString commentTextSimplified (commentText.simplified()); // Handle BFC statements - if (tokens.size() > 2 && tokens[1] == "BFC") + if (tokens.size() > 2 and tokens[1] == "BFC") { for (int i = 0; i < LDBFC::NumStatements; ++i) if (commentTextSimplified == format ("BFC %1", LDBFC::k_statementStrings [i])) @@ -918,7 +918,7 @@ return spawn (LDBFC::NoClip); } - if (tokens.size() > 2 && tokens[1] == "!LDFORGE") + if (tokens.size() > 2 and tokens[1] == "!LDFORGE") { // Handle LDForge-specific types, they're embedded into comments too if (tokens[2] == "VERTEX") @@ -1163,7 +1163,7 @@ obj->deselect(); assert (m_objects[idx] == obj); - if (not isImplicit() && not (flags() & DOCF_IsBeingDestroyed)) + if (not isImplicit() and not (flags() & DOCF_IsBeingDestroyed)) { history()->add (new DelHistory (idx, obj)); _objectVertices.remove (obj); @@ -1190,7 +1190,7 @@ // void LDDocument::setObject (int idx, LDObjectPtr obj) { - assert (idx >= 0 && idx < m_objects.size()); + assert (idx >= 0 and idx < m_objects.size()); // Mark this change to history if (not m_history->isIgnoring()) @@ -1231,7 +1231,7 @@ // bool LDDocument::hasUnsavedChanges() const { - return not isImplicit() && history()->position() != savePosition(); + return not isImplicit() and history()->position() != savePosition(); } // ============================================================================= @@ -1313,14 +1313,14 @@ // Possibly substitute with logoed studs: // stud.dat -> stud-logo.dat // stud2.dat -> stud-logo2.dat - if (cfg::useLogoStuds && renderinline) + if (cfg::useLogoStuds and renderinline) { // Ensure logoed studs are loaded first loadLogoedStuds(); - if (name() == "stud.dat" && g_logoedStud != null) + if (name() == "stud.dat" and g_logoedStud != null) return g_logoedStud->inlineContents (deep, renderinline); - elif (name() == "stud2.dat" && g_logoedStud2 != null) + elif (name() == "stud2.dat" and g_logoedStud2 != null) return g_logoedStud2->inlineContents (deep, renderinline); } @@ -1334,7 +1334,7 @@ // Got another sub-file reference, inline it if we're deep-inlining. If not, // just add it into the objects normally. Yay, recursion! - if (deep == true && obj->type() == OBJ_Subfile) + if (deep == true and obj->type() == OBJ_Subfile) { for (LDObjectPtr otherobj : obj.staticCast()->inlineContents (deep, renderinline)) objs << otherobj; @@ -1363,12 +1363,12 @@ { // Implicit files were loaded for caching purposes and must never be set // current. - if (f != null && f->isImplicit()) + if (f != null and f->isImplicit()) return; g_currentDocument = f; - if (g_win && f) + if (g_win and f) { // A ton of stuff needs to be updated g_win->updateDocumentListItem (f); @@ -1393,9 +1393,9 @@ // ============================================================================= void LDDocument::closeInitialFile() { - if (g_explicitDocuments.size() == 2 && - g_explicitDocuments[0]->name().isEmpty() && - not g_explicitDocuments[1]->name().isEmpty() && + if (g_explicitDocuments.size() == 2 and + g_explicitDocuments[0]->name().isEmpty() and + not g_explicitDocuments[1]->name().isEmpty() and not g_explicitDocuments[0]->hasUnsavedChanges()) { g_explicitDocuments[0]->dismiss(); @@ -1406,7 +1406,7 @@ // void loadLogoedStuds() { - if (g_logoedStud && g_logoedStud2) + if (g_logoedStud and g_logoedStud2) return; g_logoedStud = openDocument ("stud-logo.dat", true, true); @@ -1464,7 +1464,7 @@ { int a = m_objects.indexOf (one); int b = m_objects.indexOf (other); - assert (a != b && a != -1 && b != -1); + assert (a != b and a != -1 and b != -1); m_objects[b] = one; m_objects[a] = other; addToHistory (new SwapHistory (one->id(), other->id())); diff -r 5f822ad61875 -r d077dd19bf9a src/ldObject.cc --- a/src/ldObject.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/ldObject.cc Sun Jul 13 20:40:24 2014 +0300 @@ -461,7 +461,7 @@ const long idx = obj->lineNumber(), target = idx + (up ? -1 : 1); - if ((up && idx == 0) || (not up && idx == (long) file->objects().size() - 1l)) + if ((up and idx == 0) or (not up and idx == (long) file->objects().size() - 1l)) { // One of the objects hit the extrema. If this happens, this should be the first // object to be iterated on. Thus, nothing has changed yet and it's safe to just @@ -517,7 +517,7 @@ QString noun = format ("%1%2", typeName (objType), plural (count)); // Plural of "vertex" is "vertices", correct that - if (objType == OBJ_Vertex && count != 1) + if (objType == OBJ_Vertex and count != 1) noun = "vertices"; text += format ("%1 %2", count, noun); @@ -573,7 +573,7 @@ { LDObjectPtr prev (previous()); - if (prev != null && prev->type() == OBJ_BFC && prev.staticCast()->statement() == LDBFC::InvertNext) + if (prev != null and prev->type() == OBJ_BFC and prev.staticCast()->statement() == LDBFC::InvertNext) { ptr = prev.staticCast(); return true; @@ -675,13 +675,13 @@ { Vertex const& vrt = obj->vertex (i); - if (axisSet & (1 << X) && vrt.x() != 0.0) + if (axisSet & (1 << X) and vrt.x() != 0.0) axisSet &= ~(1 << X); - if (axisSet & (1 << Y) && vrt.y() != 0.0) + if (axisSet & (1 << Y) and vrt.y() != 0.0) axisSet &= ~(1 << Y); - if (axisSet & (1 << Z) && vrt.z() != 0.0) + if (axisSet & (1 << Z) and vrt.z() != 0.0) axisSet &= ~(1 << Z); } @@ -715,7 +715,7 @@ { LDBFCPtr bfc = previous().dynamicCast(); - if (not bfc.isNull() && bfc->statement() == LDBFC::InvertNext) + if (not bfc.isNull() and bfc->statement() == LDBFC::InvertNext) { // This is prefixed with an invertnext, thus remove it. bfc->destroy(); @@ -801,7 +801,7 @@ if (*ptr == val) return; - if (obj->document() != null && (idx = obj->lineNumber()) != -1) + if (obj->document() != null and (idx = obj->lineNumber()) != -1) { QString before = obj->asText(); *ptr = val; @@ -920,8 +920,8 @@ // If it's an immediate subfile reference (i.e. this subfile belongs in an // explicit file), we need to pre-compile the GL polygons for the document // if they don't exist already. - if (a != null && - a->isImplicit() == false && + if (a != null and + a->isImplicit() == false and a->polygonData().isEmpty()) { a->initializeCachedData(); diff -r 5f822ad61875 -r d077dd19bf9a src/mainWindow.cc --- a/src/mainWindow.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/mainWindow.cc Sun Jul 13 20:40:24 2014 +0300 @@ -253,7 +253,7 @@ title += ": "; title += getCurrentDocument()->getDisplayName(); - if (getCurrentDocument()->getObjectCount() > 0 && + if (getCurrentDocument()->getObjectCount() > 0 and getCurrentDocument()->getObject (0)->type() == OBJ_Comment) { // Append title @@ -410,8 +410,8 @@ item->setBackground (QColor ("#AA0000")); item->setForeground (QColor ("#FFAA00")); } - elif (cfg::colorizeObjectsList && obj->isColored() && - obj->color() != null && obj->color() != maincolor() && obj->color() != edgecolor()) + elif (cfg::colorizeObjectsList and obj->isColored() and + obj->color() != null and obj->color() != maincolor() and obj->color() != edgecolor()) { // If the object isn't in the main or edge color, draw this // list entry in said color. @@ -442,7 +442,7 @@ // void MainWindow::slot_selectionChanged() { - if (g_isSelectionLocked == true || getCurrentDocument() == null) + if (g_isSelectionLocked == true or getCurrentDocument() == null) return; LDObjectList priorSelection = selection(); @@ -575,7 +575,7 @@ if (not obj->isColored()) continue; // doesn't use color - if (result != null && obj->color() != result) + if (result != null and obj->color() != result) return null; // No consensus in object color if (result == null) @@ -623,7 +623,7 @@ QMenu* contextMenu = new QMenu; - if (single && singleObj->type() != OBJ_Empty) + if (single and singleObj->type() != OBJ_Empty) { contextMenu->addAction (ui->actionEdit); contextMenu->addSeparator(); @@ -677,7 +677,7 @@ for (LDObjectPtr obj : getCurrentDocument()->objects()) { - if (not obj->isColored() || obj->color() != color) + if (not obj->isColored() or obj->color() != color) continue; objs << obj; @@ -719,7 +719,7 @@ QString path = doc->fullPath(); int64 savesize; - if (saveAs || path.isEmpty()) + if (saveAs or path.isEmpty()) { QString name = doc->defaultName(); @@ -845,7 +845,7 @@ for (LDObjectPtr obj : getCurrentDocument()->objects()) { - if (not obj->isColored() || obj->color() == null) + if (not obj->isColored() or obj->color() == null) continue; if (counts.find (obj->color()) == counts.end()) @@ -941,7 +941,7 @@ // If we picked the same file we're currently on, we don't need to do // anything. - if (f == null || f == getCurrentDocument()) + if (f == null or f == getCurrentDocument()) return; LDDocument::setCurrent (f); @@ -967,7 +967,7 @@ // void MainWindow::updateActions() { - if (getCurrentDocument() != null && getCurrentDocument()->history() != null) + if (getCurrentDocument() != null and getCurrentDocument()->history() != null) { History* his = getCurrentDocument()->history(); int pos = his->position(); diff -r 5f822ad61875 -r d077dd19bf9a src/messageLog.cc --- a/src/messageLog.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/messageLog.cc Sun Jul 13 20:40:24 2014 +0300 @@ -105,7 +105,7 @@ changed |= lineChanged; } - if (changed && renderer()) + if (changed and renderer()) renderer()->update(); } diff -r 5f822ad61875 -r d077dd19bf9a src/misc/ringFinder.cc --- a/src/misc/ringFinder.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/misc/ringFinder.cc Sun Jul 13 20:40:24 2014 +0300 @@ -78,7 +78,7 @@ Solution sol = currentSolution; m_stack++; - bool res = findRingsRecursor (r0, r, sol) && findRingsRecursor (r, r1, sol); + bool res = findRingsRecursor (r0, r, sol) and findRingsRecursor (r, r1, sol); m_stack--; if (res) @@ -130,12 +130,12 @@ // components. double scale = 1.0; - if (not isZero (scale = r0 - floor (r0)) || not isZero (scale = r1 - floor (r1))) + if (not isZero (scale = r0 - floor (r0)) or not isZero (scale = r1 - floor (r1))) { double r0f = r0 / scale; double r1f = r1 / scale; - if (qFuzzyCompare (floor (r0f), r0f) && qFuzzyCompare (floor (r1f), r1f)) + if (qFuzzyCompare (floor (r0f), r0f) and qFuzzyCompare (floor (r1f), r1f)) { r0 = r0f; r1 = r1f; @@ -162,7 +162,7 @@ for (Solution const& sol : m_solutions) { - if (m_bestSolution == null || sol.isSuperiorTo (m_bestSolution)) + if (m_bestSolution == null or sol.isSuperiorTo (m_bestSolution)) m_bestSolution = / } diff -r 5f822ad61875 -r d077dd19bf9a src/miscallenous.cc --- a/src/miscallenous.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/miscallenous.cc Sun Jul 13 20:40:24 2014 +0300 @@ -150,10 +150,10 @@ { int const prime = g_primes[x]; - if (numer < prime && denom < prime) + if (numer < prime and denom < prime) break; - if ((numer % prime == 0) && (denom % prime == 0)) + if ((numer % prime == 0) and (denom % prime == 0)) { numer /= prime; denom /= prime; @@ -256,7 +256,7 @@ // void roundToDecimals (double& a, int decimals) { - assert (decimals >= 0 && decimals < (signed) (sizeof g_e10 / sizeof *g_e10)); + assert (decimals >= 0 and decimals < (signed) (sizeof g_e10 / sizeof *g_e10)); a = round (a * g_e10[decimals]) / g_e10[decimals]; } diff -r 5f822ad61875 -r d077dd19bf9a src/partDownloader.cc --- a/src/partDownloader.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/partDownloader.cc Sun Jul 13 20:40:24 2014 +0300 @@ -42,7 +42,7 @@ { QString path = getDownloadPath(); - if (path.isEmpty() || not QDir (path).exists()) + if (path.isEmpty() or not QDir (path).exists()) { critical (PartDownloader::tr ("You need to specify a valid path for " "downloaded files in the configuration to download paths.")); @@ -133,7 +133,7 @@ // typo in the .dat extension. const int dotpos = dest.lastIndexOf ("."); - if (dotpos != -1 && dotpos >= dest.length() - 4) + if ((dotpos != -1) and (dotpos >= dest.length() - 4)) dest.chop (dest.length() - dotpos); dest += ".dat"; @@ -175,7 +175,7 @@ dest.prepend ("parts/s/"); elif (QRegExp (partRegex).exactMatch (dest)) dest.prepend ("parts/"); - elif (not dest.startsWith ("parts/") && not dest.startsWith ("p/")) + elif (not dest.startsWith ("parts/") and not dest.startsWith ("p/")) dest.prepend ("p/"); } @@ -289,7 +289,7 @@ g_win->R()->resetAngles(); } - if (cfg::autoCloseDownloadDialog && not failed) + if (cfg::autoCloseDownloadDialog and not failed) { // Close automatically if desired. accept(); @@ -419,7 +419,7 @@ { if (networkReply()->error() != QNetworkReply::NoError) { - if (isPrimary() && not prompt()->isAborted()) + if (isPrimary() and not prompt()->isAborted()) critical (networkReply()->errorString()); setState (DLRQ_Failed); @@ -460,7 +460,7 @@ { LDErrorPtr err = obj.dynamicCast(); - if (err == null || err->fileReferenced().isEmpty()) + if ((err == null) or (err->fileReferenced().isEmpty())) continue; QString dest = err->fileReferenced(); diff -r 5f822ad61875 -r d077dd19bf9a src/primitives.cc --- a/src/primitives.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/primitives.cc Sun Jul 13 20:40:24 2014 +0300 @@ -306,12 +306,12 @@ if (line.endsWith ("\n")) line.chop (1); - if (line.length() == 0 || line[0] == '#') + if (line.length() == 0 or line[0] == '#') continue; if ((colon = line.indexOf (":")) == -1) { - if (cat && cat->isValidToInclude()) + if (cat and cat->isValidToInclude()) g_PrimitiveCategories << cat; cat = new PrimitiveCategory (line); @@ -475,7 +475,7 @@ objs << quad; - if (type == Cylinder || type == Cone) + if (type == Cylinder or type == Cone) condLineSegs << i; } break; @@ -510,7 +510,7 @@ // If this is not a full circle, we need a conditional line at the other // end, too. - if (segs < divs && condLineSegs.size() != 0) + if (segs < divs and condLineSegs.size() != 0) condLineSegs << segs; for (int i : condLineSegs) @@ -577,7 +577,7 @@ QString prefix = (divs == g_lores) ? "" : format ("%1/", divs); QString frac = format ("%1-%2", numer, denom); QString root = g_radialNameRoots[type]; - QString numstr = (type == Ring || type == Cone) ? format ("%1", num) : ""; + QString numstr = (type == Ring or type == Cone) ? format ("%1", num) : ""; // Truncate the root if necessary (7-16rin4.dat for instance). // However, always keep the root at least 2 characters. @@ -601,7 +601,7 @@ if (frac.indexOf (".") == -1) frac += ".0"; - if (type == Ring || type == Cone) + if (type == Ring or type == Cone) { QString spacing = (num < 10) ? " " : @@ -682,7 +682,7 @@ // If the current value is 16 and we switch to hi-res, default the // spinbox to 48. - if (on && ui->sb_segs->value() == g_lores) + if (on and ui->sb_segs->value() == g_lores) ui->sb_segs->setValue (g_hires); } diff -r 5f822ad61875 -r d077dd19bf9a src/version.cc --- a/src/version.cc Sun Jul 13 20:28:52 2014 +0300 +++ b/src/version.cc Sun Jul 13 20:40:24 2014 +0300 @@ -52,7 +52,7 @@ { if (g_fullVersionString[0] == '\0') { -#if BUILD_ID != BUILD_RELEASE && defined (SVN_REVISION_STRING) +#if BUILD_ID != BUILD_RELEASE and defined (SVN_REVISION_STRING) sprintf (g_fullVersionString, "%s-" SVN_REVISION_STRING, versionString()); #else sprintf (g_fullVersionString, "%s", versionString());