From 5f59c68e7f8c2c6ad350646165616323650ae2ac Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 6 Mar 2006 22:26:31 -0500 Subject: [svn-r12017] Purpose: Bug fix Description: Correct problem with new log2(n) routine on 64-bit machines. Solution: Put some casts in to make certain that the values are computed as 32-bit integers. Platforms tested: Linux 2.4 (mir) - 64-bit --- src/H5HFint.c | 2 +- src/H5Vprivate.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5HFint.c b/src/H5HFint.c index cff06f4..61c4daf 100644 --- a/src/H5HFint.c +++ b/src/H5HFint.c @@ -313,7 +313,7 @@ HDfprintf(stderr, "%s: size = %Zu\n", FUNC, size); /* Check if this is the first object in the heap */ if(shared->next_man_block == 0) { /* Check if the object can fit in a direct block of the starting block size */ -#ifdef QAK +#ifndef QAK HDfprintf(stderr, "%s: H5HF_MAN_ABS_DIRECT_OVERHEAD_SIZE = %u\n", FUNC, H5HF_MAN_ABS_DIRECT_OVERHEAD_SIZE(shared, shared->man_dtable_info.cparam.start_block_size)); HDfprintf(stderr, "%s: H5HF_MAN_ABS_DIRECT_OBJ_PREFIX_LEN_SIZE = %u\n", FUNC, H5HF_MAN_ABS_DIRECT_OBJ_PREFIX_LEN_SIZE(shared, shared->man_dtable_info.cparam.start_block_size)); #endif /* QAK */ diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index 55047cb..2deaeaf 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -319,7 +319,7 @@ H5V_vector_inc(int n, hsize_t *v1, const hsize_t *v2) *------------------------------------------------------------------------- */ static H5_inline unsigned -H5V_log2(unsigned n) +H5V_log2(uint32_t n) { static const unsigned MultiplyDeBruijnBitPosition[32] = { @@ -327,7 +327,7 @@ H5V_log2(unsigned n) 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 }; - return(MultiplyDeBruijnBitPosition[(n * 0x077CB531UL) >> 27]); + return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); } /* H5V_log2() */ #endif /* H5Vprivate_H */ -- cgit v0.12