Bug#21153166: REMOVE UNUSED VARIABLES AND CONVERT GLOBAL SYMBOLS TO STATIC

Follow-up to
Bug#21141390: REMOVE UNUSED FUNCTIONS AND CONVERT GLOBAL SYMBOLS TO STATIC
but for variables instead of functions.

Was identified with the -Wmissing-variable-declarations
compiler warning option supported by Clang 3.6.

Reviewed-by: Marko Mäkelä <marko.makela@oracle.com>

RB: 9070
This commit is contained in:
Jon Olav Hauglid 2015-05-27 14:34:45 +01:00 committed by Marko Mäkelä
parent 97acc4a1c3
commit a77ac6513e
12 changed files with 27 additions and 65 deletions

View file

@ -40,11 +40,6 @@ Created 5/30/1994 Heikki Tuuri
debug version, dtuple_create() will make all fields of dtuple_t point
to data_error. */
byte data_error;
# ifndef UNIV_DEBUG_VALGRIND
/** this is used to fool the compiler in dtuple_validate */
ulint data_dummy;
# endif /* !UNIV_DEBUG_VALGRIND */
#endif /* UNIV_DEBUG */
/** Compare two data tuples.
@ -229,10 +224,6 @@ dtuple_validate(
ulint j;
for (j = 0; j < len; j++) {
data_dummy += *data; /* fool the compiler not
to optimize out this
code */
data++;
}
#endif /* !UNIV_DEBUG_VALGRIND */

View file

@ -76,8 +76,8 @@ ulong fts_min_token_size;
// FIXME: testing
ib_time_t elapsed_time = 0;
ulint n_nodes = 0;
static ib_time_t elapsed_time = 0;
static ulint n_nodes = 0;
#ifdef FTS_CACHE_SIZE_DEBUG
/** The cache size permissible lower limit (1K) */

View file

@ -18837,8 +18837,8 @@ innodb_change_buffer_max_size_update(
}
#ifdef UNIV_DEBUG
ulong srv_fil_make_page_dirty_debug = 0;
ulong srv_saved_page_number_debug = 0;
static ulong srv_fil_make_page_dirty_debug = 0;
static ulong srv_saved_page_number_debug = 0;
/****************************************************************//**
Save an InnoDB page number. */

View file

@ -58,11 +58,11 @@ Created Nov 22, 2013 Mattias Jonsson */
/* To be backwards compatible we also fold partition separator on windows. */
#ifdef _WIN32
const char* part_sep = "#p#";
const char* sub_sep = "#sp#";
static const char* part_sep = "#p#";
static const char* sub_sep = "#sp#";
#else
const char* part_sep = "#P#";
const char* sub_sep = "#SP#";
static const char* part_sep = "#P#";
static const char* sub_sep = "#SP#";
#endif /* _WIN32 */
/* Partition separator for *nix platforms */

View file

@ -337,7 +337,7 @@ lock_sys_t* lock_sys = NULL;
/** We store info on the latest deadlock error to this buffer. InnoDB
Monitor will then fetch it and print */
bool lock_deadlock_found = false;
static bool lock_deadlock_found = false;
/** Only created if !srv_read_only_mode */
static FILE* lock_latest_err_file;

View file

@ -93,11 +93,11 @@ static ulint next_lbn_to_pad = 0;
/* These control how often we print warnings if the last checkpoint is too
old */
bool log_has_printed_chkp_warning = false;
time_t log_last_warning_time;
static bool log_has_printed_chkp_warning = false;
static time_t log_last_warning_time;
bool log_has_printed_chkp_margine_warning = false;
time_t log_last_margine_warning_time;
static bool log_has_printed_chkp_margine_warning = false;
static time_t log_last_margine_warning_time;
/* A margin for free space in the log buffer before a log entry is catenated */
#define LOG_BUF_WRITE_MARGIN (4 * OS_FILE_LOG_BLOCK_SIZE)

View file

@ -117,7 +117,7 @@ ulint recv_n_pool_free_frames;
/** The maximum lsn we see for a page during the recovery process. If this
is bigger than the lsn we are able to scan up to, that is an indication that
the recovery failed and the database may be corrupt. */
lsn_t recv_max_page_lsn;
static lsn_t recv_max_page_lsn;
#ifdef UNIV_PFS_THREAD
mysql_pfs_key_t trx_rollback_clean_thread_key;

View file

@ -681,18 +681,18 @@ wait until a batch of new read requests have been posted */
static bool os_aio_recommend_sleep_for_read_threads = false;
ulint os_n_file_reads = 0;
ulint os_bytes_read_since_printout = 0;
static ulint os_bytes_read_since_printout = 0;
ulint os_n_file_writes = 0;
ulint os_n_fsyncs = 0;
ulint os_n_file_reads_old = 0;
ulint os_n_file_writes_old = 0;
ulint os_n_fsyncs_old = 0;
static ulint os_n_file_reads_old = 0;
static ulint os_n_file_writes_old = 0;
static ulint os_n_fsyncs_old = 0;
/** Number of pending write operations */
ulint os_n_pending_writes = 0;
/** Number of pending read operations */
ulint os_n_pending_reads = 0;
time_t os_last_printout;
static time_t os_last_printout;
bool os_has_said_disk_full = false;
/** Default Zip compression level */

View file

