Commit 8b1d4fd3 authored by unknown's avatar unknown
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/home/my/mysql-5.0

parents 1c0e6709 d93806ef
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
#! /bin/sh

path=`dirname $0`
. "$path/SETUP.sh"

# Note that we can't use ccache with icc as the generated .deps file will
# then contain wrong information
CC=icc
CXX=icpc
CXXLD="$CXX -static-libcxa"
export CC CXX


extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"

# Disable following warnings as these are generated by header files:
# 161   unrecognized pragma
# 444   destructor for base class xxx is not virtual
# 279   controlling expression is constant
# 810   conversion from ulonglong to ulong with cast
# 981   operands are evaluated in unspecified order
# 1292  warning for unknown 'attribute' options
# 1469  "xxx" clobber ignored
# 1572  floating-point equality and inequality comparisons are unreliable

# In C++
# 869    parameter "xxx" was never referenced
#        (Problem with virtual functions)
# 874   support for placement delete is disabled

c_warnings=""
cxx_warnings=""
extra_flags="-O3 -unroll2 -ip -mp -no-gcc -restrict"
base_cxxflags="-fno-exceptions -fno-rtti"
extra_configs="$pentium_configs $static_link"

. "$path/FINISH.sh"
+34 −0
Original line number Diff line number Diff line
#! /bin/sh

path=`dirname $0`
. "$path/SETUP.sh"

# Note that we can't use ccache with icc as the generated .deps file will
# then contain wrong information
CC=icc
CXX=icpc
export CC CXX

extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"

# Disable following warnings as these are generated by header files:
# 161   unrecognized pragma
# 444   destructor for base class xxx is not virtual
# 279   controlling expression is constant
# 810   conversion from ulonglong to ulong with cast
# 981   operands are evaluated in unspecified order
# 1292  warning for unknown 'attribute' options
# 1469  "xxx" clobber ignored
# 1572  floating-point equality and inequality comparisons are unreliable

# In C++
# 869    parameter "xxx" was never referenced
#        (Problem with virtual functions)
# 874   support for placement delete is disabled

c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572"
cxx_warnings="$c_warnings -wd869,874"
base_cxxflags="-fno-exceptions -fno-rtti"
extra_configs="$pentium_configs $debug_configs"

