Commit 6ed46be7 authored by unknown's avatar unknown

Fixed bytes to uchar and gptr to uchar*

parent 8ba21c61
......@@ -999,7 +999,7 @@ static void compact_page(uchar *buff, uint block_size, uint rownr,
EMPTY_SPACE is not updated
*/
static void make_empty_page(byte *buff, uint block_size, uint page_type)
static void make_empty_page(uchar *buff, uint block_size, uint page_type)
{
bzero(buff, PAGE_HEADER_SIZE);
......@@ -1010,7 +1010,7 @@ static void make_empty_page(byte *buff, uint block_size, uint page_type)
PAGE_OVERHEAD_SIZE
*/
bzero(buff+ PAGE_HEADER_SIZE, block_size - PAGE_HEADER_SIZE);
buff[PAGE_TYPE_OFFSET]= (byte) page_type;
buff[PAGE_TYPE_OFFSET]= (uchar) page_type;
buff[DIR_COUNT_OFFSET]= 1;
/* Store position to the first row */
int2store(buff + block_size - PAGE_SUFFIX_SIZE - DIR_ENTRY_SIZE,
......@@ -2509,12 +2509,12 @@ my_bool _ma_update_block_record(MARIA_HA *info, MARIA_RECORD_POS record_pos,
1 Page is now empty
*/
static int delete_dir_entry(byte *buff, uint block_size, uint record_number,
static int delete_dir_entry(uchar *buff, uint block_size, uint record_number,
uint *empty_space_res)
{
uint number_of_records= (uint) ((uchar *) buff)[DIR_COUNT_OFFSET];
uint length, empty_space;
byte *dir;
uchar *dir;
DBUG_ENTER("delete_dir_entry");
#ifdef SANITY_CHECKS
......@@ -2538,21 +2538,21 @@ static int delete_dir_entry(byte *buff, uint block_size, uint record_number,
if (record_number == number_of_records - 1)
{
/* Delete this entry and all following empty directory entries */
byte *end= buff + block_size - PAGE_SUFFIX_SIZE;
uchar *end= buff + block_size - PAGE_SUFFIX_SIZE;
do
{
number_of_records--;
dir+= DIR_ENTRY_SIZE;
empty_space+= DIR_ENTRY_SIZE;
} while (dir < end && dir[0] == 0 && dir[1] == 0);
buff[DIR_COUNT_OFFSET]= (byte) (uchar) number_of_records;
buff[DIR_COUNT_OFFSET]= (uchar) number_of_records;
}
empty_space+= length;
if (number_of_records != 0)
{
/* Update directory */
int2store(buff + EMPTY_SPACE_OFFSET, empty_space);
buff[PAGE_TYPE_OFFSET]|= (byte) PAGE_CAN_BE_COMPACTED;
buff[PAGE_TYPE_OFFSET]|= (uchar) PAGE_CAN_BE_COMPACTED;
*empty_space_res= empty_space;
DBUG_RETURN(0);
......@@ -4111,8 +4111,8 @@ static size_t fill_update_undo_parts(MARIA_HA *info, const uchar *oldrec,
uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint page_type,
const byte *header,
const byte *data,
const uchar *header,
const uchar *data,
size_t data_length)
{
MARIA_SHARE *share= info->s;
......@@ -4120,7 +4120,7 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint rownr, empty_space;
uint block_size= share->block_size;
uint rec_offset;
byte *buff= info->keyread_buff, *dir;
uchar *buff= info->keyread_buff, *dir;
DBUG_ENTER("_ma_apply_redo_insert_row_head");
info->keyread_buff_used= 1;
......@@ -4201,14 +4201,14 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
if ((uint) (dir - buff) < rec_offset + data_length)
goto err;
}
buff[DIR_COUNT_OFFSET]= (byte) (uchar) max_entry+1;
buff[DIR_COUNT_OFFSET]= (uchar) max_entry+1;
int2store(dir, rec_offset);
empty_space-= DIR_ENTRY_SIZE;
}
else
{
/* reuse old empty entry */
byte *pos, *end, *end_data;
uchar *pos, *end, *end_data;
DBUG_ASSERT(uint2korr(dir) == 0);
if (uint2korr(dir))
goto err; /* Should have been empty */
......@@ -4305,13 +4305,13 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint _ma_apply_redo_purge_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint page_type,
const byte *header)
const uchar *header)
{
MARIA_SHARE *share= info->s;
ulonglong page;
uint record_number, empty_space;
uint block_size= share->block_size;
byte *buff= info->keyread_buff;
uchar *buff= info->keyread_buff;
DBUG_ENTER("_ma_apply_redo_purge_row_head_or_tail");
info->keyread_buff_used= 1;
......@@ -4324,7 +4324,7 @@ uint _ma_apply_redo_purge_row_head_or_tail(MARIA_HA *info, LSN lsn,
buff, PAGECACHE_PLAIN_PAGE,
PAGECACHE_LOCK_LEFT_UNLOCKED, 0)))
DBUG_RETURN(my_errno);
DBUG_ASSERT((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == (byte) page_type);
DBUG_ASSERT((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) == (uchar) page_type);
if (lsn_korr(buff) >= lsn)
{
......
......@@ -180,9 +180,9 @@ my_bool _ma_check_if_right_bitmap_type(MARIA_HA *info,
void _ma_bitmap_delete_all(MARIA_SHARE *share);
uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint page_type,
const byte *header,
const byte *data,
const uchar *header,
const uchar *data,
size_t data_length);
uint _ma_apply_redo_purge_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint page_type,
const byte *header);
const uchar *header);
......@@ -2060,7 +2060,7 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info,
goto err;
}
if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
if (!(sort_param.record=(uchar*) my_malloc((uint) share->base.pack_reclength,
MYF(0))) ||
_ma_alloc_buffer(&sort_param.rec_buff, &sort_param.rec_buff_size,
info->s->base.default_rec_buff_size))
......@@ -5373,7 +5373,7 @@ static void copy_data_file_state(MARIA_STATE_INFO *to,
static int _ma_safe_scan_block_record(MARIA_SORT_INFO *sort_info,
MARIA_HA *info, byte *record)
MARIA_HA *info, uchar *record)
{
uint record_pos= info->cur_row.nextpos;
ulonglong page= sort_info->page;
......@@ -5385,7 +5385,7 @@ static int _ma_safe_scan_block_record(MARIA_SORT_INFO *sort_info,
if (likely(record_pos < info->scan.number_of_rows))
{
uint length, offset;
byte *data, *end_of_data;
uchar *data, *end_of_data;
char llbuff[22];
while (!(offset= uint2korr(info->scan.dir)))
......
......@@ -632,7 +632,7 @@ typedef struct st_loghandler_file_info
my_bool translog_read_file_header(LOGHANDLER_FILE_INFO *desc)
{
byte page_buff[TRANSLOG_PAGE_SIZE], *ptr;
uchar page_buff[TRANSLOG_PAGE_SIZE], *ptr;
DBUG_ENTER("translog_read_file_header");
if (my_pread(log_descriptor.log_file_num[0], page_buff,
......
......@@ -295,7 +295,7 @@ typedef my_bool(*inwrite_rec_hook) (enum translog_record_type type,
typedef uint16(*read_rec_hook) (enum translog_record_type type,
uint16 read_length, uchar *read_buff,
byte *decoded_buff);
uchar *decoded_buff);
/* record classes */
......
......@@ -284,11 +284,11 @@ int main(int argc, char **argv)
static struct my_option my_long_options[] =
{
{"only-display", 'o', "display brief info about records's header",
(gptr*) &opt_only_display, (gptr*) &opt_only_display, 0, GET_BOOL, NO_ARG,
(uchar**) &opt_only_display, (uchar**) &opt_only_display, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"display-and-apply", 'a',
"like --only-display but displays more info and modifies tables",
(gptr*) &opt_display_and_apply, (gptr*) &opt_display_and_apply, 0,
(uchar**) &opt_display_and_apply, (uchar**) &opt_display_and_apply, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
......@@ -641,7 +641,7 @@ prototype_exec_hook(REDO_INSERT_ROW_HEAD)
ulonglong page;
MARIA_HA *info;
char llbuf[22];
byte *buff= 0;
uchar *buff= 0;
sid= fileid_korr(rec->header);
page= page_korr(rec->header + FILEID_STORE_SIZE);
......@@ -678,7 +678,7 @@ prototype_exec_hook(REDO_INSERT_ROW_HEAD)
differences. So we use the UNDO's LSN which is current_group_end_lsn.
*/
if ((!(buff= (byte*) my_malloc(rec->record_length, MYF(MY_WME)))) ||
if ((!(buff= (uchar*) my_malloc(rec->record_length, MYF(MY_WME)))) ||
(translog_read_record(rec->lsn, 0, rec->record_length, buff, NULL) !=
rec->record_length))
{
......@@ -707,7 +707,7 @@ prototype_exec_hook(REDO_INSERT_ROW_TAIL)
ulonglong page;
MARIA_HA *info;
char llbuf[22];
byte *buff= 0;
uchar *buff= 0;
sid= fileid_korr(rec->header);
page= page_korr(rec->header + FILEID_STORE_SIZE);
......@@ -744,7 +744,7 @@ prototype_exec_hook(REDO_INSERT_ROW_TAIL)
differences. So we use the UNDO's LSN which is current_group_end_lsn.
*/
if ((!(buff= (byte*) my_malloc(rec->record_length, MYF(MY_WME)))) ||
if ((!(buff= (uchar*) my_malloc(rec->record_length, MYF(MY_WME)))) ||
(translog_read_record(rec->lsn, 0, rec->record_length, buff, NULL) !=
rec->record_length))
{
......
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