[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Fix byte-to-long bitmap conversions.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxxx # Date 1169399458 0 # Node ID 7c455af5998a72953f7e4472ae943cb8794f2e57 # Parent c1f23d09285e0d57c516bec8333982ffdb945d4d Fix byte-to-long bitmap conversions. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- tools/libxc/xc_private.c | 3 +-- xen/common/bitmap.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff -r c1f23d09285e -r 7c455af5998a tools/libxc/xc_private.c --- a/tools/libxc/xc_private.c Sun Jan 21 16:29:18 2007 +0000 +++ b/tools/libxc/xc_private.c Sun Jan 21 17:10:58 2007 +0000 @@ -525,8 +525,7 @@ void bitmap_byte_to_64(uint64_t *lp, con for (i = 0, b = 0; nbits > 0; i++, b += sizeof(l)) { l = 0; for (j = 0; (j < sizeof(l)) && (nbits > 0); j++) { - l <<= 8; - l |= bp[b+j]; + l |= (uint64_t)bp[b+j] << (j*8); nbits -= 8; } lp[i] = l; diff -r c1f23d09285e -r 7c455af5998a xen/common/bitmap.c --- a/xen/common/bitmap.c Sun Jan 21 16:29:18 2007 +0000 +++ b/xen/common/bitmap.c Sun Jan 21 17:10:58 2007 +0000 @@ -494,8 +494,7 @@ void bitmap_byte_to_long(unsigned long * for (i = 0, b = 0; nbits > 0; i++, b += sizeof(l)) { l = 0; for (j = 0; (j < sizeof(l)) && (nbits > 0); j++) { - l <<= 8; - l |= bp[b+j]; + l |= (unsigned long)bp[b+j] << (j*8); nbits -= 8; } lp[i] = l; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |