summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rw-r--r--extra/comp_err.c62
-rw-r--r--extra/innochecksum.c14
-rw-r--r--extra/my_print_defaults.c16
-rw-r--r--extra/mysql_waitpid.c2
-rw-r--r--extra/perror.c10
-rw-r--r--extra/replace.c103
-rw-r--r--extra/resolve_stack_dump.c16
-rw-r--r--extra/resolveip.c4
8 files changed, 114 insertions, 113 deletions
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 3f7664405ad..6902d63dbc8 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -99,31 +99,31 @@ static struct my_option my_long_options[]=
{"debug", '#', "This is a non-debug version. Catch this and exit",
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (gptr *) & default_dbug_option,
- (gptr *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log", (uchar**) & default_dbug_option,
+ (uchar**) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"debug-info", 'T', "Print some debug info at exit.", (gptr *) & info_flag,
- (gptr *) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug-info", 'T', "Print some debug info at exit.", (uchar**) & info_flag,
+ (uchar**) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"charset", 'C', "Charset dir", (gptr *) & charsets_dir,
- (gptr *) & charsets_dir,
+ {"charset", 'C', "Charset dir", (uchar**) & charsets_dir,
+ (uchar**) & charsets_dir,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"in_file", 'F', "Input file", (gptr *) & TXTFILE, (gptr *) & TXTFILE,
+ {"in_file", 'F', "Input file", (uchar**) & TXTFILE, (uchar**) & TXTFILE,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"out_dir", 'D', "Output base directory", (gptr *) & DATADIRECTORY,
- (gptr *) & DATADIRECTORY,
+ {"out_dir", 'D', "Output base directory", (uchar**) & DATADIRECTORY,
+ (uchar**) & DATADIRECTORY,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"out_file", 'O', "Output filename (errmsg.sys)", (gptr *) & OUTFILE,
- (gptr *) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"header_file", 'H', "mysqld_error.h file ", (gptr *) & HEADERFILE,
- (gptr *) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"name_file", 'N', "mysqld_ername.h file ", (gptr *) & NAMEFILE,
- (gptr *) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"state_file", 'S', "sql_state.h file", (gptr *) & STATEFILE,
- (gptr *) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"out_file", 'O', "Output filename (errmsg.sys)", (uchar**) & OUTFILE,
+ (uchar**) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"header_file", 'H', "mysqld_error.h file ", (uchar**) & HEADERFILE,
+ (uchar**) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"name_file", 'N', "mysqld_ername.h file ", (uchar**) & NAMEFILE,
+ (uchar**) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"state_file", 'S', "sql_state.h file", (uchar**) & STATEFILE,
+ (uchar**) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -329,21 +329,21 @@ static int create_sys_files(struct languages *lang_head,
/* continue with header of the errmsg.sys file */
length= ftell(to) - HEADER_LENGTH - row_count * 2;
- bzero((gptr) head, HEADER_LENGTH);
- bmove((byte *) head, (byte *) file_head, 4);
+ bzero((uchar*) head, HEADER_LENGTH);
+ bmove((uchar *) head, (uchar *) file_head, 4);
head[4]= 1;
int2store(head + 6, length);
int2store(head + 8, row_count);
head[30]= csnum;
my_fseek(to, 0l, MY_SEEK_SET, MYF(0));
- if (my_fwrite(to, (byte*) head, HEADER_LENGTH, MYF(MY_WME | MY_FNABP)))
+ if (my_fwrite(to, (uchar*) head, HEADER_LENGTH, MYF(MY_WME | MY_FNABP)))
goto err;
for (i= 0; i < row_count; i++)
{
int2store(head, file_pos[i]);
- if (my_fwrite(to, (byte*) head, 2, MYF(MY_WME | MY_FNABP)))
+ if (my_fwrite(to, (uchar*) head, 2, MYF(MY_WME | MY_FNABP)))
goto err;
}
my_fclose(to, MYF(0));
@@ -362,7 +362,7 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
struct errors *tmp_error, *next_error;
uint count, i;
- my_free((gptr) default_language, MYF(0));
+ my_free((uchar*) default_language, MYF(0));
for (tmp_lang= lang_head; tmp_lang; tmp_lang= next_language)
{
@@ -370,7 +370,7 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
my_free(tmp_lang->lang_short_name, MYF(0));
my_free(tmp_lang->lang_long_name, MYF(0));
my_free(tmp_lang->charset, MYF(0));
- my_free((gptr) tmp_lang, MYF(0));
+ my_free((uchar*) tmp_lang, MYF(0));
}
for (tmp_error= error_head; tmp_error; tmp_error= next_error)
@@ -381,17 +381,17 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
{
struct message *tmp;
tmp= dynamic_element(&tmp_error->msg, i, struct message*);
- my_free((gptr) tmp->lang_short_name, MYF(0));
- my_free((gptr) tmp->text, MYF(0));
+ my_free((uchar*) tmp->lang_short_name, MYF(0));
+ my_free((uchar*) tmp->text, MYF(0));
}
delete_dynamic(&tmp_error->msg);
if (tmp_error->sql_code1[0])
- my_free((gptr) tmp_error->sql_code1, MYF(0));
+ my_free((uchar*) tmp_error->sql_code1, MYF(0));
if (tmp_error->sql_code2[0])
- my_free((gptr) tmp_error->sql_code2, MYF(0));
- my_free((gptr) tmp_error->er_name, MYF(0));
- my_free((gptr) tmp_error, MYF(0));
+ my_free((uchar*) tmp_error->sql_code2, MYF(0));
+ my_free((uchar*) tmp_error->er_name, MYF(0));
+ my_free((uchar*) tmp_error, MYF(0));
}
}
@@ -471,7 +471,7 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
current_error->er_name, current_message.lang_short_name);
DBUG_RETURN(0);
}
- if (insert_dynamic(&current_error->msg, (byte *) & current_message))
+ if (insert_dynamic(&current_error->msg, (uchar *) & current_message))
DBUG_RETURN(0);
continue;
}
@@ -534,7 +534,7 @@ static uint parse_error_offset(char *str)
end= 0;
ioffset= (uint) my_strtoll10(soffset, &end, &error);
- my_free((gptr) soffset, MYF(0));
+ my_free((uchar*) soffset, MYF(0));
DBUG_RETURN(ioffset);
}
diff --git a/extra/innochecksum.c b/extra/innochecksum.c
index 33f925a4cad..524637a1729 100644
--- a/extra/innochecksum.c
+++ b/extra/innochecksum.c
@@ -51,10 +51,10 @@
/* another argument to specify page ranges... seek to right spot and go from there */
typedef unsigned long int ulint;
-typedef unsigned char byte;
+typedef unsigned char uchar;
/* innodb function in name; modified slightly to not have the ASM version (lots of #ifs that didn't apply) */
-ulint mach_read_from_4(byte *b)
+ulint mach_read_from_4(uchar *b)
{
return( ((ulint)(b[0]) << 24)
+ ((ulint)(b[1]) << 16)
@@ -78,7 +78,7 @@ ulint
ut_fold_binary(
/*===========*/
/* out: folded value */
- byte* str, /* in: string of bytes */
+ uchar* str, /* in: string of bytes */
ulint len) /* in: length */
{
ulint i;
@@ -98,7 +98,7 @@ ulint
buf_calc_page_new_checksum(
/*=======================*/
/* out: checksum */
- byte* page) /* in: buffer page */
+ uchar* page) /* in: buffer page */
{
ulint checksum;
@@ -123,7 +123,7 @@ ulint
buf_calc_page_old_checksum(
/*=======================*/
/* out: checksum */
- byte* page) /* in: buffer page */
+ uchar* page) /* in: buffer page */
{
ulint checksum;
@@ -138,7 +138,7 @@ buf_calc_page_old_checksum(
int main(int argc, char **argv)
{
FILE *f; /* our input file */
- byte *p; /* storage of pages read */
+ uchar *p; /* storage of pages read */
int bytes; /* bytes read count */
ulint ct; /* current page number (0 based) */
int now; /* current time */
@@ -256,7 +256,7 @@ int main(int argc, char **argv)
}
/* allocate buffer for reading (so we don't realloc every time) */
- p= (byte *)malloc(UNIV_PAGE_SIZE);
+ p= (uchar *)malloc(UNIV_PAGE_SIZE);
/* main checksumming loop */
ct= start_page;
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index f5f7e68c9e6..06f7e51c380 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -47,30 +47,30 @@ static struct my_option my_long_options[] =
added if the file has no extension)
*/
{"config-file", 'c', "Deprecated, please use --defaults-file instead. Name of config file to read; if no extension is given, default extension (e.g., .ini or .cnf) will be added",
- (gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
- (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
+ (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"defaults-file", 'c', "Like --config-file, except: if first option, then read this file only, do not read global or per-user config files; should be the first option",
- (gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"defaults-extra-file", 'e',
"Read this file after the global config file and before the config file in the users home directory; should be the first option",
- (gptr*) &my_defaults_extra_file, (gptr*) &my_defaults_extra_file, 0,
+ (uchar**) &my_defaults_extra_file, (uchar**) &my_defaults_extra_file, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"defaults-group-suffix", 'g',
"In addition to the given groups, read also groups with this suffix",
- (gptr*) &my_defaults_group_suffix, (gptr*) &my_defaults_group_suffix,
+ (uchar**) &my_defaults_group_suffix, (uchar**) &my_defaults_group_suffix,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extra-file", 'e',
"Deprecated. Synonym for --defaults-extra-file.",
- (gptr*) &my_defaults_extra_file,
- (gptr*) &my_defaults_extra_file, 0, GET_STR,
+ (uchar**) &my_defaults_extra_file,
+ (uchar**) &my_defaults_extra_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c
index a166e6b15af..42465998862 100644
--- a/extra/mysql_waitpid.c
+++ b/extra/mysql_waitpid.c
@@ -38,7 +38,7 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0},
{"verbose", 'v',
"Be more verbose. Give a warning, if kill can't handle signal 0.",
- (gptr*) &verbose, (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
diff --git a/extra/perror.c b/extra/perror.c
index c49869be681..9b87bfa3d2a 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -41,18 +41,18 @@ static struct my_option my_long_options[] =
{"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
- {"ndb", 257, "Ndbcluster storage engine specific error codes.", (gptr*) &ndb_code,
- (gptr*) &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"ndb", 257, "Ndbcluster storage engine specific error codes.", (uchar**) &ndb_code,
+ (uchar**) &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
#ifdef HAVE_SYS_ERRLIST
{"all", 'a', "Print all the error messages and the number.",
- (gptr*) &print_all_codes, (gptr*) &print_all_codes, 0, GET_BOOL, NO_ARG,
+ (uchar**) &print_all_codes, (uchar**) &print_all_codes, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#endif
{"silent", 's', "Only print the error message.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"verbose", 'v', "Print error code and message (default).", (gptr*) &verbose,
- (gptr*) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Print error code and message (default).", (uchar**) &verbose,
+ (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"version", 'V', "Displays version information and exits.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
diff --git a/extra/replace.c b/extra/replace.c
index de0a4b05764..f7112403b06 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -51,7 +51,7 @@
typedef struct st_pointer_array { /* when using array-strings */
TYPELIB typelib; /* Pointer to strings */
- byte *str; /* Strings is here */
+ uchar *str; /* Strings is here */
int7 *flag; /* Flag about each var. */
uint array_allocs,max_count,length,max_length;
} POINTER_ARRAY;
@@ -83,14 +83,14 @@ static int static_get_options(int *argc,char * * *argv);
static int get_replace_strings(int *argc,char * * *argv,
POINTER_ARRAY *from_array,
POINTER_ARRAY *to_array);
-static int insert_pointer_name(POINTER_ARRAY *pa, my_string name);
+static int insert_pointer_name(POINTER_ARRAY *pa, char * name);
static void free_pointer_array(POINTER_ARRAY *pa);
static int convert_pipe(REPLACE *,FILE *,FILE *);
-static int convert_file(REPLACE *, my_string);
-static REPLACE *init_replace(my_string *from, my_string *to,uint count,
- my_string word_end_chars);
-static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
- my_string from);
+static int convert_file(REPLACE *, char *);
+static REPLACE *init_replace(char * *from, char * *to,uint count,
+ char * word_end_chars);
+static uint replace_strings(REPLACE *rep, char * *start,uint *max_length,
+ char * from);
static int initialize_buffer(void);
static void reset_buffer(void);
static void free_buffer(void);
@@ -245,10 +245,10 @@ POINTER_ARRAY *from_array,*to_array;
return 0;
}
-static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
+static int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
{
uint i,length,old_count;
- byte *new_pos;
+ uchar *new_pos;
const char **new_array;
DBUG_ENTER("insert_pointer_name");
@@ -256,16 +256,16 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
{
if (!(pa->typelib.type_names=(const char **)
my_malloc(((PC_MALLOC-MALLOC_OVERHEAD)/
- (sizeof(my_string)+sizeof(*pa->flag))*
- (sizeof(my_string)+sizeof(*pa->flag))),MYF(MY_WME))))
+ (sizeof(char *)+sizeof(*pa->flag))*
+ (sizeof(char *)+sizeof(*pa->flag))),MYF(MY_WME))))
DBUG_RETURN(-1);
- if (!(pa->str= (byte*) my_malloc((uint) (PS_MALLOC-MALLOC_OVERHEAD),
+ if (!(pa->str= (uchar*) my_malloc((uint) (PS_MALLOC-MALLOC_OVERHEAD),
MYF(MY_WME))))
{
- my_free((gptr) pa->typelib.type_names,MYF(0));
+ my_free((uchar*) pa->typelib.type_names,MYF(0));
DBUG_RETURN (-1);
}
- pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(byte*)+
+ pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(uchar*)+
sizeof(*pa->flag));
pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
pa->length=0;
@@ -277,7 +277,7 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
{
pa->max_length=(pa->length+length+MALLOC_OVERHEAD+PS_MALLOC-1)/PS_MALLOC;
pa->max_length=pa->max_length*PS_MALLOC-MALLOC_OVERHEAD;
- if (!(new_pos= (byte*) my_realloc((gptr) pa->str,
+ if (!(new_pos= (uchar*) my_realloc((uchar*) pa->str,
(uint) pa->max_length,
MYF(MY_WME))))
DBUG_RETURN(1);
@@ -295,17 +295,17 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
int len;
pa->array_allocs++;
len=(PC_MALLOC*pa->array_allocs - MALLOC_OVERHEAD);
- if (!(new_array=(const char **) my_realloc((gptr) pa->typelib.type_names,
+ if (!(new_array=(const char **) my_realloc((uchar*) pa->typelib.type_names,
(uint) len/
- (sizeof(byte*)+sizeof(*pa->flag))*
- (sizeof(byte*)+sizeof(*pa->flag)),
+ (sizeof(uchar*)+sizeof(*pa->flag))*
+ (sizeof(uchar*)+sizeof(*pa->flag)),
MYF(MY_WME))))
DBUG_RETURN(1);
pa->typelib.type_names=new_array;
old_count=pa->max_count;
- pa->max_count=len/(sizeof(byte*) + sizeof(*pa->flag));
+ pa->max_count=len/(sizeof(uchar*) + sizeof(*pa->flag));
pa->flag= (int7*) (pa->typelib.type_names+pa->max_count);
- memcpy((byte*) pa->flag,(my_string) (pa->typelib.type_names+old_count),
+ memcpy((uchar*) pa->flag,(char *) (pa->typelib.type_names+old_count),
old_count*sizeof(*pa->flag));
}
pa->flag[pa->typelib.count]=0; /* Reset flag */
@@ -324,9 +324,9 @@ static void free_pointer_array(reg1 POINTER_ARRAY *pa)
if (pa->typelib.count)
{
pa->typelib.count=0;
- my_free((gptr) pa->typelib.type_names,MYF(0));
+ my_free((uchar*) pa->typelib.type_names,MYF(0));
pa->typelib.type_names=0;
- my_free((gptr) pa->str,MYF(0));
+ my_free((uchar*) pa->str,MYF(0));
}
return;
} /* free_pointer_array */
@@ -380,23 +380,23 @@ static int get_next_bit(REP_SET *set,uint lastpos);
static short find_set(REP_SETS *sets,REP_SET *find);
static short find_found(FOUND_SET *found_set,uint table_offset,
int found_offset);
-static uint start_at_word(my_string pos);
-static uint end_of_word(my_string pos);
-static uint replace_len(my_string pos);
+static uint start_at_word(char * pos);
+static uint end_of_word(char * pos);
+static uint replace_len(char * pos);
static uint found_sets=0;
/* Init a replace structure for further calls */
-static REPLACE *init_replace(my_string *from, my_string *to,uint count,
- my_string word_end_chars)
+static REPLACE *init_replace(char * *from, char * *to,uint count,
+ char * word_end_chars)
{
uint i,j,states,set_nr,len,result_len,max_length,found_end,bits_set,bit_nr;
int used_sets,chr;
short default_state;
char used_chars[LAST_CHAR_CODE],is_word_end[256];
- my_string pos,to_pos,*to_array;
+ char * pos, *to_pos, **to_array;
REP_SETS sets;
REP_SET *set,*start_states,*word_states,*new_set;
FOLLOWS *follow,*follow_ptr;
@@ -441,7 +441,7 @@ static REPLACE *init_replace(my_string *from, my_string *to,uint count,
if (!(follow=(FOLLOWS*) my_malloc((states+2)*sizeof(FOLLOWS),MYF(MY_WME))))
{
free_sets(&sets);
- my_free((gptr) found_set,MYF(0));
+ my_free((uchar*) found_set,MYF(0));
DBUG_RETURN(0);
}
@@ -632,12 +632,12 @@ static REPLACE *init_replace(my_string *from, my_string *to,uint count,
if ((replace=(REPLACE*) my_malloc(sizeof(REPLACE)*(sets.count)+
sizeof(REPLACE_STRING)*(found_sets+1)+
- sizeof(my_string)*count+result_len,
+ sizeof(char *)*count+result_len,
MYF(MY_WME | MY_ZEROFILL))))
{
rep_str=(REPLACE_STRING*) (replace+sets.count);
- to_array=(my_string*) (rep_str+found_sets+1);
- to_pos=(my_string) (to_array+count);
+ to_array=(char **) (rep_str+found_sets+1);
+ to_pos=(char *) (to_array+count);
for (i=0 ; i < count ; i++)
{
to_array[i]=to_pos;
@@ -663,9 +663,9 @@ static REPLACE *init_replace(my_string *from, my_string *to,uint count,
replace[i].next[j]=(REPLACE*) (rep_str+(-sets.set[i].next[j]-1));
}
}
- my_free((gptr) follow,MYF(0));
+ my_free((uchar*) follow,MYF(0));
free_sets(&sets);
- my_free((gptr) found_set,MYF(0));
+ my_free((uchar*) found_set,MYF(0));
DBUG_PRINT("exit",("Replace table has %d states",sets.count));
DBUG_RETURN(replace);
}
@@ -681,7 +681,7 @@ static int init_sets(REP_SETS *sets,uint states)
if (!(sets->bit_buffer=(uint*) my_malloc(sizeof(uint)*sets->size_of_bits*
SET_MALLOC_HUNC,MYF(MY_WME))))
{
- my_free((gptr) sets->set,MYF(0));
+ my_free((uchar*) sets->set,MYF(0));
return 1;
}
return 0;
@@ -713,13 +713,13 @@ static REP_SET *make_new_set(REP_SETS *sets)
return set;
}
count=sets->count+sets->invisible+SET_MALLOC_HUNC;
- if (!(set=(REP_SET*) my_realloc((gptr) sets->set_buffer,
+ if (!(set=(REP_SET*) my_realloc((uchar*) sets->set_buffer,
sizeof(REP_SET)*count,
MYF(MY_WME))))
return 0;
sets->set_buffer=set;
sets->set=set+sets->invisible;
- if (!(bit_buffer=(uint*) my_realloc((gptr) sets->bit_buffer,
+ if (!(bit_buffer=(uint*) my_realloc((uchar*) sets->bit_buffer,
(sizeof(uint)*sets->size_of_bits)*count,
MYF(MY_WME))))
return 0;
@@ -742,8 +742,8 @@ static void free_last_set(REP_SETS *sets)
static void free_sets(REP_SETS *sets)
{
- my_free((gptr)sets->set_buffer,MYF(0));
- my_free((gptr)sets->bit_buffer,MYF(0));
+ my_free((uchar*)sets->set_buffer,MYF(0));
+ my_free((uchar*)sets->bit_buffer,MYF(0));
return;
}
@@ -770,13 +770,13 @@ static void or_bits(REP_SET *to,REP_SET *from)
static void copy_bits(REP_SET *to,REP_SET *from)
{
- memcpy((byte*) to->bits,(byte*) from->bits,
+ memcpy((uchar*) to->bits,(uchar*) from->bits,
(size_t) (sizeof(uint) * to->size_of_bits));
}
static int cmp_bits(REP_SET *set1,REP_SET *set2)
{
- return bcmp((byte*) set1->bits,(byte*) set2->bits,
+ return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
sizeof(uint) * set1->size_of_bits);
}
@@ -847,21 +847,21 @@ static short find_found(FOUND_SET *found_set,uint table_offset,
/* Return 1 if regexp starts with \b or ends with \b*/
-static uint start_at_word(my_string pos)
+static uint start_at_word(char * pos)
{
return (((!bcmp(pos,"\\b",2) && pos[2]) || !bcmp(pos,"\\^",2)) ? 1 : 0);
}
-static uint end_of_word(my_string pos)
+static uint end_of_word(char * pos)
{
- my_string end=strend(pos);
+ char * end=strend(pos);
return ((end > pos+2 && !bcmp(end-2,"\\b",2)) ||
(end >= pos+2 && !bcmp(end-2,"\\$",2))) ?
1 : 0;
}
-static uint replace_len(my_string str)
+static uint replace_len(char * str)
{
uint len=0;
while (*str)
@@ -877,12 +877,12 @@ static uint replace_len(my_string str)
/* The actual loop */
-static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
- my_string from)
+static uint replace_strings(REPLACE *rep, char **start, uint *max_length,
+ char *from)
{
reg1 REPLACE *rep_pos;
reg2 REPLACE_STRING *rep_str;
- my_string to,end,pos,new;
+ char *to, *end, *pos, *new;
end=(to= *start) + *max_length-1;
rep_pos=rep+1;
@@ -903,7 +903,7 @@ static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
}
if (!(rep_str = ((REPLACE_STRING*) rep_pos))->replace_string)
return (uint) (to - *start)-1;
- updated=1; /* Some my_string is replaced */
+ updated=1; /* Some char * is replaced */
to-=rep_str->to_offset;
for (pos=rep_str->replace_string; *pos ; pos++)
{
@@ -1047,7 +1047,7 @@ FILE *in,*out;
}
-static int convert_file(REPLACE *rep, my_string name)
+static int convert_file(REPLACE *rep, char * name)
{
int error;
FILE *in,*out;
@@ -1056,6 +1056,7 @@ static int convert_file(REPLACE *rep, my_string name)
char link_name[FN_REFLEN];
#endif
File temp_file;
+ size_t dir_buff_length;
DBUG_ENTER("convert_file");
/* check if name is a symlink */
@@ -1065,7 +1066,7 @@ static int convert_file(REPLACE *rep, my_string name)
#endif
if (!(in= my_fopen(org_name,O_RDONLY,MYF(MY_WME))))
DBUG_RETURN(1);
- dirname_part(dir_buff,org_name);
+ dirname_part(dir_buff, org_name, &dir_buff_length);
if ((temp_file= create_temp_file(tempname, dir_buff, "PR", O_WRONLY,
MYF(MY_WME))) < 0)
{
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index 04ab8a30f0d..5606c17ecf3 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -53,10 +53,10 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"symbols-file", 's', "Use specified symbols file.", (gptr*) &sym_fname,
- (gptr*) &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"symbols-file", 's', "Use specified symbols file.", (uchar**) &sym_fname,
+ (uchar**) &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"numeric-dump-file", 'n', "Read the dump from specified file.",
- (gptr*) &dump_fname, (gptr*) &dump_fname, 0, GET_STR, REQUIRED_ARG,
+ (uchar**) &dump_fname, (uchar**) &dump_fname, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -235,7 +235,7 @@ static void init_sym_table()
SYM_ENTRY se;
if (init_sym_entry(&se, buf))
continue;
- if (insert_dynamic(&sym_table, (gptr)&se))
+ if (insert_dynamic(&sym_table, (uchar*)&se))
die("insert_dynamic() failed - looks like we are out of memory");
}
@@ -255,7 +255,7 @@ static void verify_sort()
for (i = 0; i < sym_table.elements; i++)
{
SYM_ENTRY se;
- get_dynamic(&sym_table, (gptr)&se, i);
+ get_dynamic(&sym_table, (uchar*)&se, i);
if (se.addr < last)
die("sym table does not appear to be sorted, did you forget \
--numeric-sort arg to nm? trouble addr = %p, last = %p", se.addr, last);
@@ -267,16 +267,16 @@ static void verify_sort()
static SYM_ENTRY* resolve_addr(uchar* addr, SYM_ENTRY* se)
{
uint i;
- get_dynamic(&sym_table, (gptr)se, 0);
+ get_dynamic(&sym_table, (uchar*)se, 0);
if (addr < se->addr)
return 0;
for (i = 1; i < sym_table.elements; i++)
{
- get_dynamic(&sym_table, (gptr)se, i);
+ get_dynamic(&sym_table, (uchar*)se, i);
if (addr < se->addr)
{
- get_dynamic(&sym_table, (gptr)se, i - 1);
+ get_dynamic(&sym_table, (uchar*)se, i - 1);
return se;
}
}
diff --git a/extra/resolveip.c b/extra/resolveip.c
index 5bbecab5e6b..b61c0871aaf 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -43,7 +43,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"info", 'I', "Synonym for --help.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"silent", 's', "Be more silent.", (gptr*) &silent, (gptr*) &silent,
+ {"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Displays version information and exits.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -83,7 +83,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return 0;
}
-/*static my_string load_default_groups[]= { "resolveip","client",0 }; */
+/*static char * load_default_groups[]= { "resolveip","client",0 }; */
static int get_options(int *argc,char ***argv)
{