Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 May 2011 23:53:54 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Craig Rodrigues <rodrigc@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r221365 - head/lib/libstand
Message-ID:  <20110503215354.GA93376@stack.nl>
In-Reply-To: <201105030743.p437hl8M075368@svn.freebsd.org>
References:  <201105030743.p437hl8M075368@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110503215354.GA93376>