diff options
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/default.c | 6 | ||||
-rw-r--r-- | mysys/hash.c | 13 | ||||
-rw-r--r-- | mysys/list.c | 2 | ||||
-rw-r--r-- | mysys/mf_iocache.c | 9 | ||||
-rw-r--r-- | mysys/mf_keycache.c | 32 | ||||
-rw-r--r-- | mysys/mf_keycaches.c | 4 | ||||
-rw-r--r-- | mysys/my_alloc.c | 13 | ||||
-rw-r--r-- | mysys/my_dup.c | 2 | ||||
-rw-r--r-- | mysys/my_fopen.c | 6 | ||||
-rw-r--r-- | mysys/my_fstream.c | 8 | ||||
-rw-r--r-- | mysys/my_getwd.c | 2 | ||||
-rw-r--r-- | mysys/my_handler.c | 7 | ||||
-rw-r--r-- | mysys/my_lib.c | 2 | ||||
-rw-r--r-- | mysys/my_lread.c | 4 | ||||
-rw-r--r-- | mysys/my_lwrite.c | 4 | ||||
-rw-r--r-- | mysys/my_malloc.c | 4 | ||||
-rw-r--r-- | mysys/my_pread.c | 8 | ||||
-rw-r--r-- | mysys/my_read.c | 6 | ||||
-rw-r--r-- | mysys/my_realloc.c | 4 | ||||
-rw-r--r-- | mysys/my_seek.c | 2 | ||||
-rw-r--r-- | mysys/my_write.c | 2 | ||||
-rw-r--r-- | mysys/safemalloc.c | 10 | ||||
-rw-r--r-- | mysys/thr_lock.c | 15 | ||||
-rw-r--r-- | mysys/tree.c | 4 | ||||
-rw-r--r-- | mysys/typelib.c | 2 |
25 files changed, 91 insertions, 80 deletions
diff --git a/mysys/default.c b/mysys/default.c index 540968d4ba0..d93f4135e73 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -484,7 +484,7 @@ static int search_default_file(Process_option_func opt_handler, my_bool have_ext= fn_ext(config_file)[0] != 0; const char **exts_to_use= have_ext ? empty_list : f_extensions; - for (ext= (char**) exts_to_use; *ext; *ext++) + for (ext= (char**) exts_to_use; *ext; ext++) { int error; if ((error= search_default_file_with_ext(opt_handler, handler_ctx, @@ -672,7 +672,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler, ext= fn_ext(search_file->name); /* check extension */ - for (tmp_ext= (char**) f_extensions; *tmp_ext; *tmp_ext++) + for (tmp_ext= (char**) f_extensions; *tmp_ext; tmp_ext++) { if (!strcmp(ext, *tmp_ext)) break; @@ -861,7 +861,7 @@ void my_print_default_files(const char *conf_file) { for (dirs=default_directories ; *dirs; dirs++) { - for (ext= (char**) exts_to_use; *ext; *ext++) + for (ext= (char**) exts_to_use; *ext; ext++) { const char *pos; char *end; diff --git a/mysys/hash.c b/mysys/hash.c index 99479ef6769..9a268a7e218 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -53,7 +53,7 @@ _hash_init(HASH *hash,CHARSET_INFO *charset, void (*free_element)(void*),uint flags CALLER_INFO_PROTO) { DBUG_ENTER("hash_init"); - DBUG_PRINT("enter",("hash: 0x%lx size: %d",hash,size)); + DBUG_PRINT("enter",("hash: 0x%lx size: %d", (long) hash, size)); hash->records=0; if (my_init_dynamic_array_ci(&hash->array,sizeof(HASH_LINK),size,0)) @@ -109,7 +109,7 @@ static inline void hash_free_elements(HASH *hash) void hash_free(HASH *hash) { DBUG_ENTER("hash_free"); - DBUG_PRINT("enter",("hash: 0x%lxd",hash)); + DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash)); hash_free_elements(hash); hash->free= 0; @@ -129,7 +129,7 @@ void hash_free(HASH *hash) void my_hash_reset(HASH *hash) { DBUG_ENTER("my_hash_reset"); - DBUG_PRINT("enter",("hash: 0x%lxd",hash)); + DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash)); hash_free_elements(hash); reset_dynamic(&hash->array); @@ -644,7 +644,8 @@ my_bool hash_check(HASH *hash) if ((rec_link=hash_rec_mask(hash,hash_info,blength,records)) != i) { DBUG_PRINT("error", - ("Record in wrong link at %d: Start %d Record: 0x%lx Record-link %d", idx,i,hash_info->data,rec_link)); + ("Record in wrong link at %d: Start %d Record: 0x%lx Record-link %d", + idx, i, (long) hash_info->data, rec_link)); error=1; } else @@ -655,12 +656,12 @@ my_bool hash_check(HASH *hash) } if (found != records) { - DBUG_PRINT("error",("Found %ld of %ld records")); + DBUG_PRINT("error",("Found %u of %u records", found, records)); error=1; } if (records) DBUG_PRINT("info", - ("records: %ld seeks: %d max links: %d hitrate: %.2f", + ("records: %u seeks: %d max links: %d hitrate: %.2f", records,seek,max_links,(float) seek / (float) records)); return error; } diff --git a/mysys/list.c b/mysys/list.c index 0e55c9399f5..c4ce5b5e36f 100644 --- a/mysys/list.c +++ b/mysys/list.c @@ -28,7 +28,7 @@ LIST *list_add(LIST *root, LIST *element) { DBUG_ENTER("list_add"); - DBUG_PRINT("enter",("root: 0x%lx element: 0x%lx", root, element)); + DBUG_PRINT("enter",("root: 0x%lx element: 0x%lx", (long) root, (long) element)); if (root) { if (root->prev) /* If add in mid of list */ diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 249eaf48ad2..e0962999015 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -594,7 +594,8 @@ void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, DBUG_ENTER("init_io_cache_share"); DBUG_PRINT("io_cache_share", ("read_cache: 0x%lx share: 0x%lx " "write_cache: 0x%lx threads: %u", - read_cache, cshare, write_cache, num_threads)); + (long) read_cache, (long) cshare, + (long) write_cache, num_threads)); DBUG_ASSERT(num_threads > 1); DBUG_ASSERT(read_cache->type == READ_CACHE); @@ -656,7 +657,7 @@ void remove_io_thread(IO_CACHE *cache) pthread_mutex_lock(&cshare->mutex); DBUG_PRINT("io_cache_share", ("%s: 0x%lx", (cache == cshare->source_cache) ? - "writer" : "reader", cache)); + "writer" : "reader", (long) cache)); /* Remove from share. */ total= --cshare->total_threads; @@ -732,7 +733,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos) cshare->running_threads--; DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u", (cache == cshare->source_cache) ? - "writer" : "reader", cache, (ulong) pos, + "writer" : "reader", (long) cache, (ulong) pos, cshare->running_threads)); if (cshare->source_cache) @@ -871,7 +872,7 @@ static void unlock_io_cache(IO_CACHE *cache) DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u", (cache == cshare->source_cache) ? "writer" : "reader", - cache, (ulong) cshare->pos_in_file, + (long) cache, (ulong) cshare->pos_in_file, cshare->total_threads)); cshare->running_threads= cshare->total_threads; diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 11e27bb19ad..d658e6fe055 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -418,9 +418,9 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, DBUG_PRINT("exit", ("disk_blocks: %d block_root: 0x%lx hash_entries: %d\ hash_root: 0x%lx hash_links: %d hash_link_root: 0x%lx", - keycache->disk_blocks, keycache->block_root, - keycache->hash_entries, keycache->hash_root, - keycache->hash_links, keycache->hash_link_root)); + keycache->disk_blocks, (long) keycache->block_root, + keycache->hash_entries, (long) keycache->hash_root, + keycache->hash_links, (long) keycache->hash_link_root)); bzero((gptr) keycache->changed_blocks, sizeof(keycache->changed_blocks[0]) * CHANGED_BLOCKS_HASH); bzero((gptr) keycache->file_blocks, @@ -633,7 +633,7 @@ void change_key_cache_param(KEY_CACHE *keycache, uint division_limit, void end_key_cache(KEY_CACHE *keycache, my_bool cleanup) { DBUG_ENTER("end_key_cache"); - DBUG_PRINT("enter", ("key_cache: 0x%lx", keycache)); + DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache)); if (!keycache->key_cache_inited) DBUG_VOID_RETURN; @@ -652,7 +652,7 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup) keycache->blocks_changed= 0; } - DBUG_PRINT("status", ("used: %d changed: %d w_requests: %lu " + DBUG_PRINT("status", ("used: %lu changed: %lu w_requests: %lu " "writes: %lu r_requests: %lu reads: %lu", keycache->blocks_used, keycache->global_blocks_changed, (ulong) keycache->global_cache_w_requests, @@ -1085,7 +1085,7 @@ static void unreg_request(KEY_CACHE *keycache, if (block->temperature == BLOCK_WARM) keycache->warm_blocks--; block->temperature= BLOCK_HOT; - KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks=%u", + KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu", keycache->warm_blocks)); } link_block(keycache, block, hot, (my_bool)at_end); @@ -1104,7 +1104,7 @@ static void unreg_request(KEY_CACHE *keycache, keycache->warm_blocks++; block->temperature= BLOCK_WARM; } - KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks=%u", + KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu", keycache->warm_blocks)); } } @@ -1352,11 +1352,11 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache, DBUG_ENTER("find_key_block"); KEYCACHE_THREAD_TRACE("find_key_block:begin"); - DBUG_PRINT("enter", ("fd: %u pos %lu wrmode: %lu", - (uint) file, (ulong) filepos, (uint) wrmode)); - KEYCACHE_DBUG_PRINT("find_key_block", ("fd: %u pos: %lu wrmode: %lu", - (uint) file, (ulong) filepos, - (uint) wrmode)); + DBUG_PRINT("enter", ("fd: %d pos: %lu wrmode: %d", + file, (ulong) filepos, wrmode)); + KEYCACHE_DBUG_PRINT("find_key_block", ("fd: %d pos: %lu wrmode: %d", + file, (ulong) filepos, + wrmode)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2", test_key_cache(keycache, "start of find_key_block", 0);); @@ -1646,8 +1646,8 @@ restart: KEYCACHE_DBUG_ASSERT(page_status != -1); *page_st=page_status; KEYCACHE_DBUG_PRINT("find_key_block", - ("fd: %u pos %lu block->status %u page_status %lu", - (uint) file, (ulong) filepos, block->status, + ("fd: %d pos: %lu block->status: %u page_status: %u", + file, (ulong) filepos, block->status, (uint) page_status)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) @@ -2338,7 +2338,7 @@ static int flush_key_blocks_int(KEY_CACHE *keycache, BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache; int last_errno= 0; DBUG_ENTER("flush_key_blocks_int"); - DBUG_PRINT("enter",("file: %d blocks_used: %d blocks_changed: %d", + DBUG_PRINT("enter",("file: %d blocks_used: %lu blocks_changed: %lu", file, keycache->blocks_used, keycache->blocks_changed)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) @@ -2543,7 +2543,7 @@ int flush_key_blocks(KEY_CACHE *keycache, { int res; DBUG_ENTER("flush_key_blocks"); - DBUG_PRINT("enter", ("keycache: 0x%lx", keycache)); + DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache)); if (keycache->disk_blocks <= 0) DBUG_RETURN(0); diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c index 38fef31fdd4..e5086014a27 100644 --- a/mysys/mf_keycaches.c +++ b/mysys/mf_keycaches.c @@ -159,7 +159,7 @@ static byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length) result= hash->default_value; else result= ((SAFE_HASH_ENTRY*) result)->data; - DBUG_PRINT("exit",("data: 0x%lx", result)); + DBUG_PRINT("exit",("data: 0x%lx", (long) result)); DBUG_RETURN(result); } @@ -190,7 +190,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length, SAFE_HASH_ENTRY *entry; my_bool error= 0; DBUG_ENTER("safe_hash_set"); - DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, data)); + DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, (long) data)); rw_wrlock(&hash->mutex); entry= (SAFE_HASH_ENTRY*) hash_search(&hash->hash, key, length); diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index d5346d530c3..c97ae83f6bc 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -48,7 +48,8 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size __attribute__((unused))) { DBUG_ENTER("init_alloc_root"); - DBUG_PRINT("enter",("root: 0x%lx", mem_root)); + DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root)); + mem_root->free= mem_root->used= mem_root->pre_alloc= 0; mem_root->min_malloc= 32; mem_root->block_size= block_size - ALLOC_ROOT_MIN_BLOCK_SIZE; @@ -146,7 +147,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) #if defined(HAVE_purify) && defined(EXTRA_DEBUG) reg1 USED_MEM *next; DBUG_ENTER("alloc_root"); - DBUG_PRINT("enter",("root: 0x%lx", mem_root)); + DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root)); DBUG_ASSERT(alloc_root_inited(mem_root)); @@ -160,8 +161,8 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) next->next= mem_root->used; next->size= Size; mem_root->used= next; - DBUG_PRINT("exit",("ptr: 0x%lx", (((char*) next)+ - ALIGN_SIZE(sizeof(USED_MEM))))); + DBUG_PRINT("exit",("ptr: 0x%lx", (long) (((char*) next)+ + ALIGN_SIZE(sizeof(USED_MEM))))); DBUG_RETURN((gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM)))); #else uint get_size, block_size; @@ -169,7 +170,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) reg1 USED_MEM *next= 0; reg2 USED_MEM **prev; DBUG_ENTER("alloc_root"); - DBUG_PRINT("enter",("root: 0x%lx", mem_root)); + DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root)); DBUG_ASSERT(alloc_root_inited(mem_root)); Size= ALIGN_SIZE(Size); @@ -328,7 +329,7 @@ void free_root(MEM_ROOT *root, myf MyFlags) { reg1 USED_MEM *next,*old; DBUG_ENTER("free_root"); - DBUG_PRINT("enter",("root: 0x%lx flags: %u", root, (uint) MyFlags)); + DBUG_PRINT("enter",("root: 0x%lx flags: %u", (long) root, (uint) MyFlags)); if (!root) /* QQ: Should be deleted */ DBUG_VOID_RETURN; /* purecov: inspected */ diff --git a/mysys/my_dup.c b/mysys/my_dup.c index 4b7434e29ea..cdc15b3ebce 100644 --- a/mysys/my_dup.c +++ b/mysys/my_dup.c @@ -30,7 +30,7 @@ File my_dup(File file, myf MyFlags) File fd; const char *filename; DBUG_ENTER("my_dup"); - DBUG_PRINT("my",("file: %d MyFlags: %d", MyFlags)); + DBUG_PRINT("my",("file: %d MyFlags: %d", file, MyFlags)); fd = dup(file); filename= (((uint) file < my_file_limit) ? my_file_info[(int) file].name : "Unknown"); diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index f07beec9f39..6e81d40a2d6 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -79,7 +79,7 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags) my_stream_opened++; my_file_info[fileno(fd)].type = STREAM_BY_FOPEN; pthread_mutex_unlock(&THR_LOCK_open); - DBUG_PRINT("exit",("stream: 0x%lx",fd)); + DBUG_PRINT("exit",("stream: 0x%lx", (long) fd)); DBUG_RETURN(fd); } pthread_mutex_unlock(&THR_LOCK_open); @@ -103,7 +103,7 @@ int my_fclose(FILE *fd, myf MyFlags) { int err,file; DBUG_ENTER("my_fclose"); - DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d",fd, MyFlags)); + DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) fd, MyFlags)); pthread_mutex_lock(&THR_LOCK_open); file=fileno(fd); @@ -163,7 +163,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags) pthread_mutex_unlock(&THR_LOCK_open); } - DBUG_PRINT("exit",("stream: 0x%lx",fd)); + DBUG_PRINT("exit",("stream: 0x%lx", (long) fd)); DBUG_RETURN(fd); } /* my_fdopen */ diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c index 5b17e3ff51c..0f7f4cc888f 100644 --- a/mysys/my_fstream.c +++ b/mysys/my_fstream.c @@ -40,7 +40,7 @@ uint my_fread(FILE *stream, byte *Buffer, uint Count, myf MyFlags) uint readbytes; DBUG_ENTER("my_fread"); DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d", - stream, Buffer, Count, MyFlags)); + (long) stream, (long) Buffer, Count, MyFlags)); if ((readbytes = (uint) fread(Buffer,sizeof(char),(size_t) Count,stream)) != Count) @@ -81,7 +81,7 @@ uint my_fwrite(FILE *stream, const byte *Buffer, uint Count, myf MyFlags) #endif DBUG_ENTER("my_fwrite"); DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d", - stream, Buffer, Count, MyFlags)); + (long) stream, (long) Buffer, Count, MyFlags)); #if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM) errors=0; @@ -153,7 +153,7 @@ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence, { DBUG_ENTER("my_fseek"); DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %d", - stream, pos, whence, MyFlags)); + (long) stream, (long) pos, whence, MyFlags)); DBUG_RETURN(fseek(stream, (off_t) pos, whence) ? MY_FILEPOS_ERROR : (my_off_t) ftell(stream)); } /* my_seek */ @@ -166,7 +166,7 @@ my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused))) { off_t pos; DBUG_ENTER("my_ftell"); - DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d",stream, MyFlags)); + DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) stream, MyFlags)); pos=ftell(stream); DBUG_PRINT("exit",("ftell: %lu",(ulong) pos)); DBUG_RETURN((my_off_t) pos); diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c index 5663ceaa60e..b6b6ee610a5 100644 --- a/mysys/my_getwd.c +++ b/mysys/my_getwd.c @@ -45,7 +45,7 @@ int my_getwd(my_string buf, uint size, myf MyFlags) { my_string pos; DBUG_ENTER("my_getwd"); - DBUG_PRINT("my",("buf: 0x%lx size: %d MyFlags %d", buf,size,MyFlags)); + DBUG_PRINT("my",("buf: 0x%lx size: %d MyFlags %d", (long) buf,size,MyFlags)); #if ! defined(MSDOS) if (curr_dir[0]) /* Current pos is saved here */ diff --git a/mysys/my_handler.c b/mysys/my_handler.c index 23d28956808..46144c0dff2 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -505,6 +505,7 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) switch ((enum ha_base_keytype) keyseg->type) { case HA_KEYTYPE_TEXT: case HA_KEYTYPE_BINARY: + case HA_KEYTYPE_BIT: if (keyseg->flag & HA_SPACE_PACK) { int a_length; @@ -516,7 +517,9 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) a= end; break; case HA_KEYTYPE_VARTEXT1: + case HA_KEYTYPE_VARTEXT2: case HA_KEYTYPE_VARBINARY1: + case HA_KEYTYPE_VARBINARY2: { int a_length; get_key_length(a_length, a); @@ -546,6 +549,10 @@ HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) case HA_KEYTYPE_DOUBLE: a= end; break; + case HA_KEYTYPE_END: /* purecov: inspected */ + /* keep compiler happy */ + DBUG_ASSERT(0); + break; } } return keyseg; diff --git a/mysys/my_lib.c b/mysys/my_lib.c index 1c5630ad14e..ae7b0baafbd 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -638,7 +638,7 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags) int m_used; DBUG_ENTER("my_stat"); DBUG_PRINT("my", ("path: '%s', stat_area: 0x%lx, MyFlags: %d", path, - (byte *) stat_area, my_flags)); + (long) stat_area, my_flags)); if ((m_used= (stat_area == NULL))) if (!(stat_area = (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags))) diff --git a/mysys/my_lread.c b/mysys/my_lread.c index a96febe4474..ccf795631b8 100644 --- a/mysys/my_lread.c +++ b/mysys/my_lread.c @@ -27,8 +27,8 @@ uint32 my_lread(int Filedes, byte *Buffer, uint32 Count, myf MyFlags) { uint32 readbytes; DBUG_ENTER("my_lread"); - DBUG_PRINT("my",("Fd: %d Buffer: %ld Count: %ld MyFlags: %d", - Filedes, Buffer, Count, MyFlags)); + DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %lu MyFlags: %d", + Filedes, (long) Buffer, (ulong) Count, MyFlags)); DBUG_PRINT("error", ("Deprecated my_lread() function should not be used.")); diff --git a/mysys/my_lwrite.c b/mysys/my_lwrite.c index 02c56a69ba4..85f4677932e 100644 --- a/mysys/my_lwrite.c +++ b/mysys/my_lwrite.c @@ -23,8 +23,8 @@ uint32 my_lwrite(int Filedes, const byte *Buffer, uint32 Count, myf MyFlags) { uint32 writenbytes; DBUG_ENTER("my_lwrite"); - DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %ld MyFlags: %d", - Filedes, Buffer, Count, MyFlags)); + DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %lu MyFlags: %d", + Filedes, (long) Buffer, (ulong) Count, MyFlags)); DBUG_PRINT("error", ("Deprecated my_lwrite() function should not be used.")); diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index f33db2655c4..c6d51e29f18 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -44,7 +44,7 @@ gptr my_malloc(unsigned int size, myf my_flags) } else if (my_flags & MY_ZEROFILL) bzero(point,size); - DBUG_PRINT("exit",("ptr: 0x%lx",point)); + DBUG_PRINT("exit",("ptr: 0x%lx", (long) point)); DBUG_RETURN(point); } /* my_malloc */ @@ -55,7 +55,7 @@ gptr my_malloc(unsigned int size, myf my_flags) void my_no_flags_free(gptr ptr) { DBUG_ENTER("my_free"); - DBUG_PRINT("my",("ptr: 0x%lx",ptr)); + DBUG_PRINT("my",("ptr: 0x%lx", (long) ptr)); if (ptr) free(ptr); DBUG_VOID_RETURN; diff --git a/mysys/my_pread.c b/mysys/my_pread.c index f378d548731..b1b9d9da950 100644 --- a/mysys/my_pread.c +++ b/mysys/my_pread.c @@ -30,7 +30,7 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset, int error; DBUG_ENTER("my_pread"); DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d", - Filedes, (ulong) offset, Buffer, Count, MyFlags)); + Filedes, (ulong) offset, (long) Buffer, Count, MyFlags)); for (;;) { @@ -49,8 +49,8 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset, if (error) { my_errno=errno; - DBUG_PRINT("warning",("Read only %ld bytes off %ld from %d, errno: %d", - readbytes,Count,Filedes,my_errno)); + DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d", + (int) readbytes, Count,Filedes,my_errno)); #ifdef THREAD if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR) { @@ -87,7 +87,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset, ulong written; DBUG_ENTER("my_pwrite"); DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %d MyFlags: %d", - Filedes, (ulong) offset,Buffer, Count, MyFlags)); + Filedes, (ulong) offset, (long) Buffer, Count, MyFlags)); errors=0; written=0L; for (;;) diff --git a/mysys/my_read.c b/mysys/my_read.c index 8b88e483fef..33eb3ddf334 100644 --- a/mysys/my_read.c +++ b/mysys/my_read.c @@ -39,7 +39,7 @@ uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags) uint readbytes, save_count; DBUG_ENTER("my_read"); DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", - Filedes, Buffer, Count, MyFlags)); + Filedes, (long) Buffer, Count, MyFlags)); save_count= Count; for (;;) @@ -48,8 +48,8 @@ uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags) if ((readbytes= (uint) read(Filedes, Buffer, Count)) != Count) { my_errno= errno ? errno : -1; - DBUG_PRINT("warning",("Read only %ld bytes off %ld from %d, errno: %d", - readbytes, Count, Filedes, my_errno)); + DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d", + (int) readbytes, Count, Filedes, my_errno)); #ifdef THREAD if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR) { diff --git a/mysys/my_realloc.c b/mysys/my_realloc.c index a385bf1e530..b521ae36b94 100644 --- a/mysys/my_realloc.c +++ b/mysys/my_realloc.c @@ -27,7 +27,7 @@ gptr my_realloc(gptr oldpoint, uint size, myf my_flags) { gptr point; DBUG_ENTER("my_realloc"); - DBUG_PRINT("my",("ptr: 0x%lx size: %u my_flags: %d",oldpoint, size, + DBUG_PRINT("my",("ptr: 0x%lx size: %u my_flags: %d", (long) oldpoint, size, my_flags)); if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR)) @@ -60,6 +60,6 @@ gptr my_realloc(gptr oldpoint, uint size, myf my_flags) my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size); } #endif - DBUG_PRINT("exit",("ptr: 0x%lx",point)); + DBUG_PRINT("exit",("ptr: 0x%lx", (long) point)); DBUG_RETURN(point); } /* my_realloc */ diff --git a/mysys/my_seek.c b/mysys/my_seek.c index 69a24c2d3c6..e8c109acacd 100644 --- a/mysys/my_seek.c +++ b/mysys/my_seek.c @@ -61,7 +61,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, if (newpos == (os_off_t) -1) { my_errno=errno; - DBUG_PRINT("error",("lseek: %lu, errno: %d",newpos,errno)); + DBUG_PRINT("error",("lseek: %lu, errno: %d", (ulong) newpos,errno)); DBUG_RETURN(MY_FILEPOS_ERROR); } if ((my_off_t) newpos != pos) diff --git a/mysys/my_write.c b/mysys/my_write.c index ae8cb4ab02b..26b9a4f2444 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -27,7 +27,7 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags) ulong written; DBUG_ENTER("my_write"); DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %d MyFlags: %d", - Filedes, Buffer, Count, MyFlags)); + Filedes, (long) Buffer, Count, MyFlags)); errors=0; written=0L; for (;;) diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index f6d6644859e..b3466e36197 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -194,7 +194,7 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags) if ((MyFlags & MY_ZEROFILL) || !sf_malloc_quick) bfill(data, size, (char) (MyFlags & MY_ZEROFILL ? 0 : ALLOC_VAL)); /* Return a pointer to the real data */ - DBUG_PRINT("exit",("ptr: 0x%lx", data)); + DBUG_PRINT("exit",("ptr: 0x%lx", (long) data)); if (sf_min_adress > data) sf_min_adress= data; if (sf_max_adress < data) @@ -259,7 +259,7 @@ void _myfree(gptr ptr, const char *filename, uint lineno, myf myflags) { struct st_irem *irem; DBUG_ENTER("_myfree"); - DBUG_PRINT("enter",("ptr: 0x%lx", ptr)); + DBUG_PRINT("enter",("ptr: 0x%lx", (long) ptr)); if (!sf_malloc_quick) (void) _sanity (filename, lineno); @@ -410,7 +410,7 @@ void TERMINATE(FILE *file) } DBUG_PRINT("safe", ("%6u bytes at 0x%09lx, allocated at line %4d in '%s'", - irem->datasize, data, irem->linenum, irem->filename)); + irem->datasize, (long) data, irem->linenum, irem->filename)); irem= irem->next; } } @@ -447,7 +447,7 @@ static int _checkchunk(register struct st_irem *irem, const char *filename, fprintf(stderr, " discovered at %s:%d\n", filename, lineno); (void) fflush(stderr); DBUG_PRINT("safe",("Underrun at 0x%lx, allocated at %s:%d", - data, irem->filename, irem->linenum)); + (long) data, irem->filename, irem->linenum)); flag=1; } @@ -463,7 +463,7 @@ static int _checkchunk(register struct st_irem *irem, const char *filename, fprintf(stderr, " discovered at '%s:%d'\n", filename, lineno); (void) fflush(stderr); DBUG_PRINT("safe",("Overrun at 0x%lx, allocated at %s:%d", - data, + (long) data, irem->filename, irem->linenum)); flag=1; diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 51df50a4926..66848b94651 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -483,8 +483,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, data->owner= owner; /* Must be reset ! */ VOID(pthread_mutex_lock(&lock->mutex)); DBUG_PRINT("lock",("data: 0x%lx thread: %ld lock: 0x%lx type: %d", - data, data->owner->info->thread_id, - lock, (int) lock_type)); + (long) data, data->owner->info->thread_id, + (long) lock, (int) lock_type)); check_locks(lock,(uint) lock_type <= (uint) TL_READ_NO_INSERT ? "enter read_lock" : "enter write_lock",0); if ((int) lock_type <= (int) TL_READ_NO_INSERT) @@ -659,7 +659,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, goto end; } } - DBUG_PRINT("lock",("write locked by thread: %ld, type: %ld", + DBUG_PRINT("lock",("write locked by thread: %ld, type: %d", lock->read.data->owner->info->thread_id, data->type)); } wait_queue= &lock->write_wait; @@ -740,7 +740,7 @@ void thr_unlock(THR_LOCK_DATA *data) enum thr_lock_type lock_type=data->type; DBUG_ENTER("thr_unlock"); DBUG_PRINT("lock",("data: 0x%lx thread: %ld lock: 0x%lx", - data, data->owner->info->thread_id, lock)); + (long) data, data->owner->info->thread_id, (long) lock)); pthread_mutex_lock(&lock->mutex); check_locks(lock,"start of release lock",0); @@ -913,7 +913,7 @@ thr_multi_lock(THR_LOCK_DATA **data, uint count, THR_LOCK_OWNER *owner) { THR_LOCK_DATA **pos,**end; DBUG_ENTER("thr_multi_lock"); - DBUG_PRINT("lock",("data: 0x%lx count: %d",data,count)); + DBUG_PRINT("lock",("data: 0x%lx count: %d", (long) data, count)); if (count > 1) sort_locks(data,count); /* lock everything */ @@ -986,7 +986,7 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count) { THR_LOCK_DATA **pos,**end; DBUG_ENTER("thr_multi_unlock"); - DBUG_PRINT("lock",("data: 0x%lx count: %d",data,count)); + DBUG_PRINT("lock",("data: 0x%lx count: %d", (long) data, count)); for (pos=data,end=data+count; pos < end ; pos++) { @@ -1000,7 +1000,8 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count) else { DBUG_PRINT("lock",("Free lock: data: 0x%lx thread: %ld lock: 0x%lx", - *pos, (*pos)->owner->info->thread_id, (*pos)->lock)); + (long) *pos, (*pos)->owner->info->thread_id, + (long) (*pos)->lock)); } } DBUG_VOID_RETURN; diff --git a/mysys/tree.c b/mysys/tree.c index 0c9c04919b0..abbc99b2445 100644 --- a/mysys/tree.c +++ b/mysys/tree.c @@ -89,7 +89,7 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit, tree_element_free free_element, void *custom_arg) { DBUG_ENTER("init_tree"); - DBUG_PRINT("enter",("tree: 0x%lx size: %d",tree,size)); + DBUG_PRINT("enter",("tree: 0x%lx size: %d", (long) tree, size)); if (default_alloc_size < DEFAULT_ALLOC_SIZE) default_alloc_size= DEFAULT_ALLOC_SIZE; @@ -137,7 +137,7 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit, static void free_tree(TREE *tree, myf free_flags) { DBUG_ENTER("free_tree"); - DBUG_PRINT("enter",("tree: 0x%lx",tree)); + DBUG_PRINT("enter",("tree: 0x%lx", (long) tree)); if (tree->root) /* If initialized */ { diff --git a/mysys/typelib.c b/mysys/typelib.c index 90a093b0b32..d329b687668 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -49,7 +49,7 @@ int find_type(my_string x, TYPELIB *typelib, uint full_name) reg1 my_string i; reg2 const char *j; DBUG_ENTER("find_type"); - DBUG_PRINT("enter",("x: '%s' lib: 0x%lx",x,typelib)); + DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", x, (long) typelib)); if (!typelib->count) { |