title: Converting Endianess on a bit field structure
body: <p>I need to convert a bit-field structure from little-endian to big-endia architecture.
  What is the best way to do that, as there will be issues in byte boundaries, if I simply swap the structure elements.</p>
  
  <p>Ex Structure is:</p>
  
  <pre><code>struct {
      unsigned int    b1:1;
      unsigned int    b2:8;
      unsigned int    b3:7;
      unsigned int    b4:8;
      unsigned int    b5:7;
      unsigned int    b6:1;
  }; 
  </code></pre>