svn commit: r221365 - head/lib/libstand

Jilles Tjoelker jilles at stack.nl
Tue May 3 21:53:57 UTC 2011


On Tue, May 03, 2011 at 07:43:47AM +0000, Craig Rodrigues wrote:
> Author: rodrigc
> Date: Tue May  3 07:43:47 2011
> New Revision: 221365
> URL: http://svn.freebsd.org/changeset/base/221365

> Log:
>   - Add parentheses around expression to eliminate compiler warning.

> Modified:
>   head/lib/libstand/dosfs.c

> -    d->d_fileno = dd.de.clus[1] << 8 + dd.de.clus[0];
> +    d->d_fileno = (dd.de.clus[1] << 8) + dd.de.clus[0];

This certainly seems an improvement, however not because it avoids a
compiler warning but because the original code was wrong. For some
strange reason, + binds more strongly than <<, so fewer different
d_fileno values were generated than likely intended.

-- 
Jilles Tjoelker


More information about the svn-src-all mailing list