lkml.org 
[lkml]   [2011]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: POHMELFS is back
    On Tue, Sep 20, 2011 at 11:05:17AM -0600, Rick Morgan (rikmorgan@gmail.com) wrote:
    > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    Please do not use inline html

    > <pre wrap="">+static inline int dnet_id_cmp_str(const unsigned char *id1, const unsigned char *id2)
    > +{
    > + unsigned int <b>i = 0</b>;
    > +
    > + for (<b>i*=sizeof</b>(unsigned long); i&lt;DNET_ID_SIZE; ++i) {
    > + if (id1[i] &lt; id2[i])
    > + return -1;
    > + if (id1[i] &gt; id2[i])
    > + return 1;
    > + }
    > +
    > + return 0;
    > +}
    > </pre>
    > </blockquote>
    > if i is initialized to 0, wouldn't i*=sizeof(unsigned long) be zero?<br>

    Yes, it counts from zero. This chunk previously checked another
    parameter first, but since then it was removed, but checking loop
    remained.

    --
    Evgeniy Polyakov


    \
     
     \ /
      Last update: 2011-09-20 19:51    [W:0.021 / U:94.888 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site