viced: Avoid clang errors with modeBits
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 15 Feb 2013 17:12:45 +0000 (17:12 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Wed, 20 Feb 2013 18:23:04 +0000 (10:23 -0800)
commit1c3492149153ca82b18a36402f7f196f97a8512e
treefdf1726a2f4678119179234822b3648c0d5051fd
parentf63047a3d1d0ed27c1efdde9ca81b0e62f9f6e69
viced: Avoid clang errors with modeBits

The modeBits element of the VnodeDiskObject structure is defined as
a 12 bit wide bitfield. This causes clang some problems when doing
integer arithmetic, as it appears to the compiler that the field is
being overflowed. For example...

    targetptr->disk.modeBits &= ~04000;

Produces the error:
    implicit truncation from 'int' to bitfield changes value
from -2049 to 2047

Marc Dionne suggested changing this to
    targetptr->disk.modeBits = targetptr->disk.modeBits & ~04000;

in order to suppress the clang error.

Change-Id: Iadb53a3db911f5771d3ab2437ccd43abce2a8ecb
Reviewed-on: http://gerrit.openafs.org/9136
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
src/viced/afsfileprocs.c