<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/127061/">https://git.reviewboard.kde.org/r/127061/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On February 14th, 2016, 8:07 p.m. UTC, <b>Kevin Funk</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">What about:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">struct S
{
    int a : 1;
    int b : 1; // offset is 1 Bit
};
</pre></div>
</p></pre>
 </blockquote>




 <p>On February 15th, 2016, 12:13 a.m. UTC, <b>Alexandre Courbot</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">That should translate to 0:1 Bytes. We can test for all the possible cases (bits only, bytes only, bits and bytes) and output a different string each time. I did not think this was worth the added code complexity, but am open to reconsider.</p></pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">0:1 Bytes is not really understandable to me. So actually, I'd say lets go for the verbose variant:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #008000; font-weight: bold">const</span> <span style="color: #008000; font-weight: bold">auto</span> <span style="color: #008000; font-weight: bold">byteOffset</span> <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">offset</span> <span style="color: #666666">/</span> <span style="color: #008000; font-weight: bold">8</span><span style="color: #666666">;</span>
<span style="color: #008000; font-weight: bold">const</span> <span style="color: #008000; font-weight: bold">auto</span> <span style="color: #008000; font-weight: bold">bitOffset</span> <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">offset</span> <span style="color: #666666">%</span> <span style="color: #008000; font-weight: bold">8</span><span style="color: #666666">;</span>
<span style="color: #008000; font-weight: bold">const</span> <span style="color: #008000; font-weight: bold">QString</span> <span style="color: #008000; font-weight: bold">byteOffsetStr</span> <span style="color: #666666">=</span> <span style="color: #666666">(</span><span style="color: #008000; font-weight: bold">byteOffset</span> <span style="color: #666666">||</span> <span style="color: #666666">!</span><span style="color: #008000; font-weight: bold">bitOffset</span><span style="color: #666666">)</span> <span style="color: #666666">?</span> <span style="color: #008000; font-weight: bold">i18np</span><span style="color: #666666">(</span><span style="color: #BA2121">"1 Byte"</span><span style="color: #666666">,</span> <span style="color: #BA2121">"%1 Bytes"</span><span style="color: #666666">,</span> <span style="color: #008000; font-weight: bold">byteOffset</span><span style="color: #666666">)</span> <span style="color: #666666">:</span> <span style="color: #008000; font-weight: bold">QString</span><span style="color: #666666">();</span>
<span style="color: #008000; font-weight: bold">const</span> <span style="color: #008000; font-weight: bold">QString</span> <span style="color: #008000; font-weight: bold">bitOffsetStr</span> <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">bitOffset</span> <span style="color: #666666">?</span> <span style="color: #008000; font-weight: bold">i18np</span><span style="color: #666666">(</span><span style="color: #BA2121">"1 Bit"</span><span style="color: #666666">,</span> <span style="color: #BA2121">"%1 Bits"</span><span style="color: #666666">,</span> <span style="color: #008000; font-weight: bold">bitOffset</span><span style="color: #666666">)</span> <span style="color: #666666">:</span> <span style="color: #008000; font-weight: bold">QString</span><span style="color: #666666">();</span>
<span style="color: #008000; font-weight: bold">QString</span> <span style="color: #008000; font-weight: bold">offset</span> <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">bitOffset</span> <span style="color: #666666">?</span> <span style="color: #008000; font-weight: bold">i18nc</span><span style="color: #666666">(</span><span style="color: #BA2121">"%1: bytes, %2: bits"</span><span style="color: #666666">,</span> <span style="color: #BA2121">"%1, %2"</span><span style="color: #666666">,</span> <span style="color: #008000; font-weight: bold">byteOffsetStr</span><span style="color: #666666">,</span> <span style="color: #008000; font-weight: bold">bitOffsetStr</span><span style="color: #666666">)</span> <span style="color: #666666">:</span> <span style="color: #008000; font-weight: bold">byteOffsetStr</span><span style="color: #666666">;</span>
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">untested!</p></pre>
<br />










<p>- Milian</p>


<br />
<p>On February 13th, 2016, 6:25 a.m. UTC, Alexandre Courbot wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDevelop.</div>
<div>By Alexandre Courbot.</div>


<p style="color: grey;"><i>Updated Feb. 13, 2016, 6:25 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdevelop
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Having the offsets of members in a structure displayed is extremely
useful for people who work with data structures. However the unit
chosen (bits) is not really common. This patch changes it to bytes. If
an offset doesn't round to a byte position, the extra bits are also
displayed.</pre>
  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>languages/clang/duchain/builder.cpp <span style="color: grey">(22d00f0fbbbcbce2eab92df2d9ed2b33e237a9e2)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/127061/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>