imporve clang build

cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug

Maintainer mode makes all warnings errors. This patch fix warnings. Mostly about
deprecated `register` keyword.

Too much warnings came from Mroonga and I gave up on it.
This commit is contained in:
Eugene Kosov 2019-06-24 19:38:00 +03:00
parent d78145459f
commit d36c107a6b
55 changed files with 152 additions and 158 deletions

View file

@ -3128,7 +3128,7 @@ static int
com_help(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
reg1 int i, j;
int i, j;
char * help_arg= strchr(line,' '), buff[32], *end;
if (help_arg)
{

View file

@ -1044,8 +1044,8 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
const char *query_end, my_bool pass_through_escape_chars)
{
const char *p;
register char c, next_c;
register int escaped = 0;
char c, next_c;
int escaped = 0;
VAR *v;
DBUG_ENTER("do_eval");
@ -2341,7 +2341,7 @@ C_MODE_START
static uchar *get_var_key(const uchar* var, size_t *len,
my_bool __attribute__((unused)) t)
{
register char* key;
char* key;
key = ((VAR*)var)->name;
*len = ((VAR*)var)->name_len;
return (uchar*)key;
@ -9900,7 +9900,7 @@ typedef struct st_pointer_array { /* when using array-strings */
struct st_replace *init_replace(char * *from, char * *to, uint count,
char * word_end_chars);
int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name);
int insert_pointer_name(POINTER_ARRAY *pa,char * name);
void free_pointer_array(POINTER_ARRAY *pa);
/*
@ -9984,8 +9984,8 @@ void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
const char *str,
int len __attribute__((unused)))
{
reg1 REPLACE *rep_pos;
reg2 REPLACE_STRING *rep_str;
REPLACE *rep_pos;
REPLACE_STRING *rep_str;
const char *start, *from;
DBUG_ENTER("replace_strings_append");
@ -10891,7 +10891,7 @@ void internal_clear_bit(REP_SET *set, uint bit)
void or_bits(REP_SET *to,REP_SET *from)
{
reg1 uint i;
uint i;
for (i=0 ; i < to->size_of_bits ; i++)
to->bits[i]|=from->bits[i];
return;
@ -10993,7 +10993,7 @@ uint end_of_word(char * pos)
#define PC_MALLOC 256 /* Bytes for pointers */
#define PS_MALLOC 512 /* Bytes for data */
int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
int insert_pointer_name(POINTER_ARRAY *pa,char * name)
{
uint i,length,old_count;
uchar *new_pos;

View file

@ -1393,8 +1393,6 @@ write_xtrabackup_info(MYSQL *connection)
const char *xb_stream_name[] = {"file", "tar", "xbstream"};
ut_ad(xtrabackup_stream_fmt < 3);
uuid = read_mysql_one_value(connection, "SELECT UUID()");
server_version = read_mysql_one_value(connection, "SELECT VERSION()");
localtime_r(&history_start_time, &tm);

View file

@ -19,7 +19,7 @@
/* crypto.h for openSSL */
#ifndef ysSSL_crypto_h__
#ifndef yaSSL_crypto_h__
#define yaSSL_crypto_h__
#ifdef YASSL_PREFIX

View file

@ -224,7 +224,7 @@ void BasicDES::SetKey(const byte* key, word32 /*length*/, CipherDir dir)
byte *const pc1m = buffer; /* place to modify pc1 into */
byte *const pcr = pc1m + 56; /* place to rotate pc1 into */
byte *const ks = pcr + 56;
register int i,j,l;
int i,j,l;
int m;
for (j = 0; j < 56; j++) { /* convert pc1 to bits of key */

View file

@ -217,7 +217,7 @@ extern int heap_write(HP_INFO *info,const uchar *buff);
extern int heap_update(HP_INFO *info,const uchar *old,const uchar *newdata);
extern int heap_rrnd(HP_INFO *info,uchar *buf,uchar *pos);
extern int heap_scan_init(HP_INFO *info);
extern int heap_scan(register HP_INFO *info, uchar *record);
extern int heap_scan(HP_INFO *info, uchar *record);
extern int heap_delete(HP_INFO *info,const uchar *buff);
extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag);
extern int heap_create(const char *name,

View file

@ -366,7 +366,7 @@ int maria_sort_index(HA_CHECK *param, MARIA_HA *info, char * name);
int maria_zerofill(HA_CHECK *param, MARIA_HA *info, const char *name);
int maria_repair_by_sort(HA_CHECK *param, MARIA_HA *info,
const char *name, my_bool rep_quick);
int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
int maria_repair_parallel(HA_CHECK *param, MARIA_HA *info,
const char *name, my_bool rep_quick);
int maria_change_to_newfile(const char *filename, const char *old_ext,
const char *new_ext, time_t backup_time,

View file

@ -373,7 +373,7 @@ typedef struct st_mi_sort_param
int (*key_read)(struct st_mi_sort_param *,void *);
int (*key_write)(struct st_mi_sort_param *, const void *);
void (*lock_in_memory)(HA_CHECK *);
int (*write_keys)(struct st_mi_sort_param *, register uchar **,
int (*write_keys)(struct st_mi_sort_param *, uchar **,
ulonglong , struct st_buffpek *, IO_CACHE *);
my_off_t (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint);
int (*write_key)(struct st_mi_sort_param *, IO_CACHE *,uchar *,
@ -383,16 +383,16 @@ typedef struct st_mi_sort_param
/* functions in mi_check */
void myisamchk_init(HA_CHECK *param);
int chk_status(HA_CHECK *param, MI_INFO *info);
int chk_del(HA_CHECK *param, register MI_INFO *info, ulonglong test_flag);
int chk_del(HA_CHECK *param, MI_INFO *info, ulonglong test_flag);
int chk_size(HA_CHECK *param, MI_INFO *info);
int chk_key(HA_CHECK *param, MI_INFO *info);
int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend);
int mi_repair(HA_CHECK *param, register MI_INFO *info,
int mi_repair(HA_CHECK *param, MI_INFO *info,
char * name, int rep_quick);
int mi_sort_index(HA_CHECK *param, register MI_INFO *info, char * name);
int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
int mi_sort_index(HA_CHECK *param, MI_INFO *info, char * name);
int mi_repair_by_sort(HA_CHECK *param, MI_INFO *info,
const char * name, int rep_quick);
int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
int mi_repair_parallel(HA_CHECK *param, MI_INFO *info,
const char * name, int rep_quick);
int change_to_newfile(const char * filename, const char * old_ext,
const char * new_ext, time_t backup_time, myf myflags);

View file

@ -146,7 +146,7 @@ static bool check_error_mesg(const char *file_name, const char **errmsg)
bool read_texts(const char *file_name, const char *language,
const char ***point, uint error_messages)
{
register uint i;
uint i;
uint count,funktpos;
size_t offset, length;
File file;

View file

@ -2725,7 +2725,7 @@ int Field_decimal::store(double nr)
return 1;
}
reg4 uint i;
uint i;
size_t length;
uchar fyllchar,*to;
char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];

View file

@ -1406,7 +1406,7 @@ public:
// Exactly the same rules with REF access
return can_optimize_keypart_ref(cond, item);
}
friend int cre_myisam(char * name, register TABLE *form, uint options,
friend int cre_myisam(char * name, TABLE *form, uint options,
ulonglong auto_increment_value);
friend class Copy_field;
friend class Item_avg_field;

View file

@ -967,12 +967,12 @@ static inline void store_length(uchar *to, uint length, uint pack_length)
/** Make a sort-key from record. */
static void make_sortkey(register Sort_param *param,
register uchar *to, uchar *ref_pos)
static void make_sortkey(Sort_param *param,
uchar *to, uchar *ref_pos)
{
reg3 Field *field;
reg1 SORT_FIELD *sort_field;
reg5 uint length;
Field *field;
SORT_FIELD *sort_field;
uint length;
for (sort_field=param->local_sortorder ;
sort_field != param->end ;
@ -1214,7 +1214,7 @@ static void make_sortkey(register Sort_param *param,
static void register_used_fields(Sort_param *param)
{
reg1 SORT_FIELD *sort_field;
SORT_FIELD *sort_field;
TABLE *table=param->sort_form;
MY_BITMAP *bitmap= table->read_set;
@ -1425,7 +1425,7 @@ bool check_if_pq_applicable(Sort_param *param,
int merge_many_buff(Sort_param *param, uchar *sort_buffer,
BUFFPEK *buffpek, uint *maxbuffer, IO_CACHE *t_file)
{
register uint i;
uint i;
IO_CACHE t_file2,*from_file,*to_file,*temp;
BUFFPEK *lastbuff;
DBUG_ENTER("merge_many_buff");
@ -1483,7 +1483,7 @@ cleanup:
uint read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
uint rec_length)
{
register uint count;
uint count;
uint length;
if ((count=(uint) MY_MIN((ha_rows) buffpek->max_keys,buffpek->count)))
@ -1787,7 +1787,7 @@ int merge_buffers(Sort_param *param, IO_CACHE *from_file,
}
else
{
register uchar *end;
uchar *end;
src= buffpek->key+offset;
for (end= src+buffpek->mem_count*rec_length ;
src != end ;

View file

@ -2834,7 +2834,7 @@ int handler::ha_rnd_init_with_error(bool scan)
*/
int handler::read_first_row(uchar * buf, uint primary_key)
{
register int error;
int error;
DBUG_ENTER("handler::read_first_row");
/*

View file

@ -5901,8 +5901,8 @@ void Item_func_like::turboBM_compute_bad_character_shifts()
bool Item_func_like::turboBM_matches(const char* text, int text_len) const
{
register int bcShift;
register int turboShift;
int bcShift;
int turboShift;
int shift = pattern_len;
int j = 0;
int u = 0;
@ -5916,7 +5916,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
{
while (j <= tlmpl)
{
register int i= plm1;
int i= plm1;
while (i >= 0 && pattern[i] == text[i + j])
{
i--;
@ -5926,7 +5926,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
if (i < 0)
return 1;
register const int v = plm1 - i;
const int v = plm1 - i;
turboShift = u - v;
bcShift = bmBc[(uint) (uchar) text[i + j]] - plm1 + i;
shift = MY_MAX(turboShift, bcShift);
@ -5947,7 +5947,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
{
while (j <= tlmpl)
{
register int i = plm1;
int i = plm1;
while (i >= 0 && likeconv(cs,pattern[i]) == likeconv(cs,text[i + j]))
{
i--;
@ -5957,7 +5957,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
if (i < 0)
return 1;
register const int v = plm1 - i;
const int v = plm1 - i;
turboShift = u - v;
bcShift = bmBc[(uint) likeconv(cs, text[i + j])] - plm1 + i;
shift = MY_MAX(turboShift, bcShift);

View file

@ -3282,8 +3282,8 @@ longlong Item_func_ord::val_int()
#ifdef USE_MB
if (use_mb(res->charset()))
{
register const char *str=res->ptr();
register uint32 n=0, l=my_ismbchar(res->charset(),str,str+res->length());
const char *str=res->ptr();
uint32 n=0, l=my_ismbchar(res->charset(),str,str+res->length());
if (!l)
return (longlong)((uchar) *str);
while (l--)

View file

@ -1039,7 +1039,7 @@ String *Item_func_reverse::val_str(String *str)
#ifdef USE_MB
if (use_mb(res->charset()))
{
register uint32 l;
uint32 l;
while (ptr < end)
{
if ((l= my_ismbchar(res->charset(),ptr,end)))
@ -1088,7 +1088,7 @@ String *Item_func_replace::val_str(String *str)
bool alloced=0;
#ifdef USE_MB
const char *ptr,*end,*strend,*search,*search_end;
register uint32 l;
uint32 l;
bool binary_cmp;
#endif
THD *thd= 0;
@ -1141,7 +1141,7 @@ redo:
{
if (*ptr == *search)
{
register char *i,*j;
char *i,*j;
i=(char*) ptr+1; j=(char*) search+1;
while (j != search_end)
if (*i++ != *j++) goto skip;
@ -1735,14 +1735,14 @@ String *Item_func_substr_index::val_str(String *str)
const char *search= delimiter->ptr();
const char *search_end= search+delimiter_length;
int32 n=0,c=count,pass;
register uint32 l;
uint32 l;
for (pass=(count>0);pass<2;++pass)
{
while (ptr < end)
{
if (*ptr == *search)
{
register char *i,*j;
char *i,*j;
i=(char*) ptr+1; j=(char*) search+1;
while (j != search_end)
if (*i++ != *j++) goto skip;
@ -1926,7 +1926,7 @@ String *Item_func_rtrim::val_str(String *str)
end= ptr+res->length();
#ifdef USE_MB
char *p=ptr;
register uint32 l;
uint32 l;
#endif
if (remove_length == 1)
{
@ -2011,7 +2011,7 @@ String *Item_func_trim::val_str(String *str)
if (use_mb(collation.collation))
{
char *p=ptr;
register uint32 l;
uint32 l;
loop:
while (ptr + remove_length < end)
{

View file

@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#ifdef __GNUC__
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation
#endif

View file

@ -54,8 +54,8 @@ using std::max;
int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field,
uint *key_length, uint *keypart)
{
reg2 int i;
reg3 KEY *key_info;
int i;
KEY *key_info;
uint fieldpos;
fieldpos= field->offset(record);
@ -511,7 +511,7 @@ int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length)
if (key_part->null_bit)
{
/* This key part allows null values; NULL is lower than everything */
register bool field_is_null= key_part->field->is_null();
bool field_is_null= key_part->field->is_null();
if (*key) // If range key is null
{
/* the range is expecting a null value */

View file

@ -347,7 +347,7 @@ end:
static int lock_external(THD *thd, TABLE **tables, uint count)
{
reg1 uint i;
uint i;
int lock_type,error;
DBUG_ENTER("lock_external");
@ -500,7 +500,7 @@ void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table)
{
if (locked)
{
reg1 uint i;
uint i;
for (i=0; i < locked->table_count; i++)
{
if (locked->table[i] == table)

View file

@ -2430,7 +2430,7 @@ static int find_uniq_filename(char *name, ulong next_log_number)
uint i;
char buff[FN_REFLEN], ext_buf[FN_REFLEN];
struct st_my_dir *dir_info;
reg1 struct fileinfo *file_info;
struct fileinfo *file_info;
ulong max_found, next, number;
size_t buf_length, length;
char *start, *end;
@ -8483,10 +8483,9 @@ void MYSQL_BIN_LOG::set_max_size(ulong max_size_arg)
0 String is not a number
*/
static bool test_if_number(register const char *str,
ulong *res, bool allow_wildcards)
static bool test_if_number(const char *str, ulong *res, bool allow_wildcards)
{
reg2 int flag;
int flag;
const char *start;
DBUG_ENTER("test_if_number");

View file

@ -49,7 +49,7 @@ extern "C" {
*/
int _my_b_net_read(register IO_CACHE *info, uchar *Buffer,
int _my_b_net_read(IO_CACHE *info, uchar *Buffer,
size_t Count __attribute__((unused)))
{
ulong read_length;

View file

@ -60,8 +60,8 @@
#define EXTRA_DEBUG_fflush fflush
#define EXTRA_DEBUG_ASSERT DBUG_ASSERT
#else
static void inline EXTRA_DEBUG_fprintf(...) {}
static int inline EXTRA_DEBUG_fflush(...) { return 0; }
#define EXTRA_DEBUG_fprintf(...)
#define EXTRA_DEBUG_fflush(...)
#define EXTRA_DEBUG_ASSERT(X) do {} while(0)
#endif
#ifdef MYSQL_SERVER

View file

@ -91,7 +91,7 @@ recursion_point:
}
{
register struct LS_STRUCT_NAME *sp0= sp++;
struct LS_STRUCT_NAME *sp0= sp++;
sp->list_len= sp0->list_len >> 1;
sp0->list_len-= sp->list_len;
sp->return_point= 0;
@ -100,7 +100,7 @@ recursion_point:
return_point0:
sp->list1= sorted_list;
{
register struct LS_STRUCT_NAME *sp0= sp++;
struct LS_STRUCT_NAME *sp0= sp++;
list= list_end;
sp->list_len= sp0->list_len;
sp->return_point= 1;
@ -108,9 +108,9 @@ return_point0:
goto recursion_point;
return_point1:
{
register LS_LIST_ITEM **hook= &sorted_list;
register LS_LIST_ITEM *list1= sp->list1;
register LS_LIST_ITEM *list2= sorted_list;
LS_LIST_ITEM **hook= &sorted_list;
LS_LIST_ITEM *list1= sp->list1;
LS_LIST_ITEM *list2= sorted_list;
if (LS_COMPARE_FUNC_CALL(list1, list2))
{

View file

@ -622,7 +622,7 @@ static int init_rr_cache(THD *thd, READ_RECORD *info)
static int rr_from_cache(READ_RECORD *info)
{
reg1 uint i;
uint i;
ulong length;
my_off_t rest_of_file;
int16 error;

View file

@ -217,7 +217,7 @@ static void set_slave_max_allowed_packet(THD *thd, MYSQL *mysql)
void init_thread_mask(int* mask,Master_info* mi,bool inverse)
{
bool set_io = mi->slave_running, set_sql = mi->rli.slave_running;
register int tmp_mask=0;
int tmp_mask=0;
DBUG_ENTER("init_thread_mask");
if (set_io)

View file

@ -10629,7 +10629,7 @@ int fill_schema_applicable_roles(THD *thd, TABLE_LIST *tables, COND *cond)
int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr)
{
reg3 int flag;
int flag;
DBUG_ENTER("wild_case_compare");
DBUG_PRINT("enter",("str: '%s' wildstr: '%s'",str,wildstr));
while (*wildstr)

View file

@ -8011,7 +8011,7 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
List<Item> *sum_func_list, List<Item> *pre_fix,
bool allow_sum_func)
{
reg2 Item *item;
Item *item;
enum_mark_columns save_mark_used_columns= thd->mark_used_columns;
nesting_map save_allow_sum_func= thd->lex->allow_sum_func;
List_iterator<Item> it(fields);

View file

@ -5196,7 +5196,7 @@ public:
inline static int get_cost_calc_buff_size(size_t nkeys, uint key_size,
ulonglong max_in_memory_size)
{
register ulonglong max_elems_in_tree=
ulonglong max_elems_in_tree=
max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size);
return (int) (sizeof(uint)*(1 + nkeys/max_elems_in_tree));
}

View file

@ -338,7 +338,7 @@ static void del_dbopt(const char *path)
static bool write_db_opt(THD *thd, const char *path,
Schema_specification_st *create)
{
register File file;
File file;
char buf[256]; // Should be enough for one option
bool error=1;

View file

@ -87,7 +87,7 @@ static int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic,
LEX_STRING query, bool ignore, bool log_on);
static void end_delayed_insert(THD *thd);
pthread_handler_t handle_delayed_insert(void *arg);
static void unlink_blobs(register TABLE *table);
static void unlink_blobs(TABLE *table);
#endif
static bool check_view_insertability(THD *thd, TABLE_LIST *view);
@ -3081,7 +3081,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
/* Remove pointers from temporary fields to allocated values */
static void unlink_blobs(register TABLE *table)
static void unlink_blobs(TABLE *table)
{
for (Field **ptr=table->field ; *ptr ; ptr++)
{
@ -3092,7 +3092,7 @@ static void unlink_blobs(register TABLE *table)
/* Free blobs stored in current row */
static void free_delayed_insert_blobs(register TABLE *table)
static void free_delayed_insert_blobs(TABLE *table)
{
for (Field **ptr=table->field ; *ptr ; ptr++)
{

View file

@ -1001,7 +1001,7 @@ Lex_input_stream::unescape(CHARSET_INFO *cs, char *to,
bool Lex_input_stream::get_text(LEX_STRING *dst, uint sep,
int pre_skip, int post_skip)
{
reg1 uchar c;
uchar c;
uint found_escape=0;
CHARSET_INFO *cs= m_thd->charset();
@ -1181,7 +1181,7 @@ static inline uint int_token(const char *str,uint length)
*/
bool consume_comment(Lex_input_stream *lip, int remaining_recursions_permitted)
{
reg1 uchar c;
uchar c;
while (! lip->eof())
{
c= lip->yyGet();
@ -1283,7 +1283,7 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd)
static int lex_one_token(YYSTYPE *yylval, THD *thd)
{
reg1 uchar UNINIT_VAR(c);
uchar UNINIT_VAR(c);
bool comment_closed;
int tokval, result_state;
uint length;

View file

@ -7360,7 +7360,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
List<String> *partition_names,
LEX_STRING *option)
{
register TABLE_LIST *ptr;
TABLE_LIST *ptr;
TABLE_LIST *UNINIT_VAR(previous_table_ref); /* The table preceding the current one. */
char *alias_str;
LEX *lex= thd->lex;

View file

@ -404,7 +404,7 @@ static bool send_prep_stmt(Prepared_statement *stmt,
static ulong get_param_length(uchar **packet, ulong len)
{
reg1 uchar *pos= *packet;
uchar *pos= *packet;
if (len < 1)
return 0;
if (*pos < 251)

View file

@ -358,7 +358,7 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
ulong setup_tables_done_option)
{
bool res;
register SELECT_LEX *select_lex = &lex->select_lex;
SELECT_LEX *select_lex = &lex->select_lex;
DBUG_ENTER("handle_select");
MYSQL_SELECT_START(thd->query());

View file

@ -608,8 +608,8 @@ int String::strstr(const String &s,uint32 offset)
if (!s.length())
return ((int) offset); // Empty string is always found
register const char *str = Ptr+offset;
register const char *search=s.ptr();
const char *str = Ptr+offset;
const char *search=s.ptr();
const char *end=Ptr+str_length-s.length()+1;
const char *search_end=s.ptr()+s.length();
skip:
@ -617,7 +617,7 @@ skip:
{
if (*str++ == *search)
{
register char *i,*j;
char *i,*j;
i=(char*) str; j=(char*) search+1;
while (j != search_end)
if (*i++ != *j++) goto skip;
@ -638,8 +638,8 @@ int String::strrstr(const String &s,uint32 offset)
{
if (!s.length())
return offset; // Empty string is always found
register const char *str = Ptr+offset-1;
register const char *search=s.ptr()+s.length()-1;
const char *str = Ptr+offset-1;
const char *search=s.ptr()+s.length()-1;
const char *end=Ptr+s.length()-2;
const char *search_end=s.ptr()-1;
@ -648,7 +648,7 @@ skip:
{
if (*str-- == *search)
{
register char *i,*j;
char *i,*j;
i=(char*) str; j=(char*) search-1;
while (j != search_end)
if (*i-- != *j--) goto skip;

View file

@ -3063,7 +3063,7 @@ partititon_err:
free_share Is 1 if we also want to free table_share
*/
int closefrm(register TABLE *table, bool free_share)
int closefrm(TABLE *table, bool free_share)
{
int error=0;
DBUG_ENTER("closefrm");
@ -3111,7 +3111,7 @@ int closefrm(register TABLE *table, bool free_share)
/* Deallocate temporary blob storage */
void free_blobs(register TABLE *table)
void free_blobs(TABLE *table)
{
uint *ptr, *end;
for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ;

View file

@ -208,7 +208,7 @@ static double get_merge_many_buffs_cost(uint *buffer,
uint last_n_elems, int elem_size,
uint compare_factor)
{
register int i;
int i;
double total_cost= 0.0;
uint *buff_elems= buffer; /* #s of elements in each of merged sequences */

View file

@ -751,7 +751,6 @@ static bool pack_fields(uchar *buff, List<Create_field> &create_fields,
recpos= field->offset+1 + (uint) data_offset;
int3store(buff+5,recpos);
int2store(buff+8,field->pack_flag);
DBUG_ASSERT(field->unireg_check < 256);
buff[10]= (uchar) field->unireg_check;
buff[12]= (uchar) field->interval_id;
buff[13]= (uchar) field->sql_type;

View file

@ -457,7 +457,7 @@ char *ARRAY::GetStringValue(int n)
/***********************************************************************/
bool ARRAY::Find(PVAL valp)
{
register int n;
int n;
PVAL vp;
if (Type != valp->GetType()) {
@ -1065,7 +1065,7 @@ MULAR::MULAR(PGLOBAL g, int n) : CSORT(false)
/***********************************************************************/
int MULAR::Qcompare(int *i1, int *i2)
{
register int i, n = 0;
int i, n = 0;
for (i = 0; i < Narray; i++)
if ((n = Pars[i]->Qcompare(i1, i2)))

View file

@ -178,9 +178,9 @@ void CSORT::DebugSort(int ph, int n, int *base, int *mid, int *tmp)
/***********************************************************************/
int CSORT::Qsortx(void)
{
register int c;
register int lo, hi, min;
register int i, j, rc = 0;
int c;
int lo, hi, min;
int i, j, rc = 0;
// To do: rc should be checked for being used uninitialized
int *top;
#ifdef DEBTRACE
@ -344,7 +344,7 @@ int CSORT::Qsortx(void)
/***********************************************************************/
void CSORT::Qstx(int *base, int *max)
{
register int *i, *j, *jj, *mid, *him, c;
int *i, *j, *jj, *mid, *him, c;
int *tmp;
int lo, hi, rc;
size_t zlo, zhi, cnm;
@ -543,9 +543,9 @@ void CSORT::Qstx(int *base, int *max)
/***********************************************************************/
int CSORT::Qsortc(void)
{
register int c;
register int lo, hi, min;
register int i, j, k, m, rc = 0;
int c;
int lo, hi, min;
int i, j, k, m, rc = 0;
// To do: rc should be checked for being used uninitialized
int *max;
#ifdef DEBTRACE
@ -720,7 +720,7 @@ int CSORT::Qsortc(void)
/***********************************************************************/
void CSORT::Qstc(int *base, int *max)
{
register int *i, *j, *jj, *lt, *eq, *gt, *mid;
int *i, *j, *jj, *lt, *eq, *gt, *mid;
int c = 0, lo, hi, rc;
size_t zlo, zhi, cnm;
@ -907,9 +907,9 @@ void CSORT::Qstc(int *base, int *max)
/***********************************************************************/
void CSORT::Istc(int *base, int *hi, int *max)
{
register int c = 0;
register int *lo;
register int *i, *j;
int c = 0;
int *lo;
int *i, *j;
/*********************************************************************/
/* First put smallest element, which must be in the first THRESH, */

View file

@ -3071,7 +3071,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
strncat(s, res->ptr(), res->length());
if (res->length() < 19)
strcat(s, "1970-01-01 00:00:00" + res->length());
strcat(s, &"1970-01-01 00:00:00"[res->length()]);
strcat(s, "'}");
break;
@ -3101,7 +3101,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
strncat(s, res->ptr(), res->length());
if (res->length() < 19)
strcat(s, "1970-01-01 00:00:00" + res->length());
strcat(s, &"1970-01-01 00:00:00"[res->length()]);
strcat(s, "'}");
break;

View file

@ -2279,7 +2279,7 @@ int ODBConn::GetCatInfo(CATPARM *cap)
int i, irc;
bool b;
PCSZ fnc = "Unknown";
UWORD n;
UWORD n = 0;
SWORD ncol, len, tp;
SQLULEN crow = 0;
PQRYRES qrp = cap->Qrp;

View file

@ -511,7 +511,7 @@ void TYPBLK<TYPE>::SetValues(PVBLK pv, int k, int n)
CheckType(pv)
TYPE *lp = ((TYPBLK*)pv)->Typp;
for (register int i = k; i < n; i++) // TODO
for (int i = k; i < n; i++) // TODO
Typp[i] = lp[i];
} // end of SetValues
@ -805,7 +805,7 @@ void CHRBLK::SetValue(const char *sp, uint len, int n)
if (Blanks) {
// Suppress eventual ending zero and right fill with blanks
for (register int i = len; i < Long; i++)
for (int i = len; i < Long; i++)
p[i] = ' ';
} else if ((signed)len < Long)

View file

@ -272,8 +272,8 @@ void XINDEX::Close(void)
/***********************************************************************/
int XINDEX::Qcompare(int *i1, int *i2)
{
register int k;
register PXCOL kcp;
int k;
PXCOL kcp;
for (kcp = To_KeyCol, k = 0; kcp; kcp = kcp->Next)
if ((k = kcp->Compare(*i1, *i2)))
@ -745,7 +745,7 @@ int XINDEX::ColMaxSame(PXCOL kp)
/***********************************************************************/
bool XINDEX::Reorder(PGLOBAL g __attribute__((unused)))
{
register int i, j, k, n;
int i, j, k, n;
bool sorted = true;
PXCOL kcp;
#if 0
@ -1870,8 +1870,8 @@ int XINDEX::Fetch(PGLOBAL g)
/***********************************************************************/
int XINDEX::FastFind(void)
{
register int curk, sup, inf, i= 0, k, n = 2;
register PXCOL kp, kcp;
int curk, sup, inf, i= 0, k, n = 2;
PXCOL kp, kcp;
//assert((int)nv == Nval);
@ -2209,8 +2209,8 @@ int XINDXS::Fetch(PGLOBAL g)
/***********************************************************************/
int XINDXS::FastFind(void)
{
register int sup, inf, i= 0, n = 2;
register PXCOL kcp = To_KeyCol;
int sup, inf, i= 0, n = 2;
PXCOL kcp = To_KeyCol;
if (Nblk && Op == OP_EQ) {
// Look in block values to find in which block to search
@ -3235,7 +3235,7 @@ void KXYCOL::FillValue(PVAL valp)
int KXYCOL::Compare(int i1, int i2)
{
// Do the actual comparison between values.
register int k = Kblp->CompVal(i1, i2);
int k = Kblp->CompVal(i1, i2);
if (trace(4))
htrc("Compare done result=%d\n", k);
@ -3250,7 +3250,7 @@ int KXYCOL::CompVal(int i)
{
// Do the actual comparison between numerical values.
if (trace(4)) {
register int k = (int)Kblp->CompVal(Valp, (int)i);
int k = (int)Kblp->CompVal(Valp, (int)i);
htrc("Compare done result=%d\n", k);
return k;

View file

@ -97,7 +97,7 @@ extern uint hp_rb_key_length(HP_KEYDEF *keydef, const uchar *key);
extern uint hp_rb_null_key_length(HP_KEYDEF *keydef, const uchar *key);
extern uint hp_rb_var_key_length(HP_KEYDEF *keydef, const uchar *key);
extern my_bool hp_if_null_in_key(HP_KEYDEF *keyinfo, const uchar *record);
extern int hp_close(register HP_INFO *info);
extern int hp_close(HP_INFO *info);
extern void hp_clear(HP_SHARE *info);
extern void hp_clear_keys(HP_SHARE *info);
extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,

View file

@ -208,7 +208,7 @@ class ha_innobase: public handler
char* remote_path);
const char* check_table_options(THD *thd, TABLE* table,
HA_CREATE_INFO* create_info, const bool use_tablespace, const ulint file_format);
int create(const char *name, register TABLE *form,
int create(const char *name, TABLE *form,
HA_CREATE_INFO *create_info);
int truncate();
int delete_table(const char *name);

View file

@ -3044,7 +3044,7 @@ static enum data_file_type maria_row_type(HA_CREATE_INFO *info)
}
int ha_maria::create(const char *name, register TABLE *table_arg,
int ha_maria::create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *ha_create_info)
{
int error;

View file

@ -190,8 +190,7 @@ MARIA_RECORD_POS _ma_write_init_block_record(MARIA_HA *info,
const uchar *record);
my_bool _ma_write_block_record(MARIA_HA *info, const uchar *record);
my_bool _ma_write_abort_block_record(MARIA_HA *info);
my_bool _ma_compare_block_record(register MARIA_HA *info,
register const uchar *record);
my_bool _ma_compare_block_record(MARIA_HA *info, const uchar *record);
void _ma_compact_block_page(MARIA_SHARE *share, uchar *buff, uint rownr,
my_bool extend_block, TrID min_read_from,
uint min_row_length);

View file

@ -109,7 +109,7 @@ typedef struct st_maria_sort_param
int (*key_read)(struct st_maria_sort_param *, uchar *);
int (*key_write)(struct st_maria_sort_param *, const uchar *);
void (*lock_in_memory)(HA_CHECK *);
int (*write_keys)(struct st_maria_sort_param *, register uchar **,
int (*write_keys)(struct st_maria_sort_param *, uchar **,
ulonglong , struct st_buffpek *, IO_CACHE *);
my_off_t (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint);
int (*write_key)(struct st_maria_sort_param *, IO_CACHE *,uchar *,
@ -1040,7 +1040,7 @@ my_off_t _ma_no_keypos_to_recpos(MARIA_SHARE *share, my_off_t pos);
extern my_bool _ma_ck_write(MARIA_HA *info, MARIA_KEY *key);
extern my_bool _ma_enlarge_root(MARIA_HA *info, MARIA_KEY *key,
MARIA_RECORD_POS *root);
int _ma_insert(register MARIA_HA *info, MARIA_KEY *key,
int _ma_insert(MARIA_HA *info, MARIA_KEY *key,
MARIA_PAGE *anc_page, uchar *key_pos, uchar *key_buff,
MARIA_PAGE *father_page, uchar *father_key_pos,
my_bool insert_last);
@ -1082,7 +1082,7 @@ extern void _ma_store_bin_pack_key(MARIA_KEYDEF *keyinfo, uchar *key_pos,
MARIA_KEY_PARAM *s_temp);
extern my_bool _ma_ck_delete(MARIA_HA *info, MARIA_KEY *key);
extern my_bool _ma_ck_real_delete(register MARIA_HA *info, MARIA_KEY *key,
extern my_bool _ma_ck_real_delete(MARIA_HA *info, MARIA_KEY *key,
my_off_t *root);
extern int _ma_readinfo(MARIA_HA *info, int lock_flag, int check_keybuffer);
extern int _ma_writeinfo(MARIA_HA *info, uint options);
@ -1154,7 +1154,7 @@ extern my_bool _ma_fetch_keypage(MARIA_PAGE *page, MARIA_HA *info,
extern my_bool _ma_write_keypage(MARIA_PAGE *page,
enum pagecache_page_lock lock, int level);
extern int _ma_dispose(MARIA_HA *info, my_off_t pos, my_bool page_not_read);
extern my_off_t _ma_new(register MARIA_HA *info, int level,
extern my_off_t _ma_new(MARIA_HA *info, int level,
MARIA_PINNED_PAGE **page_link);
extern my_bool _ma_compact_keypage(MARIA_PAGE *page, TrID min_read_from);
extern uint transid_store_packed(MARIA_HA *info, uchar *to, ulonglong trid);
@ -1342,7 +1342,7 @@ extern MARIA_HA *_ma_test_if_reopen(const char *filename);
my_bool _ma_check_table_is_closed(const char *name, const char *where);
int _ma_open_datafile(MARIA_HA *info, MARIA_SHARE *share);
int _ma_open_keyfile(MARIA_SHARE *share);
void _ma_setup_functions(register MARIA_SHARE *share);
void _ma_setup_functions(MARIA_SHARE *share);
my_bool _ma_dynmap_file(MARIA_HA *info, my_off_t size);
void _ma_remap_file(MARIA_HA *info, my_off_t size);
@ -1424,7 +1424,7 @@ extern my_bool maria_flush_log_for_page_none(PAGECACHE_IO_HOOK_ARGS *args);
extern PAGECACHE *maria_log_pagecache;
extern void ma_set_index_cond_func(MARIA_HA *info, index_cond_func_t func,
void *func_arg);
ICP_RESULT ma_check_index_cond(register MARIA_HA *info, uint keynr, uchar *record);
ICP_RESULT ma_check_index_cond(MARIA_HA *info, uint keynr, uchar *record);
extern my_bool ma_yield_and_check_if_killed(MARIA_HA *info, int inx);
extern my_bool ma_killed_standalone(MARIA_HA *);

View file

@ -2016,7 +2016,7 @@ void ha_myisam::update_create_info(HA_CREATE_INFO *create_info)
}
int ha_myisam::create(const char *name, register TABLE *table_arg,
int ha_myisam::create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *ha_create_info)
{
int error;

View file

@ -536,8 +536,7 @@ extern uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
uchar *key, uchar *keypos,
uint *return_key_length);
extern uint _mi_keylength(MI_KEYDEF *keyinfo, uchar *key);
extern uint _mi_keylength_part(MI_KEYDEF *keyinfo, register uchar *key,
HA_KEYSEG *end);
extern uint _mi_keylength_part(MI_KEYDEF *keyinfo, uchar *key, HA_KEYSEG *end);
extern uchar *_mi_move_key(MI_KEYDEF *keyinfo, uchar *to, uchar *from);
extern int _mi_search_next(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
uint key_length, uint nextflag, my_off_t pos);
@ -716,12 +715,12 @@ my_bool check_table_is_closed(const char *name, const char *where);
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share);
int mi_open_keyfile(MYISAM_SHARE *share);
void mi_setup_functions(register MYISAM_SHARE *share);
void mi_setup_functions(MYISAM_SHARE *share);
my_bool mi_dynmap_file(MI_INFO *info, my_off_t size);
int mi_munmap_file(MI_INFO *info);
void mi_remap_file(MI_INFO *info, my_off_t size);
ICP_RESULT mi_check_index_cond(register MI_INFO *info, uint keynr, uchar *record);
ICP_RESULT mi_check_index_cond(MI_INFO *info, uint keynr, uchar *record);
/* Functions needed by mi_check */
int killed_ptr(HA_CHECK *param);
void mi_check_print_error(HA_CHECK *param, const char *fmt, ...);

View file

@ -1567,7 +1567,7 @@ int ha_myisammrg::create_mrg(const char *name, HA_CREATE_INFO *create_info)
}
int ha_myisammrg::create(const char *name, register TABLE *form,
int ha_myisammrg::create(const char *name, TABLE *form,
HA_CREATE_INFO *create_info)
{
char buff[FN_REFLEN];

View file

@ -2214,7 +2214,7 @@ start_mutex_wait_v1(PSI_mutex_locker_state *state,
if (! pfs_mutex->m_enabled)
return NULL;
register uint flags;
uint flags;
ulonglong timer_start= 0;
if (flag_thread_instrumentation)
@ -2312,7 +2312,7 @@ start_rwlock_wait_v1(PSI_rwlock_locker_state *state,
if (! pfs_rwlock->m_enabled)
return NULL;
register uint flags;
uint flags;
ulonglong timer_start= 0;
if (flag_thread_instrumentation)
@ -2420,7 +2420,7 @@ start_cond_wait_v1(PSI_cond_locker_state *state,
if (! pfs_cond->m_enabled)
return NULL;
register uint flags;
uint flags;
ulonglong timer_start= 0;
if (flag_thread_instrumentation)
@ -2564,7 +2564,7 @@ start_table_io_wait_v1(PSI_table_locker_state *state,
PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
register uint flags;
uint flags;
ulonglong timer_start= 0;
if (flag_thread_instrumentation)
@ -2690,7 +2690,7 @@ start_table_lock_wait_v1(PSI_table_locker_state *state,
DBUG_ASSERT((uint) lock_type < array_elements(table_lock_operation_map));
register uint flags;
uint flags;
ulonglong timer_start= 0;
if (flag_thread_instrumentation)
@ -2798,7 +2798,7 @@ get_thread_file_name_locker_v1(PSI_file_locker_state *state,
if (flag_thread_instrumentation && ! pfs_thread->m_enabled)
return NULL;
register uint flags;
uint flags;
state->m_thread= reinterpret_cast<PSI_thread *> (pfs_thread);
flags= STATE_FLAG_THREAD;
@ -2867,7 +2867,7 @@ get_thread_file_stream_locker_v1(PSI_file_locker_state *state,
if (! pfs_file->m_enabled)
return NULL;
register uint flags;
uint flags;
if (flag_thread_instrumentation)
{
@ -2973,7 +2973,7 @@ get_thread_file_descriptor_locker_v1(PSI_file_locker_state *state,
DBUG_ASSERT(pfs_file->m_class != NULL);
PFS_file_class *klass= pfs_file->m_class;
register uint flags;
uint flags;
if (flag_thread_instrumentation)
{
@ -3062,7 +3062,7 @@ start_socket_wait_v1(PSI_socket_locker_state *state,
if (!pfs_socket->m_enabled || pfs_socket->m_idle)
return NULL;
register uint flags= 0;
uint flags= 0;
ulonglong timer_start= 0;
if (flag_thread_instrumentation)
@ -3321,7 +3321,7 @@ start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint src_
if (!global_idle_class.m_enabled)
return NULL;
register uint flags= 0;
uint flags= 0;
ulonglong timer_start= 0;
if (flag_thread_instrumentation)
@ -3403,7 +3403,7 @@ static void end_idle_wait_v1(PSI_idle_locker* locker)
ulonglong timer_end= 0;
ulonglong wait_time= 0;
register uint flags= state->m_flags;
uint flags= state->m_flags;
if (flags & STATE_FLAG_TIMED)
{
@ -3473,7 +3473,7 @@ static void end_mutex_wait_v1(PSI_mutex_locker* locker, int rc)
DBUG_ASSERT(mutex != NULL);
PFS_thread *thread= reinterpret_cast<PFS_thread *> (state->m_thread);
register uint flags= state->m_flags;
uint flags= state->m_flags;
if (flags & STATE_FLAG_TIMED)
{
@ -3794,7 +3794,7 @@ static void end_table_io_wait_v1(PSI_table_locker* locker)
break;
}
register uint flags= state->m_flags;
uint flags= state->m_flags;
if (flags & STATE_FLAG_TIMED)
{
@ -3865,7 +3865,7 @@ static void end_table_lock_wait_v1(PSI_table_locker* locker)
PFS_single_stat *stat= & table->m_table_stat.m_lock_stat.m_stat[state->m_index];
register uint flags= state->m_flags;
uint flags= state->m_flags;
if (flags & STATE_FLAG_TIMED)
{
@ -4028,7 +4028,7 @@ static void start_file_wait_v1(PSI_file_locker *locker,
PSI_file_locker_state *state= reinterpret_cast<PSI_file_locker_state*> (locker);
DBUG_ASSERT(state != NULL);
register uint flags= state->m_flags;
uint flags= state->m_flags;
if (flags & STATE_FLAG_TIMED)
{
@ -4064,7 +4064,7 @@ static void end_file_wait_v1(PSI_file_locker *locker,
ulonglong timer_end= 0;
ulonglong wait_time= 0;
PFS_byte_stat *byte_stat;
register uint flags= state->m_flags;
uint flags= state->m_flags;
size_t bytes= ((int)byte_count > -1 ? byte_count : 0);
PFS_file_stat *file_stat;
@ -4419,7 +4419,7 @@ get_thread_statement_locker_v1(PSI_statement_locker_state *state,
if (! klass->m_enabled)
return NULL;
register uint flags;
uint flags;
if (flag_thread_instrumentation)
{
@ -4596,7 +4596,7 @@ static void start_statement_v1(PSI_statement_locker *locker,
PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker);
DBUG_ASSERT(state != NULL);
register uint flags= state->m_flags;
uint flags= state->m_flags;
ulonglong timer_start= 0;
if (flags & STATE_FLAG_TIMED)
@ -4798,7 +4798,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
ulonglong timer_end= 0;
ulonglong wait_time= 0;
register uint flags= state->m_flags;
uint flags= state->m_flags;
if (flags & STATE_FLAG_TIMED)
{
@ -5024,7 +5024,7 @@ static void end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count)
ulonglong timer_end= 0;
ulonglong wait_time= 0;
PFS_byte_stat *byte_stat;
register uint flags= state->m_flags;
uint flags= state->m_flags;
size_t bytes= ((int)byte_count > -1 ? byte_count : 0);
switch (state->m_operation)

View file

@ -80,7 +80,7 @@ inline uint randomized_index(const void *ptr, uint max_size)
static uint seed1= 0;
static uint seed2= 0;
uint result;
register intptr value;
intptr value;
if (unlikely(max_size == 0))
return 0;

View file

@ -6302,7 +6302,7 @@ int spider_panic(
int spider_db_init(
void *p
) {
int error_num, roop_count;
int error_num = 0, roop_count;
uint dbton_id = 0;
handlerton *spider_hton = (handlerton *)p;
DBUG_ENTER("spider_db_init");