rework afs_random() yet again 74/13474/2
authorBenjamin Kaduk <kaduk@mit.edu>
Sun, 3 Feb 2019 01:45:31 +0000 (19:45 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 1 Mar 2019 14:02:19 +0000 (09:02 -0500)
commitf0a3d477d6109697645cfdcc17617b502349d91b
tree3567b5c01207f1bea7468aa371adff0609aba2e9
parent96c0b88947c7aab605170bdca633d3716051a58e
rework afs_random() yet again

clang 7 notes that ~0 is signed and that left-shifting into the sign
bit is undefined behvaior.  Use a new construction to clear the low
byte of tv_usec with only bitwise operations that are independent of
the width of tv_usec and stay within the realm of C's defined behavior.

Change-Id: I3e4f0fa4a8b8b72df23ef0c8ad7c4a229ac942f3
Reviewed-on: https://gerrit.openafs.org/13474
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/afs_server.c