@ -809,12 +809,12 @@ page_zip_set_alloc(
#ifdef PAGE_ZIP_COMPRESS_DBG
/** Set this variable in a debugger to enable
excessive logging in page_zip_compress(). */
ibool page_zip_compress_dbg;
static ibool page_zip_compress_dbg;
/** Set this variable in a debugger to enable
binary logging of the data passed to deflate().
When this variable is nonzero, it will act
as a log file name generator. */
unsigned page_zip_compress_log;
static unsigned page_zip_compress_log;
/**********************************************************************//**
Wrapper for deflate(). Log the operation if page_zip_compress_dbg is set.

View file

@ -145,9 +145,6 @@ end of some field (containing also <FIELD-END>).
A record is a complete-field prefix of another record, if
the corresponding canonical strings have the same property. */
/* this is used to fool compiler in rec_validate */
ulint rec_dummy;
/***************************************************************//**
Validates the consistency of an old-style physical record.
@return TRUE if ok */
@ -1768,11 +1765,9 @@ rec_validate_old(
/*=============*/
const rec_t* rec) /*!< in: physical record */
{
const byte* data;
ulint len;
ulint n_fields;
ulint len_sum = 0;
ulint sum = 0;
ulint i;
ut_a(rec);
@ -1784,7 +1779,7 @@ rec_validate_old(
}
for (i = 0; i < n_fields; i++) {
data = rec_get_nth_field_old(rec, i, &len);
rec_get_nth_field_offs_old(rec, i, &len);
if (!((len < UNIV_PAGE_SIZE) || (len == UNIV_SQL_NULL))) {
ib::error() << "Record field " << i << " len " << len;
@ -1793,10 +1788,6 @@ rec_validate_old(
if (len != UNIV_SQL_NULL) {
len_sum += len;
sum += *(data + len -1); /* dereference the
end of the field to
cause a memory trap
if possible */
} else {
len_sum += rec_get_nth_field_size(rec, i);
}
@ -1808,8 +1799,6 @@ rec_validate_old(
return(FALSE);
}
rec_dummy = sum; /* This is here only to fool the compiler */
return(TRUE);
}
@ -1822,11 +1811,9 @@ rec_validate(
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
const byte* data;
ulint len;
ulint n_fields;
ulint len_sum = 0;
ulint sum = 0;
ulint i;
ut_a(rec);
@ -1840,7 +1827,7 @@ rec_validate(
ut_a(rec_offs_comp(offsets) || n_fields <= rec_get_n_fields_old(rec));
for (i = 0; i < n_fields; i++) {
data = rec_get_nth_field(rec, offsets, i, &len);
rec_get_nth_field_offs(offsets, i, &len);
if (!((len < UNIV_PAGE_SIZE) || (len == UNIV_SQL_NULL))) {
ib::error() << "Record field " << i << " len " << len;
@ -1849,10 +1836,6 @@ rec_validate(
if (len != UNIV_SQL_NULL) {
len_sum += len;
sum += *(data + len -1); /* dereference the
end of the field to
cause a memory trap
if possible */
} else if (!rec_offs_comp(offsets)) {
len_sum += rec_get_nth_field_size(rec, i);
}
@ -1864,8 +1847,6 @@ rec_validate(
return(FALSE);
}
rec_dummy = sum; /* This is here only to fool the compiler */
if (!rec_offs_comp(offsets)) {
ut_a(rec_validate_old(rec));
}

View file

@ -70,7 +70,7 @@ Created 9/17/2000 Heikki Tuuri
#include <deque>
#include <vector>
const char* MODIFICATIONS_NOT_ALLOWED_MSG_FORCE_RECOVERY =
static const char* MODIFICATIONS_NOT_ALLOWED_MSG_FORCE_RECOVERY =
"innodb_force_recovery is on. We do not allow database modifications"
" by the user. Shut down mysqld and edit my.cnf to set"
" innodb_force_recovery=0";

View file

@ -297,16 +297,6 @@ ulong srv_read_ahead_threshold = 56;
of the buffer pool. */
uint srv_change_buffer_max_size = CHANGE_BUFFER_DEFAULT_SIZE;
/* This parameter is used to throttle the number of insert buffers that are
merged in a batch. By increasing this parameter on a faster disk you can
possibly reduce the number of I/O operations performed to complete the
merge operation. The value of this parameter is used as is by the
background loop when the system is idle (low load), on a busy system
the parameter is scaled down by a factor of 4, this is to avoid putting
a heavier load on the I/O sub system. */
ulong srv_insert_buffer_batch_size = 20;
char* srv_file_flush_method_str = NULL;
@ -461,7 +451,7 @@ i/o handler thread */
const char* srv_io_thread_op_info[SRV_MAX_N_IO_THREADS];
const char* srv_io_thread_function[SRV_MAX_N_IO_THREADS];
time_t srv_last_monitor_time;
static time_t srv_last_monitor_time;
static ib_mutex_t srv_innodb_monitor_mutex;
@ -486,8 +476,8 @@ ib_mutex_t srv_misc_tmpfile_mutex;
/** Temporary file for miscellanous diagnostic output */
FILE* srv_misc_tmpfile;
ulint srv_main_thread_process_no = 0;
ulint srv_main_thread_id = 0;
static ulint srv_main_thread_process_no = 0;
static ulint srv_main_thread_id = 0;
/* The following counts are used by the srv_master_thread. */