Into

Modules

Documentation

Indentation

Indentation may be the most common flavor of holy wars when it comes to programming style, and that is why we start with it. Since the other holy war is over and the default indentation style in Emacs is the GNU style, the winner of the indentation holy war is clear. Here's what Into code looks like:

bool PiiOperationCompound::wait(unsigned long time)
{
  if (time == ULONG_MAX)
    {
      for (int i=_lstOperations.size(); i--; )
        _lstOperations[i]->wait(time);
      return true;
    }
  else
    {
      // +1 ensures minimum wait time is at least 1 msec
      unsigned long waitTime = (time / _lstOperations.size()) + 1;
      QTime t;
      t.start();
      // Wait for all children
      bool allDone;
      do
        {
          allDone = true;
          for (int i=_lstOperations.size(); i--; )
            allDone = allDone && _lstOperations[i]->wait(waitTime);
        }
      while (!allDone && static_cast<unsigned long>(t.elapsed()) < time);
      return allDone;
    }
}

Indentations are spaces, not tabs. And there are two of them. No more, no less.

The GNU coding standard is followed only when it comes to indentation. The GNU standard is for C, and Into is C++.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.