title: Alternatives to `while (1)` to simplify branching
body: <p>From time to time, I use a <code>while(1)</code> block to flatten a succession of <code>if..else</code> going out of proportion. It goes along these lines.</p>
  
  <p>Instead of doing:</p>
  
  <pre><code>// process 
  if (success) {
    // process 
    if (success) {
      //process
      if (success) {
        // etc
      }
    }
  }
  </code></pre>
  
  <p>I do:</p>
  
  <pre><code>while (1) {
    // process
    if (!success) break;
    // process
    if (!success) break;
    // process
    if (!success) break;
    // etc
    break;
  }
  </code></pre>
  
  <p>I am a little annoyed by the implicit jump at the end of the <code>while</code>. Could I get away with a leaner construct (ie no <code>break</code> at the end)?</p>
  
  <p>I could trade the final <code>break</code> with a variable (or register?). That's not exactly leaner or clearer.</p>
  
  <pre><code>int once = 1;
  while (once--) {
    // process
    if (!success) break;
    // process
    if (!success) break;
    // process
    if (!success) break;
    // etc
  }
  </code></pre>
  
  <p>A for loop would look a bit better (C99):</p>
  
  <pre><code>for (int once = 1 ; once--; once) {
    // process
    if (!success) break;
    // process
    if (!success) break;
    // process
    if (!success) break;
    // etc
  }
  </code></pre>
  
  <p>I thought about using a switch case. It does not look much better , though it would work.</p>
  
  <pre><code>switch (1) { default:
    // process
    if (!success) break;
    // process
    if (!success) break;
    // process
    if (!success) break;
    // etc
  }
  </code></pre>
  
  <p>In that particular case the concept of a label seems unbeatable.  </p>
  
  <pre><code>// process
  if (!success) goto end;
  // process
  if (!success) goto end;
  // process
  if (!success) goto end;
  // etc
  
  end:
  </code></pre>
  
  <p>What other approach do you guys know/use?</p>