Use an unsigned type for bitmask values
authorBenjamin Kaduk <kaduk@mit.edu>
Mon, 16 Jun 2014 16:44:08 +0000 (12:44 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 17 Jun 2014 15:48:18 +0000 (11:48 -0400)
commitd704f1d4dc3fca4d903c443130374da2284f3f15
tree0046db5f093097ae1caa3aab8a095aba062cfdc2
parente1105acb1c61670caec7d283b0dc6d73d84a0ff2
Use an unsigned type for bitmask values

As noted by clang -Wshift-sign-overflow, the expression "1<<31"
overflows the signed int type, giving undefined behavior.

Use an unsigned type to make the result of the shift defined
behavior by the C99 standard.

Also change an instance of "1<<31" that was checking for whether the
most significant bit was set, as it's still undefined behavior.

Change-Id: I8cf9443aa92470181044fc3b63d491da18ff5e34
Reviewed-on: http://gerrit.openafs.org/11301
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/dir/dir.c
src/ptserver/ptint.xg
src/rx/xdr_rec.c