summaryrefslogtreecommitdiff
path: root/innobase/sync
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-12-20 03:41:04 +0200
committerunknown <monty@mysql.com>2003-12-20 03:41:04 +0200
commit65c44414c21c21ce7b57bd672873558ec2ed3031 (patch)
tree7b73c477120c02f912fc4e2d5105e727385d6bc6 /innobase/sync
parentaa2eb815d6453502889fafb8106bbe33c0632e73 (diff)
downloadmariadb-git-65c44414c21c21ce7b57bd672873558ec2ed3031.tar.gz
Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe
A after merge fix for last merge innobase/btr/btr0btr.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/btr/btr0sea.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/buf/buf0buf.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/buf/buf0flu.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/buf/buf0lru.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/buf/buf0rea.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/com/com0shm.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/data/data0data.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/data/data0type.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/dict/dict0crea.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/dict/dict0dict.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/fil/fil0fil.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/fsp/fsp0fsp.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/fut/fut0lst.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/ha/ha0ha.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/ibuf/ibuf0ibuf.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/include/univ.i: Disabled ut_sprintf/ut_fprintf. Not needed as all number arguments to printf are now casted innobase/lock/lock0lock.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/log/log0log.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/log/log0recv.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/mem/mem0dbg.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/mem/mem0pool.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/mtr/mtr0log.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/mtr/mtr0mtr.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/os/os0file.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/os/os0sync.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/page/page0cur.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/page/page0page.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/read/read0read.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/rem/rem0cmp.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/rem/rem0rec.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/row/row0mysql.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe Heikki, please check the change of % to %% innobase/row/row0sel.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/row/row0undo.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/srv/srv0srv.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/srv/srv0start.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/sync/sync0arr.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/sync/sync0rw.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/sync/sync0sync.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0purge.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0rec.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0roll.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0sys.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0trx.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0undo.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/usr/usr0sess.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/ut/ut0mem.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/ut/ut0ut.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe sql/sql_delete.cc: After merge fix
Diffstat (limited to 'innobase/sync')
-rw-r--r--innobase/sync/sync0arr.c35
-rw-r--r--innobase/sync/sync0rw.c21
-rw-r--r--innobase/sync/sync0sync.c30
3 files changed, 48 insertions, 38 deletions
diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c
index 4854b40409e..9bcee34a7d1 100644
--- a/innobase/sync/sync0arr.c
+++ b/innobase/sync/sync0arr.c
@@ -454,8 +454,9 @@ sync_array_cell_print(
buf += sprintf(buf,
"--Thread %lu has waited at %s line %lu for %.2f seconds the semaphore:\n",
- os_thread_pf(cell->thread), cell->file, cell->line,
- difftime(time(NULL), cell->reservation_time));
+ (ulong) os_thread_pf(cell->thread), cell->file,
+ (ulong) cell->line,
+ difftime(time(NULL), cell->reservation_time));
if (type == SYNC_MUTEX) {
/* We use old_wait_mutex in case the cell has already
@@ -464,11 +465,12 @@ sync_array_cell_print(
buf += sprintf(buf,
"Mutex at %lx created file %s line %lu, lock var %lu\n",
- (ulint)mutex, mutex->cfile_name, mutex->cline,
- mutex->lock_word);
+ (ulong) mutex, mutex->cfile_name,
+ (ulong) mutex->cline, (ulong) mutex->lock_word);
buf += sprintf(buf,
"Last time reserved in file %s line %lu, waiters flag %lu\n",
- mutex->file_name, mutex->line, mutex->waiters);
+ mutex->file_name, (ulong) mutex->line,
+ (ulong) mutex->waiters);
} else if (type == RW_LOCK_EX || type == RW_LOCK_SHARED) {
@@ -482,11 +484,12 @@ sync_array_cell_print(
buf += sprintf(buf,
" RW-latch at %lx created in file %s line %lu\n",
- (ulint)rwlock, rwlock->cfile_name, rwlock->cline);
+ (ulong) rwlock, rwlock->cfile_name,
+ (ulong) rwlock->cline);
if (rwlock->writer != RW_LOCK_NOT_LOCKED) {
buf += sprintf(buf,
"a writer (thread id %lu) has reserved it in mode",
- os_thread_pf(rwlock->writer_thread));
+ (ulong) os_thread_pf(rwlock->writer_thread));
if (rwlock->writer == RW_LOCK_EX) {
buf += sprintf(buf, " exclusive\n");
} else {
@@ -496,14 +499,16 @@ sync_array_cell_print(
buf += sprintf(buf,
"number of readers %lu, waiters flag %lu\n",
- rwlock->reader_count, rwlock->waiters);
+ (ulong) rwlock->reader_count,
+ (ulong) rwlock->waiters);
buf += sprintf(buf,
"Last time read locked in file %s line %lu\n",
- rwlock->last_s_file_name, rwlock->last_s_line);
+ rwlock->last_s_file_name,
+ (ulong) rwlock->last_s_line);
buf += sprintf(buf,
"Last time write locked in file %s line %lu\n",
- rwlock->last_x_file_name, rwlock->last_x_line);
+ rwlock->last_x_file_name, (ulong) rwlock->last_x_line);
} else {
ut_error;
}
@@ -651,8 +656,8 @@ sync_array_detect_deadlock(
sync_array_cell_print(buf, cell);
printf(
"Mutex %lx owned by thread %lu file %s line %lu\n%s",
- (ulint)mutex, os_thread_pf(mutex->thread_id),
- mutex->file_name, mutex->line, buf);
+ (ulong) mutex, (ulong) os_thread_pf(mutex->thread_id),
+ mutex->file_name, (ulong) mutex->line, buf);
return(TRUE);
}
@@ -686,7 +691,7 @@ sync_array_detect_deadlock(
depth);
if (ret) {
sync_array_cell_print(buf, cell);
- printf("rw-lock %lx %s ", (ulint) lock, buf);
+ printf("rw-lock %lx %s ", (ulong) lock, buf);
rw_lock_debug_print(debug);
return(TRUE);
@@ -719,7 +724,7 @@ sync_array_detect_deadlock(
depth);
if (ret) {
sync_array_cell_print(buf, cell);
- printf("rw-lock %lx %s ", (ulint) lock, buf);
+ printf("rw-lock %lx %s ", (ulong) lock, buf);
rw_lock_debug_print(debug);
return(TRUE);
@@ -972,7 +977,7 @@ sync_array_output_info(
buf += sprintf(buf,
"OS WAIT ARRAY INFO: reservation count %ld, signal count %ld\n",
- arr->res_count, arr->sg_count);
+ (long) arr->res_count, (long) arr->sg_count);
i = 0;
count = 0;
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index 5c5abebd5e1..f552af1d1f0 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -235,8 +235,8 @@ lock_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu spin wait rw-s-lock at %lx cfile %s cline %lu rnds %lu\n",
- os_thread_pf(os_thread_get_curr_id()), (ulint)lock,
- lock->cfile_name, lock->cline, i);
+ (ulong) os_thread_pf(os_thread_get_curr_id()), (ulong) lock,
+ lock->cfile_name, (ulong) lock->cline, (ulong) i);
}
mutex_enter(rw_lock_get_mutex(lock));
@@ -265,8 +265,8 @@ lock_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu OS wait rw-s-lock at %lx cfile %s cline %lu\n",
- os_thread_pf(os_thread_get_curr_id()), (ulint)lock,
- lock->cfile_name, lock->cline);
+ (ulong) os_thread_pf(os_thread_get_curr_id()),
+ (ulong) lock, lock->cfile_name, (ulong) lock->cline);
}
rw_s_system_call_count++;
@@ -483,8 +483,8 @@ lock_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu spin wait rw-x-lock at %lx cfile %s cline %lu rnds %lu\n",
- os_thread_pf(os_thread_get_curr_id()), (ulint)lock,
- lock->cfile_name, lock->cline, i);
+ (ulong) os_thread_pf(os_thread_get_curr_id()), (ulong) lock,
+ lock->cfile_name, (ulong) lock->cline, (ulong) i);
}
rw_x_spin_wait_count++;
@@ -516,8 +516,8 @@ lock_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu OS wait for rw-x-lock at %lx cfile %s cline %lu\n",
- os_thread_pf(os_thread_get_curr_id()), (ulint)lock,
- lock->cfile_name, lock->cline);
+ (ulong) os_thread_pf(os_thread_get_curr_id()), (ulong) lock,
+ lock->cfile_name, (ulong) lock->cline);
}
rw_x_system_call_count++;
@@ -850,7 +850,8 @@ rw_lock_debug_print(
rwt = info->lock_type;
printf("Locked: thread %ld file %s line %ld ",
- os_thread_pf(info->thread_id), info->file_name, info->line);
+ (ulong) os_thread_pf(info->thread_id), info->file_name,
+ (ulong) info->line);
if (rwt == RW_LOCK_SHARED) {
printf("S-LOCK");
} else if (rwt == RW_LOCK_EX) {
@@ -861,7 +862,7 @@ rw_lock_debug_print(
ut_error;
}
if (info->pass != 0) {
- printf(" pass value %lu", info->pass);
+ printf(" pass value %lu", (ulong) info->pass);
}
printf("\n");
}
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 680582b05b2..424f5b1b35a 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -406,8 +406,8 @@ spin_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu spin wait mutex at %lx cfile %s cline %lu rnds %lu\n",
- os_thread_pf(os_thread_get_curr_id()), (ulint)mutex,
- mutex->cfile_name, mutex->cline, i);
+ (ulong) os_thread_pf(os_thread_get_curr_id()), (ulong) mutex,
+ mutex->cfile_name, (ulong) mutex->cline, (ulong) i);
}
mutex_spin_round_count += i;
@@ -472,7 +472,8 @@ spin_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu spin wait succeeds at 2: mutex at %lx\n",
- os_thread_pf(os_thread_get_curr_id()), (ulint)mutex);
+ (ulong) os_thread_pf(os_thread_get_curr_id()),
+ (ulong) mutex);
}
return;
@@ -490,8 +491,8 @@ spin_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu OS wait mutex at %lx cfile %s cline %lu rnds %lu\n",
- os_thread_pf(os_thread_get_curr_id()), (ulint)mutex,
- mutex->cfile_name, mutex->cline, i);
+ (ulong) os_thread_pf(os_thread_get_curr_id()), (ulong) mutex,
+ mutex->cfile_name, (ulong) mutex->cline, (ulong) i);
}
mutex_system_call_count++;
@@ -813,11 +814,11 @@ sync_thread_levels_g(
printf(
"InnoDB error: sync levels should be > %lu but a level is %lu\n",
- limit, slot->level);
+ (ulong) limit, (ulong) slot->level);
if (mutex->magic_n == MUTEX_MAGIC_N) {
printf("Mutex created at %s %lu\n", mutex->cfile_name,
- mutex->cline);
+ (ulong) mutex->cline);
if (mutex_get_lock_word(mutex) != 0) {
@@ -825,8 +826,8 @@ sync_thread_levels_g(
&file_name, &line, &thread_id);
printf("InnoDB: Locked mutex: addr %lx thread %ld file %s line %ld\n",
- (ulint)mutex, os_thread_pf(thread_id),
- file_name, line);
+ (ulong) mutex, (ulong) os_thread_pf(thread_id),
+ file_name, (ulong) line);
} else {
printf("Not locked\n");
}
@@ -1288,10 +1289,13 @@ sync_print_wait_info(
sprintf(buf,
"Mutex spin waits %lu, rounds %lu, OS waits %lu\n"
"RW-shared spins %lu, OS waits %lu; RW-excl spins %lu, OS waits %lu\n",
- mutex_spin_wait_count, mutex_spin_round_count,
- mutex_os_wait_count,
- rw_s_spin_wait_count, rw_s_os_wait_count,
- rw_x_spin_wait_count, rw_x_os_wait_count);
+ (ulong) mutex_spin_wait_count,
+ (ulong) mutex_spin_round_count,
+ (ulong) mutex_os_wait_count,
+ (ulong) rw_s_spin_wait_count,
+ (ulong) rw_s_os_wait_count,
+ (ulong) rw_x_spin_wait_count,
+ (ulong) rw_x_os_wait_count);
}
/***********************************************************************