diff options
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/Makefile.am | 3 | ||||
-rw-r--r-- | mysys/hash.c | 4 | ||||
-rw-r--r-- | mysys/list.c | 2 | ||||
-rw-r--r-- | mysys/mf_iocache.c | 4 | ||||
-rw-r--r-- | mysys/mf_keycache.c | 73 | ||||
-rw-r--r-- | mysys/mf_keycaches.c | 4 | ||||
-rw-r--r-- | mysys/mf_tempfile.c | 4 | ||||
-rw-r--r-- | mysys/my_alloc.c | 7 | ||||
-rw-r--r-- | mysys/my_fopen.c | 6 | ||||
-rw-r--r-- | mysys/my_fstream.c | 8 | ||||
-rw-r--r-- | mysys/my_getopt.c | 108 | ||||
-rw-r--r-- | mysys/my_getwd.c | 2 | ||||
-rw-r--r-- | mysys/my_handler.c | 4 | ||||
-rw-r--r-- | mysys/my_lib.c | 13 | ||||
-rw-r--r-- | mysys/my_lwrite.c | 2 | ||||
-rw-r--r-- | mysys/my_malloc.c | 4 | ||||
-rw-r--r-- | mysys/my_pread.c | 4 | ||||
-rw-r--r-- | mysys/my_read.c | 2 | ||||
-rw-r--r-- | mysys/my_realloc.c | 4 | ||||
-rw-r--r-- | mysys/my_write.c | 2 | ||||
-rw-r--r-- | mysys/safemalloc.c | 8 | ||||
-rw-r--r-- | mysys/thr_alarm.c | 4 | ||||
-rw-r--r-- | mysys/thr_lock.c | 18 | ||||
-rw-r--r-- | mysys/thr_mutex.c | 4 | ||||
-rw-r--r-- | mysys/tree.c | 4 | ||||
-rw-r--r-- | mysys/typelib.c | 2 |
26 files changed, 156 insertions, 144 deletions
diff --git a/mysys/Makefile.am b/mysys/Makefile.am index d4290bbc49b..3ffeeab0411 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -17,7 +17,8 @@ MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir= $(prefix) -INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) +INCLUDES = @MT_INCLUDES@ \ + @ZLIB_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) pkglib_LIBRARIES = libmysys.a LDADD = libmysys.a ../dbug/libdbug.a \ ../strings/libmystrings.a diff --git a/mysys/hash.c b/mysys/hash.c index 11cbbd6b898..ce25ae89b63 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -52,7 +52,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: %lx size: %d",hash,size)); + DBUG_PRINT("enter",("hash: 0x%lx size: %d",hash,size)); hash->records=0; if (my_init_dynamic_array_ci(&hash->array,sizeof(HASH_LINK),size,0)) @@ -565,7 +565,7 @@ 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: %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,hash_info->data,rec_link)); error=1; } else diff --git a/mysys/list.c b/mysys/list.c index 17028e8e183..64fca10dc0b 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: %lx element: %lx", root, element)); + DBUG_PRINT("enter",("root: 0x%lx element: %lx", root, 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 f16f2b7ab72..f109df912f1 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -140,7 +140,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, uint min_cache; my_off_t end_of_file= ~(my_off_t) 0; DBUG_ENTER("init_io_cache"); - DBUG_PRINT("enter",("cache: %lx type: %d pos: %ld", + DBUG_PRINT("enter",("cache: 0x%lx type: %d pos: %ld", (ulong) info, (int) type, (ulong) seek_offset)); info->file= file; @@ -290,7 +290,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, pbool clear_cache) { DBUG_ENTER("reinit_io_cache"); - DBUG_PRINT("enter",("cache: %lx type: %d seek_offset: %lu clear_cache: %d", + DBUG_PRINT("enter",("cache: 0x%lx type: %d seek_offset: %lu clear_cache: %d", (ulong) info, type, (ulong) seek_offset, (int) clear_cache)); diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 32b3154b8ed..11aadbed6c1 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -29,10 +29,10 @@ to disk, if neccessary. This is handled in find_key_block(). With the new free list, the blocks can have three temperatures: hot, warm and cold (which is free). This is remembered in the block header - by the enum BLOCK_TEMPERATURE temperature variable. Remembering the - temperature is neccessary to correctly count the number of warm blocks, - which is required to decide when blocks are allowed to become hot. Whenever - a block is inserted to another (sub-)chain, we take the old and new + by the enum BLOCK_TEMPERATURE temperature variable. Remembering the + temperature is neccessary to correctly count the number of warm blocks, + which is required to decide when blocks are allowed to become hot. Whenever + a block is inserted to another (sub-)chain, we take the old and new temperature into account to decide if we got one more or less warm block. blocks_unused is the sum of never used blocks in the pool and of currently free blocks. blocks_used is the number of blocks fetched from the pool and @@ -401,8 +401,8 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, keycache->waiting_for_hash_link.last_thread= NULL; keycache->waiting_for_block.last_thread= NULL; DBUG_PRINT("exit", - ("disk_blocks: %d block_root: %lx hash_entries: %d\ - hash_root: %lx hash_links: %d hash_link_root %lx", + ("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)); @@ -475,13 +475,13 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, if (!keycache->key_cache_inited) DBUG_RETURN(keycache->disk_blocks); - + if(key_cache_block_size == keycache->key_cache_block_size && use_mem == keycache->key_cache_mem_size) { change_key_cache_param(keycache, division_limit, age_threshold); DBUG_RETURN(keycache->disk_blocks); - } + } keycache_pthread_mutex_lock(&keycache->cache_lock); @@ -504,7 +504,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, goto finish; } keycache->resize_in_flush= 0; - keycache->can_be_used= 0; + keycache->can_be_used= 0; while (keycache->cnt_for_resize_op) { keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); @@ -540,9 +540,9 @@ static inline void inc_counter_for_resize_op(KEY_CACHE *keycache) */ static inline void dec_counter_for_resize_op(KEY_CACHE *keycache) { - struct st_my_thread_var *last_thread; + struct st_my_thread_var *last_thread; if (!--keycache->cnt_for_resize_op && - (last_thread= keycache->resize_queue.last_thread)) + (last_thread= keycache->resize_queue.last_thread)) keycache_pthread_cond_signal(&last_thread->next->suspend); } @@ -551,7 +551,7 @@ static inline void dec_counter_for_resize_op(KEY_CACHE *keycache) SYNOPSIS change_key_cache_param() - keycache pointer to a key cache data structure + keycache pointer to a key cache data structure division_limit new division limit (if not zero) age_threshold new age threshold (if not zero) @@ -596,7 +596,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: %lx", keycache)); + DBUG_PRINT("enter", ("key_cache: 0x%lx", keycache)); if (!keycache->key_cache_inited) DBUG_VOID_RETURN; @@ -625,7 +625,7 @@ writes: %ld r_requests: %ld reads: %ld", if (cleanup) { pthread_mutex_destroy(&keycache->cache_lock); - keycache->key_cache_inited= 0; + keycache->key_cache_inited= keycache->can_be_used= 0; KEYCACHE_DEBUG_CLOSE; } DBUG_VOID_RETURN; @@ -1109,7 +1109,7 @@ static inline void link_hash(HASH_LINK **start, HASH_LINK *hash_link) static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link) { - KEYCACHE_DBUG_PRINT("unlink_hash", ("file %u, filepos %lu #requests=%u", + KEYCACHE_DBUG_PRINT("unlink_hash", ("fd: %u pos_ %lu #requests=%u", (uint) hash_link->file,(ulong) hash_link->diskpos, hash_link->requests)); KEYCACHE_DBUG_ASSERT(hash_link->requests == 0); if ((*hash_link->prev= hash_link->next)) @@ -1167,7 +1167,7 @@ static HASH_LINK *get_hash_link(KEY_CACHE *keycache, int cnt; #endif - KEYCACHE_DBUG_PRINT("get_hash_link", ("file %u, filepos %lu", + KEYCACHE_DBUG_PRINT("get_hash_link", ("fd: %u pos: %lu", (uint) file,(ulong) filepos)); restart: @@ -1193,7 +1193,7 @@ restart: for (i=0, hash_link= *start ; i < cnt ; i++, hash_link= hash_link->next) { - KEYCACHE_DBUG_PRINT("get_hash_link", ("file %u, filepos %lu", + KEYCACHE_DBUG_PRINT("get_hash_link", ("fd: %u pos: %lu", (uint) hash_link->file,(ulong) hash_link->diskpos)); } } @@ -1285,10 +1285,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", ("file %u, filepos %lu, wrmode %lu", - (uint) file, (ulong) filepos, (uint) wrmode)); - KEYCACHE_DBUG_PRINT("find_key_block", ("file %u, filepos %lu, wrmode %lu", - (uint) file, (ulong) filepos, (uint) wrmode)); + 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)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2", test_key_cache(keycache, "start of find_key_block", 0);); @@ -1315,7 +1316,7 @@ restart: return 0; } if (!(block->status & BLOCK_IN_FLUSH)) - { + { hash_link->requests--; /* Remove block to invalidate the page in the block buffer @@ -1326,9 +1327,9 @@ restart: buffer. Still we are guaranteed not to have any readers of the key part we are writing into until the block is removed from the cache as we set the BLOCL_REASSIGNED - flag (see the code below that handles reading requests). + flag (see the code below that handles reading requests). */ - free_block(keycache, block); + free_block(keycache, block); return 0; } /* Wait intil the page is flushed on disk */ @@ -1348,7 +1349,7 @@ restart: free_block(keycache, block); return 0; } - + if (page_status == PAGE_READ && (block->status & (BLOCK_IN_SWITCH | BLOCK_REASSIGNED))) { @@ -1542,7 +1543,7 @@ restart: KEYCACHE_DBUG_ASSERT(page_status != -1); *page_st=page_status; KEYCACHE_DBUG_PRINT("find_key_block", - ("file %u, filepos %lu, page_status %lu", + ("fd: %u pos %lu page_status %lu", (uint) file,(ulong) filepos,(uint) page_status)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) @@ -1678,7 +1679,7 @@ byte *key_cache_read(KEY_CACHE *keycache, uint offset= 0; byte *start= buff; DBUG_ENTER("key_cache_read"); - DBUG_PRINT("enter", ("file %u, filepos %lu, length %u", + DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u", (uint) file, (ulong) filepos, length)); if (keycache->can_be_used) @@ -1693,7 +1694,7 @@ byte *key_cache_read(KEY_CACHE *keycache, do { keycache_pthread_mutex_lock(&keycache->cache_lock); - if (!keycache->can_be_used) + if (!keycache->can_be_used) { keycache_pthread_mutex_unlock(&keycache->cache_lock); goto no_key_cache; @@ -1814,7 +1815,7 @@ int key_cache_insert(KEY_CACHE *keycache, byte *buff, uint length) { DBUG_ENTER("key_cache_insert"); - DBUG_PRINT("enter", ("file %u, filepos %lu, length %u", + DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u", (uint) file,(ulong) filepos, length)); if (keycache->can_be_used) @@ -1829,7 +1830,7 @@ int key_cache_insert(KEY_CACHE *keycache, { uint offset; keycache_pthread_mutex_lock(&keycache->cache_lock); - if (!keycache->can_be_used) + if (!keycache->can_be_used) { keycache_pthread_mutex_unlock(&keycache->cache_lock); DBUG_RETURN(0); @@ -1873,7 +1874,7 @@ int key_cache_insert(KEY_CACHE *keycache, error= (block->status & BLOCK_ERROR); - dec_counter_for_resize_op(keycache); + dec_counter_for_resize_op(keycache); keycache_pthread_mutex_unlock(&keycache->cache_lock); @@ -1926,7 +1927,7 @@ int key_cache_write(KEY_CACHE *keycache, int error=0; DBUG_ENTER("key_cache_write"); DBUG_PRINT("enter", - ("file %u filepos %lu length %u block_length %u key_block_length: %u", + ("fd: %u pos: %lu length: %u block_length: %u key_block_length: %u", (uint) file, (ulong) filepos, length, block_length, keycache ? keycache->key_cache_block_size : 0)); @@ -1953,7 +1954,7 @@ int key_cache_write(KEY_CACHE *keycache, { uint offset; keycache_pthread_mutex_lock(&keycache->cache_lock); - if (!keycache->can_be_used) + if (!keycache->can_be_used) { keycache_pthread_mutex_unlock(&keycache->cache_lock); goto no_key_cache; @@ -2028,7 +2029,7 @@ int key_cache_write(KEY_CACHE *keycache, dec_counter_for_resize_op(keycache); keycache_pthread_mutex_unlock(&keycache->cache_lock); - + next_block: buff+= read_length; filepos+= read_length; @@ -2149,7 +2150,7 @@ static int flush_cached_blocks(KEY_CACHE *keycache, if (!last_errno) last_errno= errno ? errno : -1; } - /* + /* Let to proceed for possible waiting requests to write to the block page. It might happen only during an operation to resize the key cache. */ @@ -2396,7 +2397,7 @@ int flush_key_blocks(KEY_CACHE *keycache, { int res; DBUG_ENTER("flush_key_blocks"); - DBUG_PRINT("enter", ("keycache: %lx", keycache)); + DBUG_PRINT("enter", ("keycache: 0x%lx", keycache)); if (keycache->disk_blocks <= 0) DBUG_RETURN(0); diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c index 806f83dc7d8..20465f3d23b 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: %lx", result)); + DBUG_PRINT("exit",("data: 0x%lx", 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: %lx", length, key, data)); + DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, data)); rw_wrlock(&hash->mutex); entry= (SAFE_HASH_ENTRY*) hash_search(&hash->hash, key, length); diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c index 0b337a74c19..af9ff0d6711 100644 --- a/mysys/mf_tempfile.c +++ b/mysys/mf_tempfile.c @@ -98,7 +98,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, if (strlen(dir)+ pfx_len > FN_REFLEN-2) { errno=my_errno= ENAMETOOLONG; - return 1; + DBUG_RETURN(file); } strmov(convert_dirname(to,dir,NullS),prefix_buff); org_file=mkstemp(to); @@ -124,7 +124,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, #ifdef OS2 /* changing environ variable doesn't work with VACPP */ char buffer[256], *end; - buffer[sizeof[buffer)-1]= 0; + buffer[sizeof(buffer)-1]= 0; end= strxnmov(buffer, sizeof(buffer)-1, (char*) "TMP=", dir, NullS); /* remove ending backslash */ if (end[-1] == '\\') diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 34a03391bc4..7b4287fc7a6 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -26,7 +26,7 @@ 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: %lx", mem_root)); + DBUG_PRINT("enter",("root: 0x%lx", mem_root)); mem_root->free= mem_root->used= mem_root->pre_alloc= 0; mem_root->min_malloc= 32; mem_root->block_size= block_size-MALLOC_OVERHEAD-sizeof(USED_MEM)-8; @@ -121,7 +121,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: %lx", mem_root)); + DBUG_PRINT("enter",("root: 0x%lx", mem_root)); Size+=ALIGN_SIZE(sizeof(USED_MEM)); if (!(next = (USED_MEM*) my_malloc(Size,MYF(MY_WME)))) @@ -133,6 +133,7 @@ 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_RETURN((gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM)))); #else uint get_size, block_size; @@ -222,7 +223,7 @@ void free_root(MEM_ROOT *root, myf MyFlags) { reg1 USED_MEM *next,*old; DBUG_ENTER("free_root"); - DBUG_PRINT("enter",("root: %lx flags: %u", root, (uint) MyFlags)); + DBUG_PRINT("enter",("root: 0x%lx flags: %u", root, (uint) MyFlags)); if (!root) /* QQ: Should be deleted */ DBUG_VOID_RETURN; /* purecov: inspected */ diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index 8906a288b11..e918b7b0de2 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -54,7 +54,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: %lx",fd)); + DBUG_PRINT("exit",("stream: 0x%lx",fd)); DBUG_RETURN(fd); } pthread_mutex_unlock(&THR_LOCK_open); @@ -78,7 +78,7 @@ int my_fclose(FILE *fd, myf MyFlags) { int err,file; DBUG_ENTER("my_fclose"); - DBUG_PRINT("my",("stream: %lx MyFlags: %d",fd, MyFlags)); + DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d",fd, MyFlags)); pthread_mutex_lock(&THR_LOCK_open); file=fileno(fd); @@ -138,7 +138,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags) pthread_mutex_unlock(&THR_LOCK_open); } - DBUG_PRINT("exit",("stream: %lx",fd)); + DBUG_PRINT("exit",("stream: 0x%lx",fd)); DBUG_RETURN(fd); } /* my_fdopen */ diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c index 94f3aaf3464..00fe5c7a009 100644 --- a/mysys/my_fstream.c +++ b/mysys/my_fstream.c @@ -39,7 +39,7 @@ uint my_fread(FILE *stream, byte *Buffer, uint Count, myf MyFlags) { uint readbytes; DBUG_ENTER("my_fread"); - DBUG_PRINT("my",("stream: %lx Buffer: %lx Count: %u MyFlags: %d", + DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d", stream, Buffer, Count, MyFlags)); if ((readbytes = (uint) fread(Buffer,sizeof(char),(size_t) Count,stream)) @@ -80,7 +80,7 @@ uint my_fwrite(FILE *stream, const byte *Buffer, uint Count, myf MyFlags) uint errors; #endif DBUG_ENTER("my_fwrite"); - DBUG_PRINT("my",("stream: %lx Buffer: %lx Count: %u MyFlags: %d", + DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d", stream, Buffer, Count, MyFlags)); #if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM) @@ -150,7 +150,7 @@ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence, myf MyFlags __attribute__((unused))) { DBUG_ENTER("my_fseek"); - DBUG_PRINT("my",("stream: %lx pos: %lu whence: %d MyFlags: %d", + DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %d", stream, pos, whence, MyFlags)); DBUG_RETURN(fseek(stream, (off_t) pos, whence) ? MY_FILEPOS_ERROR : (my_off_t) ftell(stream)); @@ -164,7 +164,7 @@ my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused))) { off_t pos; DBUG_ENTER("my_ftell"); - DBUG_PRINT("my",("stream: %lx MyFlags: %d",stream, MyFlags)); + DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d",stream, MyFlags)); pos=ftell(stream); DBUG_PRINT("exit",("ftell: %lu",(ulong) pos)); DBUG_RETURN((my_off_t) pos); diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index d7a9babe5e7..53e46932167 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -17,9 +17,12 @@ #include <my_global.h> #include <m_string.h> #include <stdlib.h> -#include <my_getopt.h> #include <my_sys.h> #include <mysys_err.h> +#include <my_getopt.h> + +static void default_reporter(enum loglevel level, const char *format, ...); +my_error_reporter my_getopt_error_reporter= &default_reporter; static int findopt(char *optpat, uint length, const struct my_option **opt_res, @@ -56,6 +59,14 @@ char *disabled_my_option= (char*) "0"; my_bool my_getopt_print_errors= 1; +static void default_reporter(enum loglevel level __attribute__((unused)), + const char *format, ...) +{ + va_list args; + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); +} /* function: handle_options @@ -76,10 +87,8 @@ void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint, } int handle_options(int *argc, char ***argv, - const struct my_option *longopts, - my_bool (*get_one_option)(int, - const struct my_option *, - char *)) + const struct my_option *longopts, + my_get_one_option get_one_option) { uint opt_found, argvpos= 0, length, i; my_bool end_of_options= 0, must_be_var, set_maximum_value, @@ -118,8 +127,9 @@ int handle_options(int *argc, char ***argv, if (!*++pos) { if (my_getopt_print_errors) - fprintf(stderr, "%s: Option '-O' requires an argument\n", - my_progname); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Option '-O' requires an argument\n", + my_progname); return EXIT_ARGUMENT_REQUIRED; } cur_arg= *pos; @@ -135,9 +145,9 @@ int handle_options(int *argc, char ***argv, if (!*cur_arg) { if (my_getopt_print_errors) - fprintf(stderr, - "%s: Option '--set-variable' requires an argument\n", - my_progname); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Option '--set-variable' requires an argument\n", + my_progname); return EXIT_ARGUMENT_REQUIRED; } } @@ -149,9 +159,9 @@ int handle_options(int *argc, char ***argv, if (!*++pos) { if (my_getopt_print_errors) - fprintf(stderr, - "%s: Option '--set-variable' requires an argument\n", - my_progname); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Option '--set-variable' requires an argument\n", + my_progname); return EXIT_ARGUMENT_REQUIRED; } cur_arg= *pos; @@ -210,10 +220,11 @@ int handle_options(int *argc, char ***argv, if (opt_found > 1) { if (my_getopt_print_errors) - fprintf(stderr, - "%s: ambiguous option '--%s-%s' (--%s-%s)\n", - my_progname, special_opt_prefix[i], opt_str, - special_opt_prefix[i], prev_found); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: ambiguous option '--%s-%s' (--%s-%s)\n", + my_progname, special_opt_prefix[i], + cur_arg, special_opt_prefix[i], + prev_found); return EXIT_AMBIGUOUS_OPTION; } switch (i) { @@ -245,18 +256,20 @@ int handle_options(int *argc, char ***argv, if (must_be_var) { if (my_getopt_print_errors) - fprintf(stderr, - "%s: %s: unknown variable '%s'\n", my_progname, - option_is_loose ? "WARNING" : "ERROR", opt_str); + my_getopt_error_reporter(option_is_loose ? + WARNING_LEVEL : ERROR_LEVEL, + "%s: unknown variable '%s'\n", + my_progname, cur_arg); if (!option_is_loose) return EXIT_UNKNOWN_VARIABLE; } else { if (my_getopt_print_errors) - fprintf(stderr, - "%s: %s: unknown option '--%s'\n", my_progname, - option_is_loose ? "WARNING" : "ERROR", opt_str); + my_getopt_error_reporter(option_is_loose ? + WARNING_LEVEL : ERROR_LEVEL, + "%s: unknown option '--%s'\n", + my_progname, cur_arg); if (!option_is_loose) return EXIT_UNKNOWN_OPTION; } @@ -272,15 +285,18 @@ int handle_options(int *argc, char ***argv, if (must_be_var) { if (my_getopt_print_errors) - fprintf(stderr, "%s: variable prefix '%s' is not unique\n", - my_progname, opt_str); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: variable prefix '%s' is not unique\n", + my_progname, opt_str); return EXIT_VAR_PREFIX_NOT_UNIQUE; } else { if (my_getopt_print_errors) - fprintf(stderr, "%s: ambiguous option '--%s' (%s, %s)\n", - my_progname, opt_str, prev_found, optp->name); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: ambiguous option '--%s' (%s, %s)\n", + my_progname, opt_str, prev_found, + optp->name); return EXIT_AMBIGUOUS_OPTION; } } @@ -300,8 +316,9 @@ int handle_options(int *argc, char ***argv, if (must_be_var && (optp->var_type & GET_TYPE_MASK) == GET_NO_ARG) { if (my_getopt_print_errors) - fprintf(stderr, "%s: option '%s' cannot take an argument\n", - my_progname, optp->name); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: option '%s' cannot take an argument\n", + my_progname, optp->name); return EXIT_NO_ARGUMENT_ALLOWED; } value= optp->var_type & GET_ASK_ADDR ? @@ -312,8 +329,9 @@ int handle_options(int *argc, char ***argv, if (optend && (optp->var_type & GET_TYPE_MASK) != GET_BOOL) { if (my_getopt_print_errors) - fprintf(stderr, "%s: option '--%s' cannot take an argument\n", - my_progname, optp->name); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: option '--%s' cannot take an argument\n", + my_progname, optp->name); return EXIT_NO_ARGUMENT_ALLOWED; } if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL) @@ -351,8 +369,9 @@ int handle_options(int *argc, char ***argv, if (!*++pos) { if (my_getopt_print_errors) - fprintf(stderr, "%s: option '--%s' requires an argument\n", - my_progname, optp->name); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: option '--%s' requires an argument\n", + my_progname, optp->name); return EXIT_ARGUMENT_REQUIRED; } argument= *pos; @@ -410,9 +429,9 @@ int handle_options(int *argc, char ***argv, if (!pos[1]) { if (my_getopt_print_errors) - fprintf(stderr, - "%s: option '-%c' requires an argument\n", - my_progname, optp->id); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: option '-%c' requires an argument\n", + my_progname, optp->id); return EXIT_ARGUMENT_REQUIRED; } argument= *++pos; @@ -423,9 +442,9 @@ int handle_options(int *argc, char ***argv, if ((error= setval(optp, optp->value, argument, set_maximum_value))) { - fprintf(stderr, - "%s: Error while setting value '%s' to '%s'\n", - my_progname, argument, optp->name); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Error while setting value '%s' to '%s'\n", + my_progname, argument, optp->name); return error; } get_one_option(optp->id, optp, argument); @@ -435,8 +454,9 @@ int handle_options(int *argc, char ***argv, if (!opt_found) { if (my_getopt_print_errors) - fprintf(stderr, - "%s: unknown option '-%c'\n", my_progname, *optend); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: unknown option '-%c'\n", + my_progname, *optend); return EXIT_UNKNOWN_OPTION; } } @@ -445,9 +465,9 @@ int handle_options(int *argc, char ***argv, } if ((error= setval(optp, value, argument, set_maximum_value))) { - fprintf(stderr, - "%s: Error while setting value '%s' to '%s'\n", - my_progname, argument, optp->name); + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Error while setting value '%s' to '%s'\n", + my_progname, argument, optp->name); return error; } get_one_option(optp->id, optp, argument); diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c index fd47c532cff..d6f647254e8 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: %lx size: %d MyFlags %d", buf,size,MyFlags)); + DBUG_PRINT("my",("buf: 0x%lx size: %d MyFlags %d", 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 6003808df25..360a7666e94 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -158,7 +158,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, (flag=mi_compare_text(keyseg->charset,a,a_length,b,b_length, (my_bool) ((nextflag & SEARCH_PREFIX) && next_key_length <= 0), - !(nextflag & SEARCH_PREFIX)))) + (my_bool)!(nextflag & SEARCH_PREFIX)))) return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); a+=a_length; b+=b_length; @@ -171,7 +171,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, (flag= mi_compare_text(keyseg->charset, a, a_length, b, b_length, (my_bool) ((nextflag & SEARCH_PREFIX) && next_key_length <= 0), - !(nextflag & SEARCH_PREFIX)))) + (my_bool)!(nextflag & SEARCH_PREFIX)))) return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); a=end; b+=length; diff --git a/mysys/my_lib.c b/mysys/my_lib.c index 0207d9a3683..c3b0b57e549 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -461,17 +461,6 @@ MY_DIR *my_dir(const char *path, myf MyFlags) else finfo.mystat= NULL; - /* - If the directory is the root directory of the drive, Windows sometimes - creates hidden or system files there (like RECYCLER); do not show - them. We would need to see how this can be achieved with a Borland - compiler. - */ -#ifndef __BORLANDC__ - if (attrib & (_A_HIDDEN | _A_SYSTEM)) - continue; -#endif - if (push_dynamic(dir_entries_storage, (gptr)&finfo)) goto error; @@ -624,7 +613,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: %lx, MyFlags: %d", path, + DBUG_PRINT("my", ("path: '%s', stat_area: 0x%lx, MyFlags: %d", path, (byte *) stat_area, my_flags)); if ((m_used= (stat_area == NULL))) diff --git a/mysys/my_lwrite.c b/mysys/my_lwrite.c index e1a3decd053..3b9afdbd71f 100644 --- a/mysys/my_lwrite.c +++ b/mysys/my_lwrite.c @@ -23,7 +23,7 @@ uint32 my_lwrite(int Filedes, const byte *Buffer, uint32 Count, myf MyFlags) { uint32 writenbytes; DBUG_ENTER("my_lwrite"); - DBUG_PRINT("my",("Fd: %d Buffer: %lx Count: %ld MyFlags: %d", + DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %ld MyFlags: %d", Filedes, Buffer, Count, MyFlags)); /* Temp hack to get count to int32 while write wants int */ diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index df9fe1f9bc4..3f601a42dc9 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: %lx",point)); + DBUG_PRINT("exit",("ptr: 0x%lx",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: %lx",ptr)); + DBUG_PRINT("my",("ptr: 0x%lx",ptr)); if (ptr) free(ptr); DBUG_VOID_RETURN; diff --git a/mysys/my_pread.c b/mysys/my_pread.c index 661ef48ab3e..6a55a3cd8de 100644 --- a/mysys/my_pread.c +++ b/mysys/my_pread.c @@ -29,7 +29,7 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset, uint readbytes; int error; DBUG_ENTER("my_pread"); - DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: %lx Count: %u MyFlags: %d", + DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d", Filedes, (ulong) offset, Buffer, Count, MyFlags)); for (;;) @@ -82,7 +82,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset, uint writenbytes,errors; ulong written; DBUG_ENTER("my_pwrite"); - DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: %lx Count: %d MyFlags: %d", + DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %d MyFlags: %d", Filedes, (ulong) offset,Buffer, Count, MyFlags)); errors=0; written=0L; diff --git a/mysys/my_read.c b/mysys/my_read.c index b7621ac99eb..9de070e772d 100644 --- a/mysys/my_read.c +++ b/mysys/my_read.c @@ -38,7 +38,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: %lx Count: %u MyFlags: %d", + DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", Filedes, Buffer, Count, MyFlags)); save_count=Count; diff --git a/mysys/my_realloc.c b/mysys/my_realloc.c index 5190fa75dce..c8edb172890 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: %lx size: %u my_flags: %d",oldpoint, size, + DBUG_PRINT("my",("ptr: 0x%lx size: %u my_flags: %d",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: %lx",point)); + DBUG_PRINT("exit",("ptr: 0x%lx",point)); DBUG_RETURN(point); } /* my_realloc */ diff --git a/mysys/my_write.c b/mysys/my_write.c index 61fd6097e28..37d885f04cd 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -26,7 +26,7 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags) uint writenbytes,errors; ulong written; DBUG_ENTER("my_write"); - DBUG_PRINT("my",("Fd: %d Buffer: %lx Count: %d MyFlags: %d", + DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %d MyFlags: %d", Filedes, Buffer, Count, MyFlags)); errors=0; written=0L; diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index 07c40fd91b6..6cdf98c5f5f 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: %lx", data)); + DBUG_PRINT("exit",("ptr: 0x%lx", 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: %lx", ptr)); + DBUG_PRINT("enter",("ptr: 0x%lx", ptr)); if (!sf_malloc_quick) (void) _sanity (filename, lineno); @@ -446,7 +446,7 @@ static int _checkchunk(register struct st_irem *irem, const char *filename, irem->filename, irem->linenum); fprintf(stderr, " discovered at %s:%d\n", filename, lineno); (void) fflush(stderr); - DBUG_PRINT("safe",("Underrun at %lx, allocated at %s:%d", + DBUG_PRINT("safe",("Underrun at 0x%lx, allocated at %s:%d", data, irem->filename, irem->linenum)); flag=1; } @@ -462,7 +462,7 @@ static int _checkchunk(register struct st_irem *irem, const char *filename, irem->filename, irem->linenum); fprintf(stderr, " discovered at '%s:%d'\n", filename, lineno); (void) fflush(stderr); - DBUG_PRINT("safe",("Overrun at %lx, allocated at %s:%d", + DBUG_PRINT("safe",("Overrun at 0x%lx, allocated at %s:%d", data, irem->filename, irem->linenum)); diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 84a8e779ae1..caef1caaf3d 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -257,9 +257,9 @@ void thr_end_alarm(thr_alarm_t *alarmed) if (!found) { if (*alarmed) - fprintf(stderr,"Warning: Didn't find alarm %lx in queue of %d alarms\n", + fprintf(stderr,"Warning: Didn't find alarm 0x%lx in queue of %d alarms\n", (long) *alarmed, alarm_queue.elements); - DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n", + DBUG_PRINT("warning",("Didn't find alarm 0x%lx in queue\n", (long) *alarmed)); } pthread_mutex_unlock(&LOCK_alarm); diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 0e3ccfc0452..d9e46fe1beb 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -435,7 +435,7 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) data->thread=pthread_self(); /* Must be reset ! */ data->thread_id=my_thread_id(); /* Must be reset ! */ VOID(pthread_mutex_lock(&lock->mutex)); - DBUG_PRINT("lock",("data: %lx thread: %ld lock: %lx type: %d", + DBUG_PRINT("lock",("data: 0x%lx thread: %ld lock: 0x%lx type: %d", data,data->thread_id,lock,(int) lock_type)); check_locks(lock,(uint) lock_type <= (uint) TL_READ_NO_INSERT ? "enter read_lock" : "enter write_lock",0); @@ -656,7 +656,7 @@ void thr_unlock(THR_LOCK_DATA *data) THR_LOCK *lock=data->lock; enum thr_lock_type lock_type=data->type; DBUG_ENTER("thr_unlock"); - DBUG_PRINT("lock",("data: %lx thread: %ld lock: %lx", + DBUG_PRINT("lock",("data: 0x%lx thread: %ld lock: 0x%lx", data,data->thread_id,lock)); pthread_mutex_lock(&lock->mutex); check_locks(lock,"start of release lock",0); @@ -827,7 +827,7 @@ int thr_multi_lock(THR_LOCK_DATA **data,uint count) { THR_LOCK_DATA **pos,**end; DBUG_ENTER("thr_multi_lock"); - DBUG_PRINT("lock",("data: %lx count: %d",data,count)); + DBUG_PRINT("lock",("data: 0x%lx count: %d",data,count)); if (count > 1) sort_locks(data,count); /* lock everything */ @@ -839,7 +839,7 @@ int thr_multi_lock(THR_LOCK_DATA **data,uint count) DBUG_RETURN(1); } #ifdef MAIN - printf("Thread: %s Got lock: %lx type: %d\n",my_thread_name(), + printf("Thread: %s Got lock: 0x%lx type: %d\n",my_thread_name(), (long) pos[0]->lock, pos[0]->type); fflush(stdout); #endif } @@ -899,12 +899,12 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count) { THR_LOCK_DATA **pos,**end; DBUG_ENTER("thr_multi_unlock"); - DBUG_PRINT("lock",("data: %lx count: %d",data,count)); + DBUG_PRINT("lock",("data: 0x%lx count: %d",data,count)); for (pos=data,end=data+count; pos < end ; pos++) { #ifdef MAIN - printf("Thread: %s Rel lock: %lx type: %d\n", + printf("Thread: %s Rel lock: 0x%lx type: %d\n", my_thread_name(), (long) pos[0]->lock, pos[0]->type); fflush(stdout); #endif @@ -912,7 +912,7 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count) thr_unlock(*pos); else { - DBUG_PRINT("lock",("Free lock: data: %lx thread: %ld lock: %lx", + DBUG_PRINT("lock",("Free lock: data: 0x%lx thread: %ld lock: 0x%lx", *pos,(*pos)->thread_id,(*pos)->lock)); } } @@ -1098,7 +1098,7 @@ static void thr_print_lock(const char* name,struct st_lock_list *list) prev= &list->data; for (data=list->data; data && count++ < MAX_LOCKS ; data=data->next) { - printf("%lx (%lu:%d); ",(ulong) data,data->thread_id,(int) data->type); + printf("0x%lx (%lu:%d); ",(ulong) data,data->thread_id,(int) data->type); if (data->prev != prev) printf("\nWarning: prev didn't point at previous lock\n"); prev= &data->next; @@ -1120,7 +1120,7 @@ void thr_print_locks(void) { THR_LOCK *lock=(THR_LOCK*) list->data; VOID(pthread_mutex_lock(&lock->mutex)); - printf("lock: %lx:",(ulong) lock); + printf("lock: 0x%lx:",(ulong) lock); if ((lock->write_wait.data || lock->read_wait.data) && (! lock->read.data && ! lock->write.data)) printf(" WARNING: "); diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index 8ebe5be22e8..bbcfaa8bba6 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -210,7 +210,7 @@ int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp, const char *file, if (mp->count++) { fprintf(stderr, - "safe_mutex: Count was %d in thread %lx when locking mutex at %s, line %d\n", + "safe_mutex: Count was %d in thread 0x%lx when locking mutex at %s, line %d\n", mp->count-1, my_thread_id(), file, line); fflush(stderr); abort(); @@ -248,7 +248,7 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, if (mp->count++) { fprintf(stderr, - "safe_mutex: Count was %d in thread %lx when locking mutex at %s, line %d (error: %d (%d))\n", + "safe_mutex: Count was %d in thread 0x%lx when locking mutex at %s, line %d (error: %d (%d))\n", mp->count-1, my_thread_id(), file, line, error, error); fflush(stderr); abort(); diff --git a/mysys/tree.c b/mysys/tree.c index 063c8739e58..bec1ec680f1 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: %lx size: %d",tree,size)); + DBUG_PRINT("enter",("tree: 0x%lx size: %d",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: %lx",tree)); + DBUG_PRINT("enter",("tree: 0x%lx",tree)); if (tree->root) /* If initialized */ { diff --git a/mysys/typelib.c b/mysys/typelib.c index 9aaf97d143f..90a093b0b32 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: %lx",x,typelib)); + DBUG_PRINT("enter",("x: '%s' lib: 0x%lx",x,typelib)); if (!typelib->count) { |