List:Commits« Previous MessageNext Message »
From:Ravinder Thakur Date:September 26 2012 5:51am
Subject:bzr push into mysql-trunk branch (ravinder.thakur:4021 to 4022) Bug#11752665
View as plain text  
 4022 Ravinder Thakur	2012-09-26
      Bug#11752665	WINDOWS SERVER X64: SO MANY COMPILER WARNINGS
      
      These set of changes fixes all the warnings encountered in Strings project 
      on the 64 bit version of Visual Studio 2010.

    modified:
      include/m_ctype.h
      strings/ctype-bin.c
      strings/ctype-mb.c
      strings/ctype-simple.c
      strings/ctype-tis620.c
      strings/ctype-uca.c
      strings/ctype-ucs2.c
      strings/ctype.c
      strings/dtoa.c
      strings/my_vsnprintf.c
 4021 Jon Olav Hauglid	2012-07-15
      The size_t patch, part 13

    modified:
      include/my_time.h
      sql-common/my_time.c
      sql/field.cc
      sql/field.h
      sql/mysqld.cc
      sql/mysqld.h
      sql/net_serv.cc
      sql/sql_class.cc
      sql/sql_db.cc
      sql/sql_parse.cc
      sql/sql_table.cc
=== modified file 'include/m_ctype.h'
--- a/include/m_ctype.h	2012-07-08 22:35:13 +0000
+++ b/include/m_ctype.h	2012-09-26 05:50:35 +0000
@@ -705,7 +705,7 @@ void my_strxfrm_desc_and_reverse(uchar *
                                  uint flags, uint level);
 size_t my_strxfrm_pad_desc_and_reverse(const CHARSET_INFO *cs,
                                        uchar *str, uchar *frmend, uchar *strend,
-                                       uint nweights, uint flags, uint level);
+                                       size_t nweights, uint flags, uint level);
 
 my_bool my_charset_is_ascii_compatible(const CHARSET_INFO *cs);
 
@@ -715,7 +715,7 @@ const MY_CONTRACTIONS *my_charset_get_co
 extern size_t my_vsnprintf_ex(const CHARSET_INFO *cs, char *to, size_t n,
                               const char* fmt, va_list ap);
 
