diff options
author | unknown <jani@a193-229-222-105.elisa-laajakaista.fi> | 2005-09-23 16:47:08 +0300 |
---|---|---|
committer | unknown <jani@a193-229-222-105.elisa-laajakaista.fi> | 2005-09-23 16:47:08 +0300 |
commit | 832638929320aa3ebd5b2fefe75eba6f2413f1b6 (patch) | |
tree | dabaf9b38c2c72433e000b36b0a628d9d36fbb38 /myisam | |
parent | dba6991085bfeef3e0d9388ef65369fde38cbb7a (diff) | |
download | mariadb-git-832638929320aa3ebd5b2fefe75eba6f2413f1b6.tar.gz |
Several fixes revelaled by Intel compiler.
cmd-line-utils/readline/complete.c:
Added a cast.
dbug/my_main.c:
Added an include to avoid implicit declaration of
my_thread_global_init()
include/my_global.h:
undef cannot be used on this predefined name.
Since it is a custom fix for gcc 2.8.0, let's make it only
effective in that case.
include/my_sys.h:
Added a new type, TYPE_NOT_SET.
myisam/ft_boolean_search.c:
Added casts.
myisam/mi_key.c:
Added cast.
myisam/mi_open.c:
Added cast.
Changed function types.
myisam/mi_test1.c:
Added cast.
myisam/myisamchk.c:
Added cast.
myisam/myisamdef.h:
Changed function type.
myisam/myisampack.c:
Added casts.
myisam/sp_key.c:
Added cast.
mysys/mf_iocache.c:
Fixed invalid use of 0 to info->type. According to comment it
should not have been set, but in earlier code by setting it
to 0 would have been same as setting it to READ_CACHE. This
probably was not desired, potential bug.
server-tools/instance-manager/instance_options.cc:
Fixed a typo.
server-tools/instance-manager/protocol.cc:
Changed enum to int.
Changed char to uchar.
Added casts.
sql/mysql_priv.h:
Bit overflow.
sql/sql_base.cc:
Removed unused label. The code below label was unused too, because
there is a return just before.
sql/sql_parse.cc:
Removed unneccessary extra argument.
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/ft_boolean_search.c | 3 | ||||
-rw-r--r-- | myisam/mi_key.c | 2 | ||||
-rw-r--r-- | myisam/mi_open.c | 7 | ||||
-rw-r--r-- | myisam/mi_test1.c | 5 | ||||
-rw-r--r-- | myisam/myisamchk.c | 2 | ||||
-rw-r--r-- | myisam/myisamdef.h | 4 | ||||
-rw-r--r-- | myisam/myisampack.c | 18 | ||||
-rw-r--r-- | myisam/sp_key.c | 2 |
8 files changed, 24 insertions, 19 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index c18984c7584..19f0ef77136 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -473,7 +473,8 @@ static int _ftb_check_phrase(const byte *s0, const byte *e0, for (;;) { n_word= (FT_WORD *)phrase_element->data; - if (my_strnncoll(cs, h_word.pos, h_word.len, n_word->pos, n_word->len)) + if (my_strnncoll(cs, (const uchar *) h_word.pos, h_word.len, + (const uchar *) n_word->pos, n_word->len)) break; if (! (phrase_element= phrase_element->next)) DBUG_RETURN(1); diff --git a/myisam/mi_key.c b/myisam/mi_key.c index ae50900a190..4cabfc91197 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -358,7 +358,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, byte *blob_ptr; DBUG_ENTER("_mi_put_key_in_record"); - blob_ptr= info->lastkey2; /* Place to put blob parts */ + blob_ptr= (byte*) info->lastkey2; /* Place to put blob parts */ key=(byte*) info->lastkey; /* KEy that was read */ key_end=key+info->lastkey_length; for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 82663e0c318..ffc418894e3 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -199,7 +199,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) DBUG_PRINT("warning",("saved_base_info_length: %d base_info_length: %d", len,MI_BASE_INFO_SIZE)) } - disk_pos=my_n_base_info_read((uchar*) disk_cache + base_pos, &share->base); + disk_pos= (char*) + my_n_base_info_read((uchar*) disk_cache + base_pos, &share->base); share->state.state_length=base_pos; if (!(open_flags & HA_OPEN_FOR_REPAIR) && @@ -863,7 +864,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite) } -char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state) +uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state) { uint i,keys,key_parts,key_blocks; memcpy_fixed(&state->header,ptr, sizeof(state->header)); @@ -974,7 +975,7 @@ uint mi_base_info_write(File file, MI_BASE_INFO *base) } -char *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base) +uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base) { base->keystart = mi_sizekorr(ptr); ptr +=8; base->max_data_file_length = mi_sizekorr(ptr); ptr +=8; diff --git a/myisam/mi_test1.c b/myisam/mi_test1.c index 5727c699469..60225ccc7f3 100644 --- a/myisam/mi_test1.c +++ b/myisam/mi_test1.c @@ -237,7 +237,7 @@ static int run_test(const char *filename) pos=HA_OFFSET_ERROR; } if (found != row_count) - printf("Found %ld of %ld rows\n", found,row_count); + printf("Found %ld of %ld rows\n", (ulong) found, (ulong) row_count); } if (!silent) @@ -303,7 +303,8 @@ static int run_test(const char *filename) if ((error=mi_rrnd(file,read_record,i == 1 ? 0L : HA_OFFSET_ERROR)) == -1) { if (found != row_count-deleted) - printf("Found only %ld of %ld rows\n",found,row_count-deleted); + printf("Found only %ld of %ld rows\n", (ulong) found, + (ulong) (row_count - deleted)); break; } if (!error) diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 10308408b1f..ff2ccfd15fd 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -705,7 +705,7 @@ get_one_option(int optid, fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); exit(1); } - check_param.stats_method= method-1; + check_param.stats_method= (enum_mi_stats_method) (method-1); break; } #ifdef DEBUG /* Only useful if debugging */ diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 82f7fd7360e..3f4306b32aa 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -679,10 +679,10 @@ extern uint read_pack_length(uint version, const uchar *buf, ulong *length); extern uint calc_pack_length(uint version, ulong length); uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite); -char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state); +uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state); uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead); uint mi_base_info_write(File file, MI_BASE_INFO *base); -char *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base); +uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base); int mi_keyseg_write(File file, const HA_KEYSEG *keyseg); char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg); uint mi_keydef_write(File file, MI_KEYDEF *keydef); diff --git a/myisam/myisampack.c b/myisam/myisampack.c index 3b091cd6ea2..225f7f1a830 100644 --- a/myisam/myisampack.c +++ b/myisam/myisampack.c @@ -2008,7 +2008,7 @@ static char *hexdigits(ulonglong value) static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees, my_off_t tot_elements,my_off_t filelength) { - byte *buff=file_buffer.pos; + byte *buff= (byte*) file_buffer.pos; bzero(buff,HEAD_LENGTH); memcpy_fixed(buff,myisam_pack_file_magic,4); @@ -2024,7 +2024,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees, if (test_only) return 0; VOID(my_seek(file_buffer.file,0L,MY_SEEK_SET,MYF(0))); - return my_write(file_buffer.file,file_buffer.pos,HEAD_LENGTH, + return my_write(file_buffer.file,(const byte *) file_buffer.pos,HEAD_LENGTH, MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0; } @@ -2472,7 +2472,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts) { if (flush_buffer((ulong) max_calc_length + (ulong) max_pack_length)) break; - record_pos=file_buffer.pos; + record_pos= (byte*) file_buffer.pos; file_buffer.pos+=max_pack_length; for (start_pos=record, count= huff_counts; count < end_count ; count++) { @@ -2795,7 +2795,8 @@ static char *make_old_name(char *new_name, char *old_name) static void init_file_buffer(File file, pbool read_buffer) { file_buffer.file=file; - file_buffer.buffer=my_malloc(ALIGN_SIZE(RECORD_CACHE_SIZE),MYF(MY_WME)); + file_buffer.buffer= (uchar*) my_malloc(ALIGN_SIZE(RECORD_CACHE_SIZE), + MYF(MY_WME)); file_buffer.end=file_buffer.buffer+ALIGN_SIZE(RECORD_CACHE_SIZE)-8; file_buffer.pos_in_file=0; error_on_write=0; @@ -2837,7 +2838,8 @@ static int flush_buffer(ulong neaded_length) file_buffer.pos_in_file+=length; if (test_only) return 0; - if (error_on_write|| my_write(file_buffer.file,file_buffer.buffer, + if (error_on_write|| my_write(file_buffer.file, + (const byte*) file_buffer.buffer, length, MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL))) { @@ -2850,13 +2852,13 @@ static int flush_buffer(ulong neaded_length) { char *tmp; neaded_length+=256; /* some margin */ - tmp=my_realloc(file_buffer.buffer, neaded_length,MYF(MY_WME)); + tmp= my_realloc((char*) file_buffer.buffer, neaded_length,MYF(MY_WME)); if (!tmp) return 1; file_buffer.pos= ((uchar*) tmp + (ulong) (file_buffer.pos - file_buffer.buffer)); - file_buffer.buffer=tmp; - file_buffer.end=tmp+neaded_length-8; + file_buffer.buffer= (uchar*) tmp; + file_buffer.end= (uchar*) (tmp+neaded_length-8); } return 0; } diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 1d43f89cba9..77cecdc0931 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -142,7 +142,7 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, { if ((*wkb) > end - 8) return -1; - get_double(&ord, *wkb); + get_double(&ord, (const byte*) *wkb); (*wkb)+= 8; if (ord < *mbr) float8store((char*) mbr, ord); |