# HG changeset patch # User Santeri Piippo # Date 1386356808 -7200 # Node ID a52cfa218780b1a60a0fd7dd9c2001bb0b9f55ed # Parent 7029f7938dae88b67ea6de602d11a1d30805a916 minor cleanup diff -r 7029f7938dae -r a52cfa218780 src/gldraw.cpp --- a/src/gldraw.cpp Fri Dec 06 20:54:34 2013 +0200 +++ b/src/gldraw.cpp Fri Dec 06 21:06:48 2013 +0200 @@ -1433,7 +1433,9 @@ elif (g_RingFinder (dist0, dist1)) { // The ring finder found a solution, use that. Add the component rings to the file. for (const RingFinder::Component& cmp : g_RingFinder.bestSolution()->getComponents()) - { if ((refFile = ::getFile (radialFileName (::Ring, lores, lores, cmp.num))) == null) + { // Get a ref file for this primitive. If we cannot find it in the + // LDraw library, generate it. + if ((refFile = ::getFile (radialFileName (::Ring, lores, lores, cmp.num))) == null) { refFile = generatePrimitive (::Ring, lores, lores, cmp.num); refFile->setImplicit (false); } @@ -1447,7 +1449,7 @@ } } else - { // Last resort: draw the ring with quads + { // Ring finder failed, last resort: draw the ring with quads QList c0, c1; Axis relX, relY, relZ; getRelativeAxes (relX, relY); @@ -1498,7 +1500,8 @@ } break; case Select: - { assert (false); + { // this shouldn't happen + assert (false); return; } break; } diff -r 7029f7938dae -r a52cfa218780 src/misc.cpp --- a/src/misc.cpp Fri Dec 06 20:54:34 2013 +0200 +++ b/src/misc.cpp Fri Dec 06 21:06:48 2013 +0200 @@ -284,11 +284,7 @@ // as it would fall into an infinite recursion. // ----------------------------------------------------------------------------- bool RingFinder::findRingsRecursor (double r0, double r1, Solution& currentSolution) -{ char tabs[64]; - memset (tabs, '\t', m_stack); - tabs[m_stack] = '\0'; - - // Don't recurse too deep. +{ // Don't recurse too deep. if (m_stack >= 5) return false;