-uint32 my_convert(char *to, size_t to_length, const CHARSET_INFO *to_cs,
+size_t my_convert(char *to, size_t to_length, const CHARSET_INFO *to_cs,
                   const char *from, size_t from_length,
                   const CHARSET_INFO *from_cs, uint *errors);
 

=== modified file 'strings/ctype-bin.c'
--- a/strings/ctype-bin.c	2011-12-09 21:08:37 +0000
+++ b/strings/ctype-bin.c	2012-09-26 05:50:35 +0000
@@ -455,13 +455,13 @@ skip:
         if (nmatch > 0)
 	{
 	  match[0].beg= 0;
-	  match[0].end= (size_t) (str- (const uchar*)b-1);
+	  match[0].end= (uint) (str- (const uchar*)b-1);
 	  match[0].mb_len= match[0].end;
 
 	  if (nmatch > 1)
 	  {
 	    match[1].beg= match[0].end;
-	    match[1].end= match[0].end+s_length;
+	    match[1].end= (uint) (match[0].end+s_length);
 	    match[1].mb_len= match[1].end-match[1].beg;
 	  }
 	}

=== modified file 'strings/ctype-mb.c'
--- a/strings/ctype-mb.c	2012-06-05 09:21:53 +0000
+++ b/strings/ctype-mb.c	2012-09-26 05:50:35 +0000
@@ -444,12 +444,12 @@ uint my_instr_mb(const CHARSET_INFO *cs,
         if (nmatch)
         {
           match[0].beg= 0;
-          match[0].end= (size_t) (b-b0);
+          match[0].end= (uint) (b-b0);
           match[0].mb_len= res;
           if (nmatch > 1)
           {
             match[1].beg= match[0].end;
-            match[1].end= match[0].end+s_length;
+            match[1].end= (uint) (match[0].end+s_length);
             match[1].mb_len= 0;	/* Not computed */
           }
         }
@@ -643,7 +643,7 @@ my_strnxfrm_mb(const CHARSET_INFO *cs,
     else
     {
       /* Multi-byte character */
-      int len= (dst + chlen <= de) ? chlen : de - dst;
+      size_t len= (dst + chlen <= de) ? chlen : de - dst;
       memcpy(dst, src, len);
       dst+= len;
       src+= len;
@@ -714,7 +714,7 @@ static void pad_max_char(const CHARSET_I
       memset(str, cs->max_sort_char, end - str);
       return;
     }
-    buf[0]= cs->max_sort_char >> 8;
+    buf[0]= (char) (cs->max_sort_char >> 8);
     buf[1]= cs->max_sort_char & 0xFF;
     buflen= 2;
   }

=== modified file 'strings/ctype-simple.c'
--- a/strings/ctype-simple.c	2012-07-02 12:35:56 +0000
+++ b/strings/ctype-simple.c	2012-09-26 05:50:35 +0000
@@ -78,7 +78,7 @@ my_strnxfrm_simple(const CHARSET_INFO *c
 {
   uchar *map= cs->sort_order;
   uchar *d0= dst;
-  uint frmlen;
+  size_t frmlen;
   if ((frmlen= MY_MIN(dstlen, nweights)) > srclen)
     frmlen= srclen;
   if (dst != src)
@@ -293,7 +293,7 @@ size_t my_snprintf_8bit(const CHARSET_IN
 		     const char* fmt, ...)
 {
   va_list args;
-  int result;
+  size_t result;
   va_start(args,fmt);
   result= my_vsnprintf(to, n, fmt, args);
   va_end(args);
@@ -1108,13 +1108,13 @@ skip:
 	if (nmatch > 0)
 	{
 	  match[0].beg= 0;
-	  match[0].end= (size_t) (str- (const uchar*)b-1);
+	  match[0].end= (uint) (str- (const uchar*)b-1);
 	  match[0].mb_len= match[0].end;
 	  
 	  if (nmatch > 1)
 	  {
 	    match[1].beg= match[0].end;
-	    match[1].end= match[0].end+s_length;
+	    match[1].end= (uint) (match[0].end+s_length);
 	    match[1].mb_len= match[1].end-match[1].beg;
 	  }
 	}
@@ -1382,7 +1382,8 @@ my_strntoull10rnd_8bit(const CHARSET_INF
   ulonglong ull;
   ulong ul;
   uchar ch;
-  int shift= 0, digits= 0, negative, addon;
+  int negative, addon;
+  ptrdiff_t shift= 0, digits= 0;
 
   /* Skip leading spaces and tabs */
   for ( ; str < end && (*str == ' ' || *str == '\t') ; str++);
@@ -1788,18 +1789,18 @@ my_strxfrm_desc_and_reverse(uchar *str, 
 size_t
 my_strxfrm_pad_desc_and_reverse(const CHARSET_INFO *cs,
                                 uchar *str, uchar *frmend, uchar *strend,
-                                uint nweights, uint flags, uint level)
+                                size_t nweights, uint flags, uint level)
 {
   if (nweights && frmend < strend && (flags & MY_STRXFRM_PAD_WITH_SPACE))
   {
-    uint fill_length= MY_MIN((uint) (strend - frmend), nweights * cs->mbminlen);
+    size_t fill_length= MY_MIN((uint) (strend - frmend), nweights * cs->mbminlen);
     cs->cset->fill(cs, (char*) frmend, fill_length, cs->pad_char);
     frmend+= fill_length;
   }
   my_strxfrm_desc_and_reverse(str, frmend, flags, level);
   if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && frmend < strend)
   {
-    uint fill_length= strend - frmend;
+    ptrdiff_t fill_length= strend - frmend;
     cs->cset->fill(cs, (char*) frmend, fill_length, cs->pad_char);
     frmend= strend;
   }

=== modified file 'strings/ctype-tis620.c'
--- a/strings/ctype-tis620.c	2011-12-09 21:08:37 +0000
+++ b/strings/ctype-tis620.c	2012-09-26 05:50:35 +0000
@@ -465,7 +465,7 @@ static uchar sort_order_tis620[]=
 static size_t thai2sortable(uchar *tstr, size_t len)
 {
   uchar	*p;
-  int	tlen;
+  size_t tlen;
   uchar	l2bias;
 
   tlen= len;
@@ -647,7 +647,7 @@ my_strnxfrm_tis620(const CHARSET_INFO *c
                                        dstlen - len, flags, 0);
   if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && len < dstlen0)
   {
-    uint fill_length= dstlen0 - len;
+    size_t fill_length= dstlen0 - len;
     cs->cset->fill(cs, (char*) dst + len, fill_length, cs->pad_char);
     len= dstlen0;
   }

=== modified file 'strings/ctype-uca.c'
--- a/strings/ctype-uca.c	2012-07-02 12:02:05 +0000
+++ b/strings/ctype-uca.c	2012-09-26 05:50:35 +0000
@@ -19570,7 +19570,7 @@ static my_bool
 my_uca_alloc_contractions(MY_CONTRACTIONS *contractions,
                           MY_CHARSET_LOADER *loader, size_t n)
 {
-  uint size= n * sizeof(MY_CONTRACTION);
+  size_t size= n * sizeof(MY_CONTRACTION);
   if (!(contractions->item= (loader->once_alloc)(size)) ||
       !(contractions->flags= (char *) (loader->once_alloc)(MY_UCA_CNT_FLAG_SIZE)))
     return 1;

=== modified file 'strings/ctype-ucs2.c'
--- a/strings/ctype-ucs2.c	2012-03-06 14:29:42 +0000
+++ b/strings/ctype-ucs2.c	2012-09-26 05:50:35 +0000
@@ -798,7 +798,7 @@ my_strtoll10_mb2(const CHARSET_INFO *cs,
   else
   {
     /* Read first digit to check that it's a valid number */
-    if ((c= (wc - '0')) > 9)
+    if ((c= (uchar) (wc - '0')) > 9)
       goto no_conv;
     i= c;
     n_end= s + 2 * (INIT_CNT-1);
@@ -813,7 +813,7 @@ my_strtoll10_mb2(const CHARSET_INFO *cs,
     if (res < 0)
       break;
     s+= res;
-    if ((c= (wc - '0')) > 9)
+    if ((c= (uchar) (wc - '0')) > 9)
       goto end_i;
     i= i*10+c;
   }
@@ -832,7 +832,7 @@ my_strtoll10_mb2(const CHARSET_INFO *cs,
     if (res < 0)
       goto no_conv;
     s+= res;
-    if ((c= (wc - '0')) > 9)
+    if ((c= (uchar) (wc - '0')) > 9)
       goto end_i_and_j;
     j= j*10+c;
   } while (s != n_end);
@@ -846,7 +846,7 @@ my_strtoll10_mb2(const CHARSET_INFO *cs,
   if (res < 0)
     goto no_conv;
   s+= res;
-  if ((c= (wc - '0')) > 9)
+  if ((c= (uchar) (wc - '0')) > 9)
     goto end3;
 
   /* Handle the next 1 or 2 digits and store them in k */
@@ -857,13 +857,13 @@ my_strtoll10_mb2(const CHARSET_INFO *cs,
   if (res < 0)
     goto no_conv;
   s+= res;
-  if ((c= (wc - '0')) > 9)
+  if ((c= (uchar) (wc - '0')) > 9)
     goto end4;
   k= k*10+c;
   *endptr= (char*) s;
 
   /* number string should have ended here */
-  if (s != end && (c= (wc - '0')) <= 9)
+  if (s != end && (c= (uchar) (wc - '0')) <= 9)
     goto overflow;
 
   /* Check that we didn't get an overflow with the last digit */
@@ -968,7 +968,7 @@ my_fill_mb2(const CHARSET_INFO *cs, char
 }
 
 
-static int
+static ptrdiff_t
 my_vsnprintf_mb2(char *dst, size_t n, const char* fmt, va_list ap)
 {
   char *start=dst, *end= dst + n - 1;
@@ -1042,7 +1042,7 @@ my_vsnprintf_mb2(char *dst, size_t n, co
   
   DBUG_ASSERT(dst <= end);
   *dst='\0';                                /* End of errmessage */
-  return (size_t) (dst - start);
+  return (dst - start);
 }
 
 
@@ -2219,7 +2219,7 @@ my_mbcharlen_utf32(const CHARSET_INFO *c
 }
 
 
-static int
+static ptrdiff_t
 my_vsnprintf_utf32(char *dst, size_t n, const char* fmt, va_list ap)
 {
   char *start= dst, *end= dst + n;
@@ -2304,7 +2304,7 @@ my_vsnprintf_utf32(char *dst, size_t n, 
   *dst++= '\0';
   *dst++= '\0';
   *dst++= '\0';     /* End of errmessage */
-  return (size_t) (dst - start - 4);
+  return (dst - start - 4);
 }
 
 

=== modified file 'strings/ctype.c'
--- a/strings/ctype.c	2012-07-08 22:35:13 +0000
+++ b/strings/ctype.c	2012-09-26 05:50:35 +0000
@@ -952,9 +952,9 @@ my_charset_is_ascii_compatible(const CHA
 */
 
 static uint32
-my_convert_internal(char *to, uint32 to_length,
+my_convert_internal(char *to, size_t to_length,
                     const CHARSET_INFO *to_cs,
-                    const char *from, uint32 from_length,
+                    const char *from, size_t from_length,
                     const CHARSET_INFO *from_cs, uint *errors)
 {
   int         cnvres;
@@ -1022,12 +1022,12 @@ outp:
   @return Number of bytes copied to 'to' string
 */
 
-uint32
+size_t
 my_convert(char *to, size_t to_length, const CHARSET_INFO *to_cs,
            const char *from, size_t from_length,
            const CHARSET_INFO *from_cs, uint *errors)
 {
-  uint32 length, length2;
+  size_t length, length2;
   /*
     If any of the character sets is not ASCII compatible,
     immediately switch to slow mb_wc->wc_mb method.
@@ -1063,7 +1063,7 @@ my_convert(char *to, size_t to_length, c
     }
     if (*((unsigned char*) from) > 0x7F) /* A non-ASCII character */
     {
-      uint32 copied_length= length2 - length;
+      size_t copied_length= length2 - length;
       to_length-= copied_length;
       from_length-= copied_length;
       return copied_length + my_convert_internal(to, to_length, to_cs,

=== modified file 'strings/dtoa.c'
--- a/strings/dtoa.c	2012-05-18 12:07:06 +0000
+++ b/strings/dtoa.c	2012-09-26 05:50:35 +0000
@@ -88,7 +88,8 @@ static void dtoa_free(char *, char *, si
 
 size_t my_fcvt(double x, int precision, char *to, my_bool *error)
 {
-  int decpt, sign, len, i;
+  int decpt, sign;
+  ptrdiff_t len, i;
   char *res, *src, *end, *dst= to;
   char buf[DTOA_BUFF_SIZE];
   DBUG_ASSERT(precision >= 0 && precision < NOT_FIXED_DEC && to != NULL);
@@ -212,7 +213,8 @@ size_t my_fcvt(double x, int precision, 
 size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
                my_bool *error)
 {
-  int decpt, sign, len, exp_len;
+  int decpt, sign, exp_len;
+  ptrdiff_t len;
   char *res, *src, *end, *dst= to, *dend= dst + width;
   char buf[DTOA_BUFF_SIZE];
   my_bool have_space, force_e_format;

=== modified file 'strings/my_vsnprintf.c'
--- a/strings/my_vsnprintf.c	2011-12-09 21:08:37 +0000
+++ b/strings/my_vsnprintf.c	2012-09-26 05:50:35 +0000
@@ -321,7 +321,7 @@ static char *process_args(const CHARSET_
 {
   ARGS_INFO args_arr[MAX_ARGS];
   PRINT_INFO print_arr[MAX_PRINT_INFO];
-  uint idx= 0, arg_count= arg_index;
+  size_t idx= 0, arg_count= arg_index;
 
 start:
   /* Here we are at the beginning of positional argument, right after $ */

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (ravinder.thakur:4021 to 4022) Bug#11752665Ravinder Thakur26 Sep