Commit 0ab7c2f3 authored by unknown's avatar unknown

Merge from 5.1-build of the "my_bool for C" changeset.

Removing "#define bool BOOL" as it's dangerous.


include/config-win.h:
  This #define was confusing: a) it changes the semantics of bool but
  only on Windows (C++ standard says that casting int to bool to int
  yields 0 or 1, but if using BOOL (which is int) this breaks, see
  old BUG 11567 "Variable 'foreign_key_checks', and other variables,
  differs binlog tests") b) it is not needed in C++ which has a bool type
  c) it is not needed in C where we must use my_bool as bool either does
  not exist or changes size between C and C++.
storage/maria/ma_check.c:
  my_bool for C
storage/maria/ma_dynrec.c:
  my_bool for C
storage/maria/ma_search.c:
  my_bool for C
storage/maria/ma_write.c:
  my_bool for C
storage/maria/maria_def.h:
  my_bool for C
storage/maria/maria_pack.c:
  my_bool for C
parent 34fff04d
......@@ -168,7 +168,6 @@ typedef uint rf_SetTimer;
#define Socket_defined
#define my_socket SOCKET
#define bool BOOL
#define SIGPIPE SIGINT
#define RETQSORTTYPE void
#define QSORT_TYPE_IS_VOID
......
......@@ -1362,7 +1362,7 @@ static int check_compressed_record(HA_CHECK *param, MARIA_HA *info, int extend,
MARIA_SHARE *share= info->s;
my_off_t start_recpos, pos;
char llbuff[22];
bool got_error= 0;
my_bool got_error= 0;
DBUG_ENTER("check_compressed_record");
pos= share->pack.header_length; /* Skip header */
......@@ -4500,7 +4500,7 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param)
}
if (b_type & BLOCK_DELETED)
{
bool error=0;
my_bool error=0;
if (block_info.block_len+ (uint) (block_info.filepos-pos) <
share->base.min_block_length)
{
......
......@@ -411,7 +411,8 @@ static int _ma_find_writepos(MARIA_HA *info,
a big block.
*/
static bool unlink_deleted_block(MARIA_HA *info, MARIA_BLOCK_INFO *block_info)
static my_bool unlink_deleted_block(MARIA_HA *info,
MARIA_BLOCK_INFO *block_info)
{
DBUG_ENTER("unlink_deleted_block");
if (block_info->filepos == info->s->state.dellink)
......
......@@ -1564,7 +1564,7 @@ _ma_calc_var_pack_key_length(MARIA_KEYDEF *keyinfo, uint nod_flag,
length_pack,new_key_length,diff_flag,pack_marker;
const uchar *start,*end,*key_end;
uchar *sort_order;
bool same_length;
my_bool same_length;
length_pack=s_temp->ref_length=s_temp->n_ref_length=s_temp->n_length=0;
same_length=0; keyseg=keyinfo->seg;
......
......@@ -160,9 +160,9 @@ int maria_write(MARIA_HA *info, uchar *record)
{
if (maria_is_key_active(share->state.key_map, i))
{
bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
is_tree_inited(&info->bulk_insert[i])));
my_bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
is_tree_inited(&info->bulk_insert[i])));
if (local_lock_tree)
{
rw_wrlock(&share->key_root_lock[i]);
......@@ -271,9 +271,9 @@ err:
{
if (maria_is_key_active(share->state.key_map, i))
{
bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
is_tree_inited(&info->bulk_insert[i])));
my_bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
is_tree_inited(&info->bulk_insert[i])));
if (local_lock_tree)
rw_wrlock(&share->key_root_lock[i]);
/**
......
......@@ -744,7 +744,7 @@ typedef struct st_maria_s_param
uint n_length, totlength, part_of_prev_key, prev_length, pack_marker;
uint changed_length;
int move_length; /* For balance_page */
bool store_not_null;
my_bool store_not_null;
} MARIA_KEY_PARAM;
......
......@@ -123,7 +123,7 @@ typedef struct st_isam_mrg {
extern int main(int argc,char * *argv);
static void get_options(int *argc,char ***argv);
static MARIA_HA *open_maria_file(char *name,int mode);
static bool open_maria_files(PACK_MRG_INFO *mrg,char **names,uint count);
static my_bool open_maria_files(PACK_MRG_INFO *mrg,char **names,uint count);
static int compress(PACK_MRG_INFO *file,char *join_name);
static HUFF_COUNTS *init_huff_count(MARIA_HA *info,my_off_t records);
static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees,
......@@ -439,7 +439,7 @@ static MARIA_HA *open_maria_file(char *name,int mode)
}
static bool open_maria_files(PACK_MRG_INFO *mrg,char **names,uint count)
static my_bool open_maria_files(PACK_MRG_INFO *mrg,char **names,uint count)
{
uint i,j;
mrg->count=0;
......
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