From 1555f1801d330d07bdaa94f106dbd407a68f3c90 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Dec 2013 12:35:47 +0200 Subject: [PATCH] make 5.1 compiling with modern gcc. --- mysys/md5.c | 2 +- sql/field.cc | 4 ++-- storage/maria/ma_blockrec.c | 2 +- storage/maria/ma_checksum.c | 2 +- storage/maria/ma_key.c | 2 +- storage/myisam/mi_checksum.c | 2 +- storage/myisam/mi_key.c | 2 +- storage/pbxt/src/myxt_xt.cc | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mysys/md5.c b/mysys/md5.c index 2388cebedc4..22a5e409a09 100644 --- a/mysys/md5.c +++ b/mysys/md5.c @@ -176,7 +176,7 @@ my_MD5Final (unsigned char digest[16], my_MD5Context *ctx) putu32(ctx->buf[1], digest + 4); putu32(ctx->buf[2], digest + 8); putu32(ctx->buf[3], digest + 12); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } #ifndef ASM_MD5 diff --git a/sql/field.cc b/sql/field.cc index 7e2db40ccb0..5b864bb7ba0 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7709,7 +7709,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) if (!String::needs_conversion(length, cs, field_charset, &dummy_offset)) { Field_blob::store_length(length); - bmove(ptr+packlength,(char*) &from,sizeof(char*)); + bmove(ptr + packlength, &from, sizeof(char*)); return 0; } if (tmpstr.copy(from, length, cs)) @@ -8364,7 +8364,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs) value.copy(from, length, cs); from= value.ptr(); } - bmove(ptr + packlength, (char*) &from, sizeof(char*)); + bmove(ptr + packlength, &from, sizeof(char*)); } return 0; diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 73b3326fd28..a08cd554615 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -7154,7 +7154,7 @@ my_bool _ma_apply_undo_row_delete(MARIA_HA *info, LSN undo_lsn, memcpy(field_pos, field_length_data, size_length); field_length_data+= size_length; - memcpy(field_pos + size_length, &header, sizeof(&header)); + memcpy(field_pos + size_length, &header, sizeof(header)); header+= blob_length; *blob_lengths++= blob_length; break; diff --git a/storage/maria/ma_checksum.c b/storage/maria/ma_checksum.c index 61ec638053a..da2d40d3687 100644 --- a/storage/maria/ma_checksum.c +++ b/storage/maria/ma_checksum.c @@ -58,7 +58,7 @@ ha_checksum _ma_checksum(MARIA_HA *info, const uchar *record) length= _ma_calc_blob_length(blob_size_length, pos); if (length) { - memcpy((char*) &pos, pos + blob_size_length, sizeof(char*)); + memcpy(&pos, pos + blob_size_length, sizeof(char*)); crc= my_checksum(crc, pos, length); } continue; diff --git a/storage/maria/ma_key.c b/storage/maria/ma_key.c index 207ae9a8bda..037e8db2cfb 100644 --- a/storage/maria/ma_key.c +++ b/storage/maria/ma_key.c @@ -583,7 +583,7 @@ static int _ma_put_key_in_record(register MARIA_HA *info, uint keynr, goto err; #endif memcpy(record+keyseg->start+keyseg->bit_start, - (char*) &blob_ptr,sizeof(char*)); + &blob_ptr,sizeof(char*)); memcpy(blob_ptr,key,length); blob_ptr+=length; diff --git a/storage/myisam/mi_checksum.c b/storage/myisam/mi_checksum.c index 8c408ef7ff5..13dd52db22e 100644 --- a/storage/myisam/mi_checksum.c +++ b/storage/myisam/mi_checksum.c @@ -40,7 +40,7 @@ ha_checksum mi_checksum(MI_INFO *info, const uchar *buf) length=_mi_calc_blob_length(column->length- portable_sizeof_char_ptr, buf); - memcpy((char*) &pos, buf+column->length- portable_sizeof_char_ptr, + memcpy(&pos, buf+column->length- portable_sizeof_char_ptr, sizeof(char*)); break; } diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c index 94f3f34ec58..02254bae68d 100644 --- a/storage/myisam/mi_key.c +++ b/storage/myisam/mi_key.c @@ -419,7 +419,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, goto err; #endif memcpy(record+keyseg->start+keyseg->bit_start, - (char*) &blob_ptr,sizeof(char*)); + &blob_ptr,sizeof(char*)); memcpy(blob_ptr,key,length); blob_ptr+=length; diff --git a/storage/pbxt/src/myxt_xt.cc b/storage/pbxt/src/myxt_xt.cc index b7b81823383..49a22e980ca 100644 --- a/storage/pbxt/src/myxt_xt.cc +++ b/storage/pbxt/src/myxt_xt.cc @@ -937,7 +937,7 @@ xtPublic xtBool myxt_create_row_from_key(XTOpenTablePtr XT_UNUSED(ot), XTIndexPt */ byte *key_ptr = key; // Cannot take the address of a register variable! memcpy(record+keyseg->start+keyseg->bit_start, - (char*) &key_ptr,sizeof(char*)); + &key_ptr,sizeof(char*)); my_store_blob_length(record+keyseg->start, (uint) keyseg->bit_start,length);