summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-09-28 10:38:02 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-09-28 17:20:46 +0000
commit7354dc67737fdeb105656f5cec055da627bb9c29 (patch)
tree7cc2b5f975d5e32eb94cd1344b259ea1b24018d6 /strings
parent509928718d52a14739fcfb2ebf0e68b4c8e01be5 (diff)
downloadmariadb-git-7354dc67737fdeb105656f5cec055da627bb9c29.tar.gz
MDEV-13384 - misc Windows warnings fixed
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-mb.c2
-rw-r--r--strings/ctype-simple.c6
-rw-r--r--strings/ctype-ucs2.c4
-rw-r--r--strings/dtoa.c8
-rw-r--r--strings/json_lib.c10
5 files changed, 15 insertions, 15 deletions
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 6438273bc4b..9e476c23202 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -637,7 +637,7 @@ size_t my_strnxfrm_mb_internal(CHARSET_INFO *cs, uchar *dst, uchar *de,
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;
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 99f26731851..cf73f117f0f 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1703,7 +1703,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)),
/* Unknown character, exit the loop */
break;
}
- shift= dot ? dot - str : 0; /* Right shift */
+ shift= dot ? (int)(dot - str) : 0; /* Right shift */
addon= 0;
exp: /* [ E [ <sign> ] <unsigned integer> ] */
@@ -2019,7 +2019,7 @@ my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs,
my_strxfrm_desc_and_reverse(str, frmend, flags, level);
if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && frmend < strend)
{
- uint fill_length= strend - frmend;
+ size_t fill_length= strend - frmend;
cs->cset->fill(cs, (char*) frmend, fill_length, cs->pad_char);
frmend= strend;
}
@@ -2041,7 +2041,7 @@ my_strxfrm_pad_desc_and_reverse_nopad(CHARSET_INFO *cs,
my_strxfrm_desc_and_reverse(str, frmend, flags, level);
if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && frmend < strend)
{
- uint fill_length= strend - frmend;
+ size_t fill_length= strend - frmend;
memset(frmend, 0x00, fill_length);
frmend= strend;
}
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 071d50d8256..cba44afc926 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1051,7 +1051,7 @@ static void
my_fill_mb2(CHARSET_INFO *cs, char *s, size_t slen, int fill)
{
char buf[10], *last;
- int buflen, remainder;
+ size_t buflen, remainder;
DBUG_ASSERT((slen % 2) == 0);
@@ -1066,7 +1066,7 @@ my_fill_mb2(CHARSET_INFO *cs, char *s, size_t slen, int fill)
for (last= s + slen - buflen; s <= last; s+= buflen)
{
/* Enough space for the characer */
- memcpy(s, buf, (size_t) buflen);
+ memcpy(s, buf, buflen);
}
/*
diff --git a/strings/dtoa.c b/strings/dtoa.c
index a16ec93d3eb..0da850bd1ca 100644
--- a/strings/dtoa.c
+++ b/strings/dtoa.c
@@ -106,7 +106,7 @@ size_t my_fcvt(double x, int precision, char *to, my_bool *error)
}
src= res;
- len= end - src;
+ len= (int)(end - src);
if (sign)
*dst++= '-';
@@ -238,7 +238,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
*error= FALSE;
src= res;
- len= end - res;
+ len= (int)(end - res);
/*
Number of digits in the exponent from the 'e' conversion.
@@ -330,7 +330,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
dtoa_free(res, buf, sizeof(buf));
res= dtoa(x, 5, width - decpt, &decpt, &sign, &end, buf, sizeof(buf));
src= res;
- len= end - res;
+ len= (int)(end - res);
}
if (len == 0)
@@ -396,7 +396,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
dtoa_free(res, buf, sizeof(buf));
res= dtoa(x, 4, width, &decpt, &sign, &end, buf, sizeof(buf));
src= res;
- len= end - res;
+ len= (int)(end - res);
if (--decpt < 0)
decpt= -decpt;
}
diff --git a/strings/json_lib.c b/strings/json_lib.c
index f666d95985b..3df2ecd4768 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -401,7 +401,7 @@ static int read_strn(json_engine_t *j)
return 1;
j->state= j->stack[j->stack_p];
- j->value_len= (j->s.c_str - j->value) - 1;
+ j->value_len= (int)(j->s.c_str - j->value) - 1;
return 0;
}
@@ -539,7 +539,7 @@ static int read_num(json_engine_t *j)
if (skip_num_constant(j) == 0)
{
j->value_type= JSON_VALUE_NUMBER;
- j->value_len= j->s.c_str - j->value_begin;
+ j->value_len= (int)(j->s.c_str - j->value_begin);
return 0;
}
return 1;
@@ -1496,7 +1496,7 @@ int json_append_ascii(CHARSET_INFO *json_cs,
return c_len;
}
- return json - json_start;
+ return (int)(json - json_start);
}
@@ -1532,7 +1532,7 @@ int json_unescape(CHARSET_INFO *json_cs,
return -1;
}
- return s.error==JE_EOS ? res - res_b : -1;
+ return s.error==JE_EOS ? (int)(res - res_b) : -1;
}
@@ -1647,7 +1647,7 @@ int json_escape(CHARSET_INFO *str_cs,
}
}
- return json - json_start;
+ return (int)(json - json_start);
}