. "$path/FINISH.sh"
+2 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ AC_LANG_PUSH(C++)
if test "$ac_cv_prog_gxx" = "yes"
then
  # Add -Werror, remove -fbranch-probabilities (Bug #268)
  CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'`
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
fi
mysql_cv_btype_last_arg_accept=none
[AC_TRY_COMPILE([#if defined(inline)
@@ -98,7 +98,7 @@ AC_LANG_PUSH(C++)
if test "$ac_cv_prog_gxx" = "yes"
then
  # Add -Werror, remove -fbranch-probabilities (Bug #268)
  CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'`
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
fi
mysql_cv_btype_struct_rlimit=none
[AC_TRY_COMPILE([#if defined(inline)
+6 −3
Original line number Diff line number Diff line
@@ -1965,9 +1965,12 @@ AC_LANG_CPLUSPLUS
# with respect to ANSI C++
# We also remove the -fbranch-probabilities option as this will give warnings
# about not profiled code, which confuses configure
# We also must remove -W and -Wcheck which on icc produces warnings that
# we don't want to catch with -Werror

if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
fi

AC_TRY_COMPILE(
@@ -2002,7 +2005,7 @@ AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
fi
AC_TRY_COMPILE(
[#undef inline
@@ -2035,7 +2038,7 @@ AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
fi
AC_TRY_COMPILE(
[#undef inline
+39 −38
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ typedef struct st_pointer_array { /* when using array-strings */
#define LAST_CHAR_CODE	259

typedef struct st_replace {
  bool   found;
  my_bool   found;
  struct st_replace *next[256];
} REPLACE;

@@ -80,18 +80,17 @@ typedef struct st_replace_found {

	/* functions defined in this file */

extern int main(int argc,char * *argv);
static int static_get_options(int *argc,char * * *argv);
static int get_replace_strings(int *argc,char * * *argv,
				   POINTER_ARRAY *from_array,
				   POINTER_ARRAY *to_array);
int insert_pointer_name(POINTER_ARRAY *pa, my_string name);
void free_pointer_array(POINTER_ARRAY *pa);
static int insert_pointer_name(POINTER_ARRAY *pa, my_string name);
static void free_pointer_array(POINTER_ARRAY *pa);
static int convert_pipe(REPLACE *,FILE *,FILE *);
static int convert_file(REPLACE *, my_string);
REPLACE *init_replace(my_string *from, my_string *to,uint count, my_string
		      word_end_chars);
uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
static REPLACE *init_replace(my_string *from, my_string *to,uint count,
                             my_string word_end_chars);
static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
                            my_string from);
static int initialize_buffer(void);
static void reset_buffer(void);
@@ -101,9 +100,7 @@ static int silent=0,verbose=0,updated=0;

	/* The main program */

int main(argc,argv)
int argc;
char *argv[];
int main(int argc, char *argv[])
{
  int i,error;
  char word_end_chars[256],*pos;
@@ -118,7 +115,7 @@ char *argv[];

  for (i=1,pos=word_end_chars ; i < 256 ; i++)
    if (my_isspace(&my_charset_latin1,i))
      *pos++=i;
      *pos++= (char) i;
  *pos=0;
  if (!(replace=init_replace((char**) from.typelib.type_names,
			     (char**) to.typelib.type_names,
@@ -153,7 +150,7 @@ static int static_get_options(argc,argv)
register int *argc;
register char **argv[];
{
  int help,version,opt;
  int help,version;
  char *pos;

  silent=verbose=help=0;
@@ -162,7 +159,7 @@ register char **argv[];
    while (*++pos)
    {
      version=0;
      switch((opt= *pos)) {
      switch((*pos)) {
      case 's':
	silent=1;
	break;
@@ -249,7 +246,7 @@ POINTER_ARRAY *from_array,*to_array;
  return 0;
}

int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)
{
  uint i,length,old_count;
  byte *new_pos;
@@ -323,8 +320,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name)

	/* free pointer array */

void free_pointer_array(pa)
reg1 POINTER_ARRAY *pa;
static void free_pointer_array(reg1 POINTER_ARRAY *pa)
{
  if (pa->typelib.count)
  {
@@ -382,8 +378,8 @@ static void or_bits(REP_SET *to,REP_SET *from);
static void copy_bits(REP_SET *to,REP_SET *from);
static int cmp_bits(REP_SET *set1,REP_SET *set2);
static int get_next_bit(REP_SET *set,uint lastpos);
static int find_set(REP_SETS *sets,REP_SET *find);
static int find_found(FOUND_SET *found_set,uint table_offset,
static short find_set(REP_SETS *sets,REP_SET *find);
static short find_found(FOUND_SET *found_set,uint table_offset,
                        int found_offset);
static uint start_at_word(my_string pos);
static uint end_of_word(my_string pos);
@@ -394,11 +390,12 @@ static uint found_sets=0;

	/* Init a replace structure for further calls */

REPLACE *init_replace(my_string *from, my_string *to,uint count,
static REPLACE *init_replace(my_string *from, my_string *to,uint count,
                             my_string word_end_chars)
{
  uint i,j,states,set_nr,len,result_len,max_length,found_end,bits_set,bit_nr;
  int used_sets,chr,default_state;
  int used_sets,chr;
  short default_state;
  char used_chars[LAST_CHAR_CODE],is_word_end[256];
  my_string pos,to_pos,*to_array;
  REP_SETS sets;
@@ -561,7 +558,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
    for (chr= 0 ; chr < 256 ; chr++)
    {
      if (! used_chars[chr])
	set->next[chr]= chr ? default_state : -1;
	set->next[chr]= (short) (chr ? default_state : -1);
      else
      {
	new_set=make_new_set(&sets);
@@ -652,7 +649,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
    for (i=1 ; i <= found_sets ; i++)
    {
      pos=from[found_set[i-1].table_offset];
      rep_str[i].found= !bcmp(pos,"\\^",3) ? 2 : 1;
      rep_str[i].found= (my_bool) (!bcmp(pos,"\\^",3) ? 2 : 1);
      rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
      rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
      rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
@@ -812,7 +809,7 @@ static int get_next_bit(REP_SET *set,uint lastpos)
	   free given set, else put in given set in sets and return it's
	   position */

static int find_set(REP_SETS *sets,REP_SET *find)
static short find_set(REP_SETS *sets,REP_SET *find)
{
  uint i;
  for (i=0 ; i < sets->count-1 ; i++)
@@ -820,30 +817,33 @@ static int find_set(REP_SETS *sets,REP_SET *find)
    if (!cmp_bits(sets->set+i,find))
    {
      free_last_set(sets);
      return i;
      return (short) i;
    }
  }
  return i;				/* return new postion */
  return (short) i;			/* return new postion */
}

	/* find if there is a found_set with same table_offset & found_offset

/*
  find if there is a found_set with same table_offset & found_offset
  If there is return offset to it, else add new offset and return pos.
  Pos returned is -offset-2 in found_set_structure because it's is
  saved in set->next and set->next[] >= 0 points to next set and
  set->next[] == -1 is reserved for end without replaces.
*/

static int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
static short find_found(FOUND_SET *found_set,uint table_offset,
                        int found_offset)
{
  int i;
  for (i=0 ; (uint) i < found_sets ; i++)
    if (found_set[i].table_offset == table_offset &&
	found_set[i].found_offset == found_offset)
      return -i-2;
      return (short) (-i-2);
  found_set[i].table_offset=table_offset;
  found_set[i].found_offset=found_offset;
  found_sets++;
  return -i-2;				/* return new postion */
  return (short) (-i-2);			/* return new postion */
}

	/* Return 1 if regexp starts with \b or ends with \b*/
@@ -878,7 +878,8 @@ static uint replace_len(my_string str)

	/* The actual loop */

uint replace_strings(REPLACE *rep, my_string *start,uint *max_length, my_string from)
static uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
                            my_string from)
{
  reg1 REPLACE *rep_pos;
  reg2 REPLACE_STRING *rep_str;
Loading