diff options
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/default.c | 2 | ||||
-rw-r--r-- | mysys/hash.c | 16 | ||||
-rw-r--r-- | mysys/list.c | 3 | ||||
-rw-r--r-- | mysys/mf_iocache.c | 11 | ||||
-rw-r--r-- | mysys/mf_keycache.c | 30 | ||||
-rw-r--r-- | mysys/mf_keycaches.c | 4 | ||||
-rw-r--r-- | mysys/my_alloc.c | 5 | ||||
-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 | 3 | ||||
-rw-r--r-- | mysys/my_handler.c | 5 | ||||
-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 | 4 | ||||
-rw-r--r-- | mysys/my_realloc.c | 6 | ||||
-rw-r--r-- | mysys/my_seek.c | 2 | ||||
-rw-r--r-- | mysys/my_tempnam.c | 2 | ||||
-rw-r--r-- | mysys/my_write.c | 2 | ||||
-rw-r--r-- | mysys/raid.cc | 37 | ||||
-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 |
27 files changed, 107 insertions, 94 deletions
diff --git a/mysys/default.c b/mysys/default.c index fadf6efbc5b..4c99ae4cbf9 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -491,7 +491,7 @@ static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, 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; diff --git a/mysys/hash.c b/mysys/hash.c index 75135a470c9..5d83dae0faa 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); @@ -645,7 +645,9 @@ 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 @@ -656,13 +658,13 @@ 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,seek,max_links,(float) seek / (float) records)); + ("records: %u seeks: %u max links: %d hitrate: %.2f", + records, seek, max_links, (float) seek / (float) records)); return error; } #endif diff --git a/mysys/list.c b/mysys/list.c index 480c1080a45..9755dbcde84 100644 --- a/mysys/list.c +++ b/mysys/list.c @@ -28,7 +28,8 @@ LIST *list_add(LIST *root, LIST *element) { DBUG_ENTER("list_add"); - DBUG_PRINT("enter",("root: 0x%lx element: %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 a91002d3b4c..8bf9ad84e34 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -589,7 +589,9 @@ 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); @@ -651,7 +653,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; @@ -727,7 +729,8 @@ 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) @@ -866,7 +869,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 88b5051c52b..8ce3a6dde5c 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -410,9 +410,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, @@ -613,7 +613,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; @@ -632,7 +632,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, @@ -1058,7 +1058,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); @@ -1077,7 +1077,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)); } } @@ -1313,11 +1313,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", + DBUG_PRINT("enter", ("fd: %u pos: %lu wrmode: %d", + (uint) file, (ulong) filepos, wrmode)); + KEYCACHE_DBUG_PRINT("find_key_block", ("fd: %u pos: %lu wrmode: %d", (uint) file, (ulong) filepos, - (uint) wrmode)); + wrmode)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2", test_key_cache(keycache, "start of find_key_block", 0);); @@ -1587,9 +1587,9 @@ 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", + ("fd: %u pos: %lu block->status: %u page_status: %d", (uint) file, (ulong) filepos, block->status, - (uint) page_status)); + page_status)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2", @@ -2274,7 +2274,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) @@ -2474,7 +2474,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 d52a8efeed2..62fcbd491f9 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -47,7 +47,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: 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; @@ -263,7 +263,8 @@ 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..7ac2cc0d89e 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, (ulong) 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..9c9b9cf7bbb 100644 --- a/mysys/my_getwd.c +++ b/mysys/my_getwd.c @@ -45,7 +45,8 @@ 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 156e7892580..3d90b7f892a 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -543,8 +543,11 @@ 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 1908c70f407..41bfbc83b35 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -625,7 +625,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..02ed3b5d213 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: %u MyFlags: %d", + Filedes, (long) Buffer, 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..f012e9d6a85 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: %u MyFlags: %d", + Filedes, (long) Buffer, 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 3f601a42dc9..a146b9ddd27 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..f4218fac65f 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 %u bytes off %u from %d, errno: %d", + 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..a08a008de6f 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,7 +48,7 @@ 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", + DBUG_PRINT("warning",("Read only %u bytes off %u from %d, errno: %d", 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 c8edb172890..872518f2b0b 100644 --- a/mysys/my_realloc.c +++ b/mysys/my_realloc.c @@ -27,8 +27,8 @@ 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, - my_flags)); + DBUG_PRINT("my",("ptr: 0x%lx size: %u my_flags: %d", + (long) oldpoint, size, my_flags)); if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR)) DBUG_RETURN(my_malloc(size,my_flags)); @@ -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 a9ae68cd5f0..5f8318cd729 100644 --- a/mysys/my_seek.c +++ b/mysys/my_seek.c @@ -55,7 +55,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_tempnam.c b/mysys/my_tempnam.c index 9f765298fb6..4b4ab8de242 100644 --- a/mysys/my_tempnam.c +++ b/mysys/my_tempnam.c @@ -106,7 +106,7 @@ my_string my_tempnam(const char *dir, const char *pfx, #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_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/raid.cc b/mysys/raid.cc index 62587c438ca..4f1be0103e9 100644 --- a/mysys/raid.cc +++ b/mysys/raid.cc @@ -185,8 +185,8 @@ extern "C" { uint my_raid_write(File fd,const byte *Buffer, uint Count, myf MyFlags) { DBUG_ENTER("my_raid_write"); - DBUG_PRINT("enter",("Fd: %d Buffer: %lx Count: %u MyFlags: %d", - fd, Buffer, Count, MyFlags)); + DBUG_PRINT("enter",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", + fd, (long) Buffer, Count, MyFlags)); if (is_raid(fd)) { RaidFd *raid= (*dynamic_element(&RaidFd::_raid_map,fd,RaidFd**)); @@ -198,8 +198,8 @@ extern "C" { uint my_raid_read(File fd, byte *Buffer, uint Count, myf MyFlags) { DBUG_ENTER("my_raid_read"); - DBUG_PRINT("enter",("Fd: %d Buffer: %lx Count: %u MyFlags: %d", - fd, Buffer, Count, MyFlags)); + DBUG_PRINT("enter",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", + fd, (long) Buffer, Count, MyFlags)); if (is_raid(fd)) { RaidFd *raid= (*dynamic_element(&RaidFd::_raid_map,fd,RaidFd**)); @@ -212,8 +212,9 @@ extern "C" { myf MyFlags) { DBUG_ENTER("my_raid_pread"); - DBUG_PRINT("enter",("Fd: %d Buffer: %lx Count: %u offset: %u MyFlags: %d", - Filedes, Buffer, Count, offset, MyFlags)); + DBUG_PRINT("enter", + ("Fd: %d Buffer: 0x%lx Count: %u offset: %lu MyFlags: %d", + Filedes, (long) Buffer, Count, (ulong) offset, MyFlags)); if (is_raid(Filedes)) { assert(offset != MY_FILEPOS_ERROR); @@ -231,8 +232,8 @@ extern "C" { my_off_t offset, myf MyFlags) { DBUG_ENTER("my_raid_pwrite"); - DBUG_PRINT("enter",("Fd: %d Buffer: %lx Count: %u offset: %u MyFlags: %d", - Filedes, Buffer, Count, offset, MyFlags)); + DBUG_PRINT("enter",("Fd: %d Buffer: 0x%lx Count: %u offset: %lu MyFlags: %d", + Filedes, (long) Buffer, Count, (ulong) offset, MyFlags)); if (is_raid(Filedes)) { assert(offset != MY_FILEPOS_ERROR); @@ -250,8 +251,8 @@ extern "C" { myf MyFlags) { DBUG_ENTER("my_raid_lock"); - DBUG_PRINT("enter",("Fd: %d start: %u length: %u MyFlags: %d", - fd, start, length, MyFlags)); + DBUG_PRINT("enter",("Fd: %d start: %lu length: %lu MyFlags: %d", + fd, (ulong) start, (ulong) length, MyFlags)); if (my_disable_locking) DBUG_RETURN(0); if (is_raid(fd)) @@ -284,8 +285,8 @@ extern "C" { int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags) { DBUG_ENTER("my_raid_chsize"); - DBUG_PRINT("enter",("Fd: %d newlength: %u MyFlags: %d", - fd, newlength, MyFlags)); + DBUG_PRINT("enter",("Fd: %d newlength: %lu MyFlags: %d", + fd, (ulong) newlength, MyFlags)); if (is_raid(fd)) { RaidFd *raid= (*dynamic_element(&RaidFd::_raid_map,fd,RaidFd**)); @@ -413,7 +414,7 @@ RaidFd(uint raid_type, uint raid_chunks, ulong raid_chunksize) _fd_vector(0) { DBUG_ENTER("RaidFd::RaidFd"); - DBUG_PRINT("enter",("RaidFd_type: %u Disks: %u Chunksize: %d", + DBUG_PRINT("enter",("RaidFd_type: %u Disks: %u Chunksize: %lu", raid_type, raid_chunks, raid_chunksize)); /* TODO: Here we should add checks if the malloc fails */ @@ -622,7 +623,7 @@ Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags) { DBUG_ENTER("RaidFd::Lock"); DBUG_PRINT("enter",("locktype: %d start: %lu length: %lu MyFlags: %d", - locktype, start, length, MyFlags)); + locktype, (ulong) start, (ulong) length, MyFlags)); my_off_t bufptr = start; // Loop until all data is locked while(length) @@ -732,8 +733,8 @@ my_off_t RaidFd:: Tell(myf MyFlags) { DBUG_ENTER("RaidFd::Tell"); - DBUG_PRINT("enter",("MyFlags: %d _position %d", - MyFlags,_position)); + DBUG_PRINT("enter",("MyFlags: %d _position: %lu", + MyFlags, (ulong) _position)); DBUG_RETURN(_position); } @@ -741,8 +742,8 @@ int RaidFd:: Chsize(File fd, my_off_t newlength, int filler, myf MyFlags) { DBUG_ENTER("RaidFd::Chsize"); - DBUG_PRINT("enter",("Fd: %d, newlength: %d, MyFlags: %d", - fd, newlength,MyFlags)); + DBUG_PRINT("enter",("Fd: %d newlength: %lu MyFlags: %d", + fd, (ulong) newlength, MyFlags)); _position = newlength; Calculate(); uint _rounds = _total_block / _raid_chunks; // INT() assumed diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index 6cdf98c5f5f..5f93b861b31 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 d6443539216..fb1c2ca6409 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -436,7 +436,8 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) data->thread_id=my_thread_id(); /* Must be reset ! */ VOID(pthread_mutex_lock(&lock->mutex)); DBUG_PRINT("lock",("data: 0x%lx thread: %ld lock: 0x%lx type: %d", - data,data->thread_id,lock,(int) lock_type)); + (long) data, data->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) @@ -598,8 +599,8 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type) goto end; } } - DBUG_PRINT("lock",("write locked by thread: %ld, type: %ld", - lock->read.data->thread_id,data->type)); + DBUG_PRINT("lock",("write locked by thread: %ld type: %d", + lock->read.data->thread_id, (int) data->type)); } DBUG_RETURN(wait_for_lock(&lock->write_wait,data,0)); } @@ -665,7 +666,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->thread_id,lock)); + (long) data, data->thread_id, (long) lock)); pthread_mutex_lock(&lock->mutex); check_locks(lock,"start of release lock",0); @@ -835,7 +836,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: 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 */ @@ -907,7 +908,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++) { @@ -921,7 +922,7 @@ 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)->thread_id,(*pos)->lock)); + (long) *pos, (*pos)->thread_id, (long) (*pos)->lock)); } } DBUG_VOID_RETURN; diff --git a/mysys/tree.c b/mysys/tree.c index bec1ec680f1..4eae086ab96 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) { |