summaryrefslogtreecommitdiff
path: root/storage/xtradb/include
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2010-09-06 13:42:12 +0200
committerunknown <knielsen@knielsen-hq.org>2010-09-06 13:42:12 +0200
commit4609a0591167a32d3dcfb02247693ec856f8faa3 (patch)
tree6106feb4b6c7560ec889bcd6383f5656d7123a69 /storage/xtradb/include
parent3a90cd6e479af9a5b3a5a9645c775e61657267a9 (diff)
downloadmariadb-git-4609a0591167a32d3dcfb02247693ec856f8faa3.tar.gz
Fix compile failures and warnings on Windows from XtraDB "shm buffer pool" patch.
(It is not legal C to do pointer arithmetics on void *).
Diffstat (limited to 'storage/xtradb/include')
-rw-r--r--storage/xtradb/include/buf0buf.h2
-rw-r--r--storage/xtradb/include/hash0hash.h8
-rw-r--r--storage/xtradb/include/ut0lst.h8
3 files changed, 9 insertions, 9 deletions
diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h
index 9484146d8a3..a7854e3038d 100644
--- a/storage/xtradb/include/buf0buf.h
+++ b/storage/xtradb/include/buf0buf.h
@@ -1305,7 +1305,7 @@ Compute the hash fold value for blocks in buf_pool->zip_hash. */
/* the fold should be relative when srv_buffer_pool_shm_key is enabled */
#define BUF_POOL_ZIP_FOLD_PTR(ptr) (!srv_buffer_pool_shm_key\
?((ulint) (ptr) / UNIV_PAGE_SIZE)\
- :((ulint) ((void*)ptr - (void*)(buf_pool->chunks->blocks->frame)) / UNIV_PAGE_SIZE))
+ :((ulint) ((char*)ptr - (char*)(buf_pool->chunks->blocks->frame)) / UNIV_PAGE_SIZE))
#define BUF_POOL_ZIP_FOLD(b) BUF_POOL_ZIP_FOLD_PTR((b)->frame)
#define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b))
/* @} */
diff --git a/storage/xtradb/include/hash0hash.h b/storage/xtradb/include/hash0hash.h
index 9cb410e2ad7..9dc20cc057f 100644
--- a/storage/xtradb/include/hash0hash.h
+++ b/storage/xtradb/include/hash0hash.h
@@ -363,14 +363,14 @@ do {\
NODE_TYPE* node2222;\
\
if ((TABLE)->array[i2222].node) \
- (TABLE)->array[i2222].node \
- += (((TABLE)->array[i2222].node > (void*)FADDR)?FOFFSET:BOFFSET);\
+ (TABLE)->array[i2222].node = (void*)((char*)(TABLE)->array[i2222].node \
+ + (((TABLE)->array[i2222].node > (void*)FADDR)?FOFFSET:BOFFSET));\
node2222 = HASH_GET_FIRST((TABLE), i2222);\
\
while (node2222) {\
if (node2222->PTR_NAME) \
- node2222->PTR_NAME = ((void*)node2222->PTR_NAME) \
- + ((((void*)node2222->PTR_NAME) > (void*)FADDR)?FOFFSET:BOFFSET);\
+ node2222->PTR_NAME = (void*)((char*)node2222->PTR_NAME \
+ + ((((void*)node2222->PTR_NAME) > (void*)FADDR)?FOFFSET:BOFFSET));\
\
node2222 = node2222->PTR_NAME;\
}\
diff --git a/storage/xtradb/include/ut0lst.h b/storage/xtradb/include/ut0lst.h
index 69809f22d36..4305f6571b5 100644
--- a/storage/xtradb/include/ut0lst.h
+++ b/storage/xtradb/include/ut0lst.h
@@ -269,10 +269,10 @@ do { \
TYPE* ut_list_node_313; \
\
if ((BASE).start) \
- (BASE).start = ((void*)((BASE).start) \
+ (BASE).start = (void*)((char*)((BASE).start) \
+ (((void*)((BASE).start) > (void*)FADDR)?FOFFSET:BOFFSET));\
if ((BASE).end) \
- (BASE).end = ((void*)((BASE).end) \
+ (BASE).end = (void*)((char*)((BASE).end) \
+ (((void*)((BASE).end) > (void*)FADDR)?FOFFSET:BOFFSET));\
\
ut_list_node_313 = (BASE).start; \
@@ -280,10 +280,10 @@ do { \
for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) { \
ut_a(ut_list_node_313); \
if ((ut_list_node_313->NAME).prev) \
- (ut_list_node_313->NAME).prev = ((void*)((ut_list_node_313->NAME).prev)\
+ (ut_list_node_313->NAME).prev = (void*)((char*)((ut_list_node_313->NAME).prev) \
+ (((void*)((ut_list_node_313->NAME).prev) > (void*)FADDR)?FOFFSET:BOFFSET));\
if ((ut_list_node_313->NAME).next) \
- (ut_list_node_313->NAME).next = ((void*)((ut_list_node_313->NAME).next)\
+ (ut_list_node_313->NAME).next = (void *)((char*)((ut_list_node_313->NAME).next) \
+ (((void*)((ut_list_node_313->NAME).next)> (void*)FADDR)?FOFFSET:BOFFSET));\
ut_list_node_313 = (ut_list_node_313->NAME).next; \
} \