<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:krh@bitplanet.net" title="Kristian Høgsberg <krh@bitplanet.net>"> <span class="fn">Kristian Høgsberg</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - [task] Protocol: Integer signedness"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=55535">bug 55535</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>NOTABUG
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - [task] Protocol: Integer signedness"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=55535#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - [task] Protocol: Integer signedness"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=55535">bug 55535</a>
              from <span class="vcard"><a class="email" href="mailto:krh@bitplanet.net" title="Kristian Høgsberg <krh@bitplanet.net>"> <span class="fn">Kristian Høgsberg</span></a>
</span></b>
        <pre>The uint vs int args in the protocol are all carefully chosen.  The choice of
uint vs int is not about which values the argument may take, but more a
consideration of what kind of operations we're going to do on it.  Adding and
comparing int and uint values result in subtle overflow bugs.  For example,
you'll often be doing something like x2 - x1 < width, and if width is unsigned
and x1 and x2 are signed and x2 - x1 < 0, the x2 - x1 < width comparison will
fail.  In turn you often compare width to stride, so taking all this to its
natural conclusion, width and stride should be signed, although they'll never
take negative values.  The fact that a variable may never be negtive is no
different to if it was always in the 10 - 20 range, and you wouldn't pick a
different type for that either.

As a rule of thumb, we only use uint for two things: bitfields and enums.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>