title: Is there a concise way to create bit masks in C?
body: <p>I need to create three bit masks that end up in three 32-bit <code>unsigned ints</code> (let's call them x, y and z). The masks should end up like this:</p>
  
  <pre><code>x: 0000 0001 1111 1111 1111 1111 1111 1111
  y: 0000 1110 0000 0000 0000 0000 0000 0000
  z: 1111 0000 0000 0000 0000 0000 0000 0000
  </code></pre>
  
  <p>So far I've got this:</p>
  
  <pre><code>unsigned int x = (1&lt;&lt;25)-1;
  unsigned int y = (~x)&amp;((1&lt;&lt;28)-1);
  unsigned int z = (~x)&lt;&lt;3;
  </code></pre>
  
  <p>But it seems a bit messy. Can anyone come up with a more concise (and readable) way?</p>