ia64/xen-unstable

changeset 13551:7c455af5998a

Fix byte-to-long bitmap conversions.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@localhost.localdomain
date Sun Jan 21 17:10:58 2007 +0000 (2007-01-21)
parents c1f23d09285e
children 6ce3b486f0d4
files tools/libxc/xc_private.c xen/common/bitmap.c
line diff
     1.1 --- a/tools/libxc/xc_private.c	Sun Jan 21 16:29:18 2007 +0000
     1.2 +++ b/tools/libxc/xc_private.c	Sun Jan 21 17:10:58 2007 +0000
     1.3 @@ -525,8 +525,7 @@ void bitmap_byte_to_64(uint64_t *lp, con
     1.4      for (i = 0, b = 0; nbits > 0; i++, b += sizeof(l)) {
     1.5          l = 0;
     1.6          for (j = 0; (j < sizeof(l)) && (nbits > 0); j++) {
     1.7 -            l <<= 8;
     1.8 -            l |= bp[b+j];
     1.9 +            l |= (uint64_t)bp[b+j] << (j*8);
    1.10              nbits -= 8;
    1.11          }
    1.12          lp[i] = l;
     2.1 --- a/xen/common/bitmap.c	Sun Jan 21 16:29:18 2007 +0000
     2.2 +++ b/xen/common/bitmap.c	Sun Jan 21 17:10:58 2007 +0000
     2.3 @@ -494,8 +494,7 @@ void bitmap_byte_to_long(unsigned long *
     2.4  	for (i = 0, b = 0; nbits > 0; i++, b += sizeof(l)) {
     2.5  		l = 0;
     2.6  		for (j = 0; (j < sizeof(l)) && (nbits > 0); j++) {
     2.7 -			l <<= 8;
     2.8 -			l |= bp[b+j];
     2.9 +			l |= (unsigned long)bp[b+j] << (j*8);
    2.10  			nbits -= 8;
    2.11  		}
    2.12  		lp[i] = l;