xdr: fix two old FIXMEs related to signed/unsigned arithmetic
authorGarrett Wollman <wollman@csail.mit.edu>
Sat, 21 Jul 2012 04:04:58 +0000 (00:04 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 22 Jul 2012 03:22:47 +0000 (20:22 -0700)
commit417df0d495a8636aec6959b074a35885e20022c9
tree1649fe7a0f24201239d4810729e599eccba66131
parent860812931f3adf07c85ac2a56deb149b9c0d33bb
xdr: fix two old FIXMEs related to signed/unsigned arithmetic

It's implementation-defined whether the C '>>' operator, when
applied to a signed integer, is sign-extending or zero-filling.
If you want unsigned arithmetic, you have to ask for it explicitly.
One assumes the reason for the shift is to avoid overflow if the
returned size/count is later converted to a signed int, in which
case maybe it would be better to use INT_MAX here.  This is the
minimal change necessary for correctness.

Change-Id: I6e848110963b5e1832a11d052d84884f10903e2e
Reviewed-on: http://gerrit.openafs.org/7800
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/rx/xdr.c
src/rx/xdr_array.c