Commit e8150697 authored by Davi Arnaut's avatar Davi Arnaut

WL#5498: Remove dead and unused source code

Remove workarounds for ancient systems.
parent 68cd3bce
......@@ -90,12 +90,6 @@ extern char _dig_vec_lower[];
#ifndef strmov
#define strmov_overlapp(A,B) strmov(A,B)
#define strmake_overlapp(A,B,C) strmake(A,B,C)
#endif
#ifdef BAD_MEMCPY /* Problem with gcc on Alpha */
#define memcpy_fixed(A,B,C) bmove((A),(B),(C))
#else
#define memcpy_fixed(A,B,C) memcpy((A),(B),(C))
#endif
/* Prototypes for string functions */
......
......@@ -341,18 +341,6 @@ C_MODE_END
#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
#endif
/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */
#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_MINOR__ == 8)
#undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */
#define __LONG_MAX__ 2147483647
#endif
/* egcs 1.1.2 has a problem with memcpy on Alpha */
#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
#define BAD_MEMCPY
#endif
#if defined(_lint) && !defined(lint)
#define lint
#endif
......@@ -1263,8 +1251,8 @@ do { doubleget_union _tmp; \
((uchar*) &def_temp)[7]=(M)[0];\
(V) = def_temp; } while(0)
#else
#define float4get(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
#define float4store(V,M) memcpy_fixed((uchar*) V,(uchar*) (&M),sizeof(float))
#define float4get(V,M) memcpy(&V, (M), sizeof(float))
#define float4store(V,M) memcpy(V, (&M), sizeof(float))
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\
......@@ -1334,12 +1322,12 @@ do { doubleget_union _tmp; \
*(((char*)T)+1)=(((A) >> 16));\
*(((char*)T)+0)=(((A) >> 24)); } while(0)
#define floatget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*)(&V),sizeof(float))
#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
#define floatget(V,M) memcpy(&V, (M), sizeof(float))
#define floatstore(T,V) memcpy((T), (void*) (&V), sizeof(float))
#define doubleget(V,M) memcpy(&V, (M), sizeof(double))
#define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double))
#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong))
#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong))
#else
......@@ -1350,15 +1338,15 @@ do { doubleget_union _tmp; \
#define shortstore(T,V) int2store(T,V)
#define longstore(T,V) int4store(T,V)
#ifndef floatstore
#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) (&V),sizeof(float))
#define floatget(V,M) memcpy_fixed((uchar*) &V, (uchar*) (M), sizeof(float))
#define floatstore(T,V) memcpy((T), (void *) (&V), sizeof(float))
#define floatget(V,M) memcpy(&V, (M), sizeof(float))
#endif
#ifndef doubleget
#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
#define doubleget(V,M) memcpy(&V, (M), sizeof(double))
#define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double))
#endif /* doubleget */
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong))
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong))
#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong))
#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong))
#endif /* WORDS_BIGENDIAN */
......
......@@ -575,7 +575,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
void free_defaults(char **argv)
{
MEM_ROOT ptr;
memcpy_fixed((char*) &ptr,(char *) argv - sizeof(ptr), sizeof(ptr));
memcpy(&ptr, ((char *) argv) - sizeof(ptr), sizeof(ptr));
free_root(&ptr,MYF(0));
}
......
......@@ -138,7 +138,7 @@ void sigwait_setup(sigset_t *set)
sact.sa_flags = 0;
sact.sa_handler = px_handle_sig;
memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
memcpy(&sact.sa_mask, set, sizeof(*set)); /* handler isn't thread_safe */
sigemptyset(&unblock_mask);
pthread_sigmask(SIG_UNBLOCK,(sigset_t*) 0,&rev_sigwait_set);
......@@ -164,7 +164,7 @@ void sigwait_setup(sigset_t *set)
}
}
}
memcpy_fixed(&sigwait_set,set,sizeof(*set));
memcpy(&sigwait_set, set, sizeof(*set));
pthread_sigmask(SIG_BLOCK,(sigset_t*) set,(sigset_t*) 0);
pthread_sigmask(SIG_UNBLOCK,&unblock_mask,(sigset_t*) 0);
}
......@@ -252,7 +252,7 @@ void *sigwait_thread(void *set_arg)
struct sigaction sact;
sact.sa_flags = 0;
sact.sa_handler = sigwait_handle_sig;
memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */
memcpy(&sact.sa_mask, set, sizeof(*set)); /* handler isn't thread_safe */
sigemptyset(&pending_set);
for (i = 1; i <= sizeof(pending_set)*8; i++)
......
......@@ -4143,7 +4143,7 @@ int Field_float::store(double nr)
}
else
#endif
memcpy_fixed(ptr,(uchar*) &j,sizeof(j));
memcpy(ptr, &j, sizeof(j));
return error;
}
......@@ -4166,7 +4166,7 @@ double Field_float::val_real(void)
}
else
#endif
memcpy_fixed((uchar*) &j,ptr,sizeof(j));
memcpy(&j, ptr, sizeof(j));
return ((double) j);
}
......@@ -4180,7 +4180,7 @@ longlong Field_float::val_int(void)
}
else
#endif
memcpy_fixed((uchar*) &j,ptr,sizeof(j));
memcpy(&j, ptr, sizeof(j));
return (longlong) rint(j);
}
......@@ -4197,7 +4197,7 @@ String *Field_float::val_str(String *val_buffer,
}
else
#endif
memcpy_fixed((uchar*) &nr,ptr,sizeof(nr));
memcpy(&nr, ptr, sizeof(nr));
uint to_length=max(field_length,70);
val_buffer->alloc(to_length);
......@@ -4235,8 +4235,8 @@ int Field_float::cmp(const uchar *a_ptr, const uchar *b_ptr)
else
#endif
{
memcpy_fixed(&a,a_ptr,sizeof(float));
memcpy_fixed(&b,b_ptr,sizeof(float));
memcpy(&a, a_ptr, sizeof(float));
memcpy(&b, b_ptr, sizeof(float));
}
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
......@@ -4253,7 +4253,7 @@ void Field_float::sort_string(uchar *to,uint length __attribute__((unused)))
}
else
#endif
memcpy_fixed(&nr,ptr,sizeof(float));
memcpy(&nr, ptr, sizeof(float));
uchar *tmp= to;
if (nr == (float) 0.0)
......@@ -4264,7 +4264,7 @@ void Field_float::sort_string(uchar *to,uint length __attribute__((unused)))
else
{
#ifdef WORDS_BIGENDIAN
memcpy_fixed(tmp,&nr,sizeof(nr));
memcpy(tmp, &nr, sizeof(nr));
#else
tmp[0]= ptr[3]; tmp[1]=ptr[2]; tmp[2]= ptr[1]; tmp[3]=ptr[0];
#endif
......@@ -7442,7 +7442,7 @@ double Field_blob::val_real(void)
uint32 length;
CHARSET_INFO *cs;
memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
memcpy(&blob, ptr+packlength, sizeof(char*));
if (!blob)
return 0.0;
length= get_length(ptr);
......@@ -7456,7 +7456,7 @@ longlong Field_blob::val_int(void)
ASSERT_COLUMN_MARKED_FOR_READ;
int not_used;
char *blob;
memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
memcpy(&blob, ptr+packlength, sizeof(char*));
if (!blob)
return 0;
uint32 length=get_length(ptr);
......@@ -7468,7 +7468,7 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
{
ASSERT_COLUMN_MARKED_FOR_READ;
char *blob;
memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
memcpy(&blob, ptr+packlength, sizeof(char*));
if (!blob)
val_ptr->set("",0,charset()); // A bit safer than ->length(0)
else
......@@ -7482,7 +7482,7 @@ my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
ASSERT_COLUMN_MARKED_FOR_READ;
const char *blob;
size_t length;
memcpy_fixed(&blob, ptr+packlength, sizeof(const uchar*));
memcpy(&blob, ptr+packlength, sizeof(const uchar*));
if (!blob)
{
blob= "";
......@@ -7510,8 +7510,8 @@ int Field_blob::cmp_max(const uchar *a_ptr, const uchar *b_ptr,
uint max_length)
{
uchar *blob1,*blob2;
memcpy_fixed(&blob1,a_ptr+packlength,sizeof(char*));
memcpy_fixed(&blob2,b_ptr+packlength,sizeof(char*));
memcpy(&blob1, a_ptr+packlength, sizeof(char*));
memcpy(&blob2, b_ptr+packlength, sizeof(char*));
uint a_len= get_length(a_ptr), b_len= get_length(b_ptr);
set_if_smaller(a_len, max_length);
set_if_smaller(b_len, max_length);
......@@ -7525,8 +7525,8 @@ int Field_blob::cmp_binary(const uchar *a_ptr, const uchar *b_ptr,
char *a,*b;
uint diff;
uint32 a_length,b_length;
memcpy_fixed(&a,a_ptr+packlength,sizeof(char*));
memcpy_fixed(&b,b_ptr+packlength,sizeof(char*));
memcpy(&a, a_ptr+packlength, sizeof(char*));
memcpy(&b, b_ptr+packlength, sizeof(char*));
a_length=get_length(a_ptr);
if (a_length > max_length)
a_length=max_length;
......@@ -7607,7 +7607,7 @@ int Field_blob::key_cmp(const uchar *key_ptr, uint max_key_length)
{
uchar *blob1;
uint blob_length=get_length(ptr);
memcpy_fixed(&blob1,ptr+packlength,sizeof(char*));
memcpy(&blob1, ptr+packlength, sizeof(char*));
CHARSET_INFO *cs= charset();
uint local_char_length= max_key_length / cs->mbmaxlen;
local_char_length= my_charpos(cs, blob1, blob1+blob_length,
......@@ -7685,7 +7685,7 @@ void Field_blob::sort_string(uchar *to,uint length)
break;
}
}
memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
memcpy(&blob, ptr+packlength, sizeof(char*));
blob_length=my_strnxfrm(field_charset,
to, length, blob, blob_length);
......@@ -8654,7 +8654,7 @@ String *Field_bit::val_str(String *val_buffer,
mi_int8store(buff,bits);
val_buffer->alloc(length);
memcpy_fixed((char*) val_buffer->ptr(), buff+8-length, length);
memcpy((char *) val_buffer->ptr(), buff+8-length, length);
val_buffer->length(length);
val_buffer->set_charset(&my_charset_bin);
return val_buffer;
......
......@@ -1762,22 +1762,22 @@ public:
void put_length(uchar *pos, uint32 length);
inline void get_ptr(uchar **str)
{
memcpy_fixed((uchar*) str,ptr+packlength,sizeof(uchar*));
memcpy(str, ptr+packlength, sizeof(uchar*));
}
inline void get_ptr(uchar **str, uint row_offset)
{
memcpy_fixed((uchar*) str,ptr+packlength+row_offset,sizeof(char*));
memcpy(str, ptr+packlength+row_offset, sizeof(char*));
}
inline void set_ptr(uchar *length, uchar *data)
{
memcpy(ptr,length,packlength);
memcpy_fixed(ptr+packlength,&data,sizeof(char*));
memcpy(ptr+packlength, &data,sizeof(char*));
}
void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, uchar *data)
{
uchar *ptr_ofs= ADD_TO_PTR(ptr,ptr_diff,uchar*);
store_length(ptr_ofs, packlength, length);
memcpy_fixed(ptr_ofs+packlength,&data,sizeof(char*));
memcpy(ptr_ofs+packlength, &data, sizeof(char*));
}
inline void set_ptr(uint32 length, uchar *data)
{
......@@ -1796,7 +1796,7 @@ public:
return 1;
}
tmp=(uchar*) value.ptr();
memcpy_fixed(ptr+packlength,&tmp,sizeof(char*));
memcpy(ptr+packlength, &tmp, sizeof(char*));
return 0;
}
virtual uchar *pack(uchar *to, const uchar *from,
......
......@@ -286,7 +286,7 @@ static void do_copy_blob(Copy_field *copy)
{
ulong length=((Field_blob*) copy->from_field)->get_length();
((Field_blob*) copy->to_field)->store_length(length);
memcpy_fixed(copy->to_ptr,copy->from_ptr,sizeof(char*));
memcpy(copy->to_ptr, copy->from_ptr, sizeof(char*));
}
static void do_conv_blob(Copy_field *copy)
......
......@@ -1665,7 +1665,7 @@ void change_double_for_sort(double nr,uchar *to)
else
{
#ifdef WORDS_BIGENDIAN
memcpy_fixed(tmp,&nr,sizeof(nr));
memcpy(tmp, &nr, sizeof(nr));
#else
{
uchar *ptr= (uchar*) &nr;
......
......@@ -126,7 +126,7 @@ static void prepare_hostname_cache_key(const char *ip_string,
DBUG_ASSERT(ip_string_length < HOST_ENTRY_KEY_SIZE);
memset(ip_key, 0, HOST_ENTRY_KEY_SIZE);
memcpy_fixed(ip_key, ip_string, ip_string_length);
memcpy(ip_key, ip_string, ip_string_length);
}
static inline Host_entry *hostname_cache_search(const char *ip_key)
......@@ -148,7 +148,7 @@ static bool add_hostname_impl(const char *ip_key, const char *hostname)
char *hostname_copy;
memcpy_fixed(&entry->ip_key, ip_key, HOST_ENTRY_KEY_SIZE);
memcpy(&entry->ip_key, ip_key, HOST_ENTRY_KEY_SIZE);
if (hostname_size)
{
......
......@@ -133,7 +133,6 @@ typedef long long longlong;
#include <string.h>
#define strmov(a,b) stpcpy(a,b)
#define bzero(a,b) memset(a,0,b)
#define memcpy_fixed(a,b,c) memcpy(a,b,c)
#endif
#endif
#include <mysql.h>
......@@ -778,7 +777,7 @@ char *lookup(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
}
pthread_mutex_unlock(&LOCK_hostname);
#endif
memcpy_fixed((char*) &in,(char*) *hostent->h_addr_list, sizeof(in.s_addr));
memcpy(&in, *hostent->h_addr_list, sizeof(in.s_addr));
*res_length= (ulong) (strmov(result, inet_ntoa(in)) - result);
return result;
}
......
......@@ -807,15 +807,15 @@ int ha_tina::find_current_row(uchar *buf)
Field_blob *blob= *(Field_blob**) field;
uchar *src, *tgt;
uint length, packlength;
packlength= blob->pack_length_no_ptr();
length= blob->get_length(blob->ptr);
memcpy_fixed(&src, blob->ptr + packlength, sizeof(char*));
memcpy(&src, blob->ptr + packlength, sizeof(char*));
if (src)
{
tgt= (uchar*) alloc_root(&blobroot, length);
bmove(tgt, src, length);
memcpy_fixed(blob->ptr + packlength, &tgt, sizeof(char*));
memcpy(blob->ptr + packlength, &tgt, sizeof(char*));
}
}
}
......
......@@ -2752,9 +2752,9 @@ void ha_federated::position(const uchar *record __attribute__ ((unused)))
position_called= TRUE;
/* Store result set address. */
memcpy_fixed(ref, &stored_result, sizeof(MYSQL_RES *));
memcpy(ref, &stored_result, sizeof(MYSQL_RES *));
/* Store data cursor position. */
memcpy_fixed(ref + sizeof(MYSQL_RES *), &current_position,
memcpy(ref + sizeof(MYSQL_RES *), &current_position,
sizeof(MYSQL_ROW_OFFSET));
DBUG_VOID_RETURN;
}
......@@ -2780,11 +2780,11 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos)
ha_statistic_increment(&SSV::ha_read_rnd_count);
/* Get stored result set. */
memcpy_fixed(&result, pos, sizeof(MYSQL_RES *));
memcpy(&result, pos, sizeof(MYSQL_RES *));
DBUG_ASSERT(result);
/* Set data cursor position. */
memcpy_fixed(&result->data_cursor, pos + sizeof(MYSQL_RES *),
sizeof(MYSQL_ROW_OFFSET));
memcpy(&result->data_cursor, pos + sizeof(MYSQL_RES *),
sizeof(MYSQL_ROW_OFFSET));
/* Read a row. */
ret_val= read_next(buf, result);
MYSQL_READ_ROW_DONE(ret_val);
......
......@@ -390,7 +390,7 @@ int ha_heap::rnd_pos(uchar * buf, uchar *pos)
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
FALSE);
ha_statistic_increment(&SSV::ha_read_rnd_count);
memcpy_fixed((char*) &heap_position, pos, sizeof(HEAP_PTR));
memcpy(&heap_position, pos, sizeof(HEAP_PTR));
error=heap_rrnd(file, buf, heap_position);
table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_READ_ROW_DONE(error);
......
......@@ -39,7 +39,7 @@ static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
{
word->weight=LWS_IN_USE;
docstat->sum+=word->weight;
memcpy_fixed((docstat->list)++,word,sizeof(FT_WORD));
memcpy((docstat->list)++, word, sizeof(FT_WORD));
return 0;
}
......
......@@ -83,8 +83,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
if (ftsi->seg->flag & HA_BLOB_PART)
{
ftsi->len=_mi_calc_blob_length(ftsi->seg->bit_start,ftsi->pos);
memcpy_fixed((char*) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start,
sizeof(char*));
memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*));
DBUG_RETURN(1);
}
ftsi->len=ftsi->seg->length;
......
......@@ -995,7 +995,7 @@ uint _mi_rec_pack(MI_INFO *info, register uchar *to,
char *temp_pos;
size_t tmp_length=length-portable_sizeof_char_ptr;
memcpy((uchar*) to,from,tmp_length);
memcpy_fixed(&temp_pos,from+tmp_length,sizeof(char*));
memcpy(&temp_pos,from+tmp_length,sizeof(char*));
memcpy(to+tmp_length,temp_pos,(size_t) blob->length);
to+=tmp_length+blob->length;
}
......@@ -1310,9 +1310,9 @@ ulong _mi_rec_unpack(register MI_INFO *info, register uchar *to, uchar *from,
from_left - size_length < blob_length ||
from_left - size_length - blob_length < min_pack_length)
goto err;
memcpy((uchar*) to,(uchar*) from,(size_t) size_length);
memcpy(to, from, (size_t) size_length);
from+=size_length;
memcpy_fixed((uchar*) to+size_length,(uchar*) &from,sizeof(char*));
memcpy(to+size_length, &from, sizeof(char*));
from+=blob_length;
}
else
......
......@@ -139,7 +139,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
else if (keyseg->flag & HA_BLOB_PART)
{
uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos);
memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*));
memcpy(&pos,pos+keyseg->bit_start,sizeof(char*));
set_if_smaller(length,tmp_length);
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
......
......@@ -149,7 +149,7 @@ void _myisam_log_record(enum myisam_log_commands command, MI_INFO *info,
blob != end ;
blob++)
{
memcpy_fixed((uchar*) &pos, record+blob->offset+blob->pack_length,
memcpy(&pos, record+blob->offset+blob->pack_length,
sizeof(char*));
(void) mysql_file_write(myisam_log_file, pos, blob->length, MYF(0));
}
......
......@@ -858,7 +858,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
key_blocks=state->header.max_block_size_index;
DBUG_ENTER("mi_state_info_write");
memcpy_fixed(ptr,&state->header,sizeof(state->header));
memcpy(ptr, &state->header, sizeof(state->header));
ptr+=sizeof(state->header);
/* open_count must be first because of _mi_mark_file_changed ! */
......@@ -917,7 +917,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
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));
memcpy(&state->header, ptr, sizeof(state->header));
ptr +=sizeof(state->header);
keys=(uint) state->header.keys;
key_parts=mi_uint2korr(state->header.key_parts);
......
......@@ -1051,8 +1051,7 @@ static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
}
decode_bytes(rec,bit_buff,bit_buff->blob_pos,bit_buff->blob_pos+length);
_my_store_blob_length((uchar*) to,pack_length,length);
memcpy_fixed((char*) to+pack_length,(char*) &bit_buff->blob_pos,
sizeof(char*));
memcpy((char*) to+pack_length, &bit_buff->blob_pos, sizeof(char*));
bit_buff->blob_pos+=length;
}
}
......
......@@ -411,7 +411,7 @@ static void create_record(uchar *record,uint rownr)
tmp=strlen((char*) blob_key);
int4store(pos,tmp);
ptr=blob_key;
memcpy_fixed(pos+4,&ptr,sizeof(char*));
memcpy(pos+4, &ptr, sizeof(char*));
pos+=recinfo[1].length;
}
else if (recinfo[1].type == FIELD_VARCHAR)
......@@ -439,7 +439,7 @@ static void create_record(uchar *record,uint rownr)
tmp=strlen((char*) blob_record);
int4store(pos,tmp);
ptr=blob_record;
memcpy_fixed(pos+4,&ptr,sizeof(char*));
memcpy(pos+4, &ptr, sizeof(char*));
}
else if (recinfo[2].type == FIELD_VARCHAR)
{
......@@ -468,10 +468,10 @@ static void update_record(uchar *record)
uchar *column,*ptr;
int length;
length=uint4korr(pos); /* Long blob */
memcpy_fixed(&column,pos+4,sizeof(char*));
memcpy(&column, pos+4, sizeof(char*));
memcpy(blob_key,column,length); /* Move old key */
ptr=blob_key;
memcpy_fixed(pos+4,&ptr,sizeof(char*)); /* Store pointer to new key */
memcpy(pos+4, &ptr, sizeof(char*)); /* Store pointer to new key */
if (keyinfo[0].seg[0].type != HA_KEYTYPE_NUM)
default_charset_info->cset->casedn(default_charset_info,
(char*) blob_key, length,
......@@ -501,13 +501,13 @@ static void update_record(uchar *record)
uchar *column;
int length;
length=uint4korr(pos);
memcpy_fixed(&column,pos+4,sizeof(char*));
memcpy(&column, pos+4, sizeof(char*));
memcpy(blob_record,column,length);
bfill(blob_record+length,20,'.'); /* Make it larger */
length+=20;
int4store(pos,length);
column= blob_record;
memcpy_fixed(pos+4,&column,sizeof(char*));
memcpy(pos+4, &column, sizeof(char*));
}
else if (recinfo[2].type == FIELD_VARCHAR)
{
......
......@@ -1030,7 +1030,7 @@ static void put_blob_in_record(uchar *blob_pos, char **blob_buffer)
for (i=0 ; i < length ; i++)
(*blob_buffer)[i]=(char) (length+i);
int4store(blob_pos,length);
memcpy_fixed(blob_pos+4,(char*) blob_buffer,sizeof(char*));
memcpy(blob_pos+4, blob_buffer, sizeof(char*));
}
else
{
......
......@@ -458,7 +458,7 @@ int test_update(MI_INFO *file,int id,int lock_type)
}
}
}
memcpy_fixed(new_record.id,record.id,sizeof(record.id));
memcpy(new_record.id, record.id, sizeof(record.id));
tmp=rnd(20000)+40000;
int4store(new_record.nr,tmp);
if (!mi_update(file,record.id,new_record.id))
......
......@@ -111,7 +111,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record)
else if (keyseg->flag & HA_BLOB_PART)
{
uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos);
memcpy_fixed((uchar*) &pos,pos+keyseg->bit_start,sizeof(char*));
memcpy(&pos, pos+keyseg->bit_start, sizeof(char*));
if (!length || length > tmp_length)
length=tmp_length; /* The whole blob */
}
......@@ -206,8 +206,8 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b,
set_if_smaller(a_length, keyseg->length);
set_if_smaller(b_length, keyseg->length);
}
memcpy_fixed((uchar*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*));
memcpy_fixed((uchar*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*));
memcpy(&pos_a, pos_a+keyseg->bit_start, sizeof(char*));
memcpy(&pos_b, pos_b+keyseg->bit_start, sizeof(char*));
}
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 ||
type == HA_KEYTYPE_VARTEXT2)
......
......@@ -619,7 +619,7 @@ static int examine_log(char * file_name, char **table_names)
case MI_LOG_LOCK:
if (my_b_read(&cache,(uchar*) head,sizeof(lock_command)))
goto err;
memcpy_fixed(&lock_command,head,sizeof(lock_command));
memcpy(&lock_command, head, sizeof(lock_command));
if (verbose && !record_pos_file &&
(!table_names[0] || (curr_file_info && curr_file_info->used)))
printf_log("%s: %s(%d) -> %d\n",FILENAME(curr_file_info),
......@@ -728,7 +728,7 @@ static void fix_blob_pointers(MI_INFO *info, uchar *record)
blob != end ;
blob++)
{
memcpy_fixed(record+blob->offset+blob->pack_length,&pos,sizeof(char*));
memcpy(record+blob->offset+blob->pack_length, &pos, sizeof(char*));
pos+=_mi_calc_blob_length(blob->pack_length,record+blob->offset);
}
}
......
......@@ -1040,7 +1040,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
{
uint field_length=count->field_length -portable_sizeof_char_ptr;
ulong blob_length= _mi_calc_blob_length(field_length, start_pos);
memcpy_fixed((char*) &pos, start_pos+field_length,sizeof(char*));
memcpy(&pos, start_pos+field_length, sizeof(char*));
end_pos=pos+blob_length;
tot_blob_length+=blob_length;
set_if_bigger(count->max_length,blob_length);
......@@ -1889,7 +1889,7 @@ static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees)
i->tree->tree_pack_length+j->tree->tree_pack_length+
ALLOWED_JOIN_DIFF)
{
memcpy_fixed((uchar*) i->counts,(uchar*) count.counts,
memcpy(i->counts, count.counts,
sizeof(count.counts[0])*256);
my_free(j->tree->element_buffer);
j->tree->element_buffer=0;
......@@ -2040,7 +2040,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
uchar *buff= (uchar*) file_buffer.pos;
bzero(buff,HEAD_LENGTH);
memcpy_fixed(buff,myisam_pack_file_magic,4);
memcpy(buff,myisam_pack_file_magic,4);
int4store(buff+4,head_length);
int4store(buff+8, mrg->min_pack_length);
int4store(buff+12,mrg->max_pack_length);
......@@ -2697,8 +2697,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
DBUG_PRINT("fields", ("FIELD_BLOB %lu bytes, bits: %2u",
blob_length, count->length_bits));
write_bits(blob_length,count->length_bits);
memcpy_fixed(&blob,end_pos-portable_sizeof_char_ptr,
sizeof(char*));
memcpy(&blob, end_pos-portable_sizeof_char_ptr, sizeof(char*));
blob_end=blob+blob_length;
/* Encode the blob bytes. */
for ( ; blob < blob_end ; blob++)
......
......@@ -47,7 +47,7 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
pos = (uchar*)record + keyseg->start;
dlen = _mi_calc_blob_length(keyseg->bit_start, pos);
memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*));
memcpy(&dptr, pos + keyseg->bit_start, sizeof(char*));
if (!dptr)
{
my_errno= HA_ERR_NULL_IN_SPATIAL;
......
......@@ -310,7 +310,7 @@ static void print_record(uchar * record, my_off_t offs,const char * tail)
len=sint4korr(pos);
pos+=4;
printf(" len=%d ",len);
memcpy_fixed(&ptr,pos,sizeof(char*));
memcpy(&ptr, pos, sizeof(char*));
if (ptr)
rtree_PrintWKB((uchar*) ptr,SPDIMS);
else
......@@ -328,23 +328,23 @@ static void create_linestring(uchar *record,uint rownr)
double x[200];
int i,j;
int npoints=2;
for(j=0;j<npoints;j++)
for(i=0;i<SPDIMS;i++)
x[i+j*SPDIMS]=rownr*j;
bzero((char*) record,MAX_REC_LENGTH);
*pos=0x01; /* DEL marker */
pos++;
memset(blob_key,0,sizeof(blob_key));
tmp=rtree_CreateLineStringWKB(x,SPDIMS,npoints, (uchar*) blob_key);
int4store(pos,tmp);
pos+=4;
ptr=blob_key;
memcpy_fixed(pos,&ptr,sizeof(char*));
memcpy(pos, &ptr, sizeof(char*));
}
......@@ -353,7 +353,7 @@ static void create_key(uchar *key,uint rownr)
double c=rownr;
uchar *pos;
uint i;
bzero(key,MAX_REC_LENGTH);
for (pos=key, i=0; i<2*SPDIMS; i++)
{
......
......@@ -95,9 +95,8 @@ static void copy_events_waits(PFS_events_waits *dest,
/* Signal readers they are about to read garbage ... */
dest->m_wait_class= NO_WAIT_CLASS;
/* ... that this can generate. */
memcpy_fixed(dest_body,
source_body,
sizeof(PFS_events_waits) - sizeof(events_waits_class));
memcpy(dest_body, source_body,
sizeof(PFS_events_waits) - sizeof(events_waits_class));
/* Signal readers the record is now clean again. */
dest->m_wait_class= source->m_wait_class;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment