summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-big5.c2
-rw-r--r--strings/ctype-mb.c2
-rw-r--r--strings/ctype-simple.c4
-rw-r--r--strings/ctype-tis620.c6
-rw-r--r--strings/ctype-uca.c8
-rw-r--r--strings/ctype-ucs2.c6
-rw-r--r--strings/ctype-utf8.c4
-rw-r--r--strings/ctype.c10
-rw-r--r--strings/decimal.c14
-rw-r--r--strings/dtoa.c4
-rw-r--r--strings/is_prefix.c2
-rw-r--r--strings/json_lib.c5
-rw-r--r--strings/longlong2str.c2
-rw-r--r--strings/my_strtoll10.c2
-rw-r--r--strings/my_vsnprintf.c2
-rw-r--r--strings/str2int.c2
-rw-r--r--strings/strappend.c2
-rw-r--r--strings/strfill.c2
-rw-r--r--strings/strings_def.h5
19 files changed, 41 insertions, 43 deletions
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 51bf8843d87..3991a219ab5 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -15,7 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
/*
- * This file is basicly usa7 character sets with some extra functions
+ * This file is basically usa7 character sets with some extra functions
* for big5 handling
*/
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 3bcd29bbb8b..f2683726151 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -667,7 +667,7 @@ static void pad_max_char(CHARSET_INFO *cs, char *str, char *end)
{
if ((str + buflen) <= end)
{
- /* Enough space for the characer */
+ /* Enough space for the character */
memcpy(str, buf, buflen);
str+= buflen;
}
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 9b13be5aaa2..3124bf8fc96 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -47,7 +47,7 @@ size_t my_strnxfrmlen_simple(CHARSET_INFO *cs, size_t len)
is equal to comparing two original strings with my_strnncollsp_xxx().
Not more than 'dstlen' bytes are written into 'dst'.
- To garantee that the whole string is transformed, 'dstlen' must be
+ To guarantee that the whole string is transformed, 'dstlen' must be
at least srclen*cs->strnxfrm_multiply bytes long. Otherwise,
consequent memcmp() may return a non-accurate result.
@@ -1535,7 +1535,7 @@ static ulonglong d10[DIGITS_IN_ULONGLONG]=
Convert a string to unsigned long long integer value
with rounding.
- SYNOPSYS
+ SYNOPSIS
my_strntoull10_8bit()
cs in pointer to character set
str in pointer to the string to be converted
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index bfd8b0db1d5..cbf50c638fd 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -22,7 +22,7 @@
/*
- This file is basicly tis620 character sets with some extra functions
+ This file is basically tis620 character sets with some extra functions
for tis-620 handling
*/
@@ -502,7 +502,7 @@ static size_t thai2sortable(uchar *tstr, size_t len)
string
NOTE:
- We can't cut strings at end \0 as this would break comparision with
+ We can't cut strings at end \0 as this would break comparison with
LIKE characters, where the min range is stored as end \0
Arg: 2 Strings and it compare length
@@ -594,7 +594,7 @@ int my_strnncollsp_tis620_nopad(CHARSET_INFO * cs __attribute__((unused)),
strnxfrm replacment, convert Thai string to sortable string
Arg: Destination buffer, source string, dest length and source length
- Ret: Conveted string size
+ Ret: Converted string size
*/
static size_t
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index b93913175e8..5fbbbec7874 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -34036,7 +34036,7 @@ apply_one_rule(MY_CHARSET_LOADER *loader,
/**
Check if collation rules are valid,
- i.e. characters are not outside of the collation suported range.
+ i.e. characters are not outside of the collation supported range.
*/
static int
check_rules(MY_CHARSET_LOADER *loader,
@@ -34172,7 +34172,7 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules,
memcpy(dst->weights, src->weights, npages * sizeof(uint16 *));
/*
- Calculate maximum lenghts for the pages which will be overwritten.
+ Calculate maximum lengths for the pages which will be overwritten.
Mark pages that will be otherwriten as NULL.
We'll allocate their own memory.
*/
@@ -34190,7 +34190,7 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules,
{
/*
Not an expansion and not a contraction.
- The page correspoding to r->curr[0] in "dst"
+ The page corresponding to r->curr[0] in "dst"
will need at least the same amount of weights
that r->base[0] has in "src".
*/
@@ -35544,7 +35544,7 @@ MY_COLLATION_HANDLER my_collation_any_uca_handler =
/*
We consider bytes with code more than 127 as a letter.
- This garantees that word boundaries work fine with regular
+ This guarantees that word boundaries work fine with regular
expressions. Note, there is no need to mark byte 255 as a
letter, it is illegal byte in UTF8.
*/
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index f229bbf7323..5a59abcdf63 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1065,7 +1065,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 */
+ /* Enough space for the character */
memcpy(s, buf, buflen);
}
@@ -2622,14 +2622,14 @@ void my_fill_utf32(CHARSET_INFO *cs,
char *s, size_t slen, int fill)
{
char buf[10];
-#ifndef DBUG_OFF
+#ifdef DBUG_ASSERT_EXISTS
uint buflen;
#endif
char *e= s + slen;
DBUG_ASSERT((slen % 4) == 0);
-#ifndef DBUG_OFF
+#ifdef DBUG_ASSERT_EXISTS
buflen=
#endif
cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf,
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 44dc3d2e02d..f5bcb8686d5 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -4910,7 +4910,7 @@ my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *cs, size_t len)
/*
We consider bytes with code more than 127 as a letter.
- This garantees that word boundaries work fine with regular
+ This guarantees that word boundaries work fine with regular
expressions. Note, there is no need to mark byte 255 as a
letter, it is illegal byte in UTF8.
*/
@@ -7303,7 +7303,7 @@ struct charset_info_st my_charset_filename=
/*
We consider bytes with code more than 127 as a letter.
- This garantees that word boundaries work fine with regular
+ This guarantees that word boundaries work fine with regular
expressions. Note, there is no need to mark byte 255 as a
letter, it is illegal byte in UTF8.
*/
diff --git a/strings/ctype.c b/strings/ctype.c
index b1fc48aa470..32c41e6e9e7 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -40,7 +40,7 @@
/*
Avoid using my_snprintf
We cannot use my_snprintf() here, because ctype.o is
- used to build conf_to_src, which must require minimun
+ used to build conf_to_src, which must require minimum
dependency.
*/
@@ -831,7 +831,7 @@ my_parse_charset_xml(MY_CHARSET_LOADER *loader, const char *buf, size_t len)
uint
-my_string_repertoire_8bit(CHARSET_INFO *cs, const char *str, ulong length)
+my_string_repertoire_8bit(CHARSET_INFO *cs, const char *str, size_t length)
{
const char *strend;
if ((cs->state & MY_CS_NONASCII) && length > 0)
@@ -917,7 +917,7 @@ my_string_metadata_get(MY_STRING_METADATA *metadata,
Check repertoire: detect pure ascii strings
*/
uint
-my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong length)
+my_string_repertoire(CHARSET_INFO *cs, const char *str, size_t length)
{
if (cs->mbminlen == 1 && !(cs->state & MY_CS_NONASCII))
{
@@ -1001,9 +1001,9 @@ my_charset_is_ascii_based(CHARSET_INFO *cs)
*/
uint32
-my_convert_using_func(char *to, uint32 to_length,
+my_convert_using_func(char *to, size_t to_length,
CHARSET_INFO *to_cs, my_charset_conv_wc_mb wc_mb,
- const char *from, uint32 from_length,
+ const char *from, size_t from_length,
CHARSET_INFO *from_cs, my_charset_conv_mb_wc mb_wc,
uint *errors)
{
diff --git a/strings/decimal.c b/strings/decimal.c
index 21af3dc8882..59e60e0a328 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -739,7 +739,7 @@ int decimal_shift(decimal_t *dec, int shift)
/*
If there are gaps then fill ren with 0.
- Only one of following 'for' loops will work becouse beg <= end
+ Only one of following 'for' loops will work because beg <= end
*/
beg= ROUND_UP(beg + 1) - 1;
end= ROUND_UP(end) - 1;
@@ -863,7 +863,7 @@ internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed)
intg=intg1*DIG_PER_DEC1;
}
}
- /* Error is guranteed to be set here */
+ /* Error is guaranteed to be set here */
to->intg=intg;
to->frac=frac;
@@ -1371,7 +1371,7 @@ int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale)
case 2: x=mi_sint2korr(from); break;
case 3: x=mi_sint3korr(from); break;
case 4: x=mi_sint4korr(from); break;
- default: DBUG_ASSERT(0);
+ default: abort();
}
from+=i;
*buf=x ^ mask;
@@ -1412,7 +1412,7 @@ int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale)
case 2: x=mi_sint2korr(from); break;
case 3: x=mi_sint3korr(from); break;
case 4: x=mi_sint4korr(from); break;
- default: DBUG_ASSERT(0);
+ default: abort();
}
*buf=(x ^ mask) * powers10[DIG_PER_DEC1 - frac0x];
if (((uint32)*buf) > DIG_MAX)
@@ -1700,7 +1700,7 @@ done:
scale increment for '/'
NOTE
- returned valued may be larger than the actual buffer requred
+ returned valued may be larger than the actual buffer required
in the operation, as decimal_result_size, by design, operates on
precision/scale values only and not on the actual decimal number
@@ -2251,7 +2251,7 @@ static int do_div_mod(const decimal_t *from1, const decimal_t *from2,
*/
norm_factor=DIG_BASE/(*start2+1);
norm2=(dec1)(norm_factor*start2[0]);
- if (likely(len2>0))
+ if (unlikely(len2>0))
norm2+=(dec1)(norm_factor*start2[1]/DIG_BASE);
if (*start1 < *start2)
@@ -2273,7 +2273,7 @@ static int do_div_mod(const decimal_t *from1, const decimal_t *from2,
guess=(norm_factor*x+norm_factor*y/DIG_BASE)/norm2;
if (unlikely(guess >= DIG_BASE))
guess=DIG_BASE-1;
- if (likely(len2>0))
+ if (unlikely(len2>0))
{
/* hmm, this is a suspicious trick - I removed normalization here */
if (start2[1]*guess > (x-guess*start2[0])*DIG_BASE+y)
diff --git a/strings/dtoa.c b/strings/dtoa.c
index d893d8e4bce..e31b7e92d7c 100644
--- a/strings/dtoa.c
+++ b/strings/dtoa.c
@@ -269,7 +269,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
Assume that we don't have enough space to place all significant digits in
the 'f' format. We have to choose between the 'e' format and the 'f' one
to keep as many significant digits as possible.
- Let E and F be the lengths of decimal representaion in the 'e' and 'f'
+ Let E and F be the lengths of decimal representation in the 'e' and 'f'
formats, respectively. We want to use the 'f' format if, and only if F <= E.
Consider the following cases:
1. decpt <= 0.
@@ -1290,7 +1290,7 @@ static double ratio(Bigint *a, Bigint *b)
dval(&db)= b2d(b, &kb);
k= ka - kb + 32*(a->wds - b->wds);
if (k > 0)
- word0(&da)+= k*Exp_msk1;
+ word0(&da)+= (ULong)(k*Exp_msk1 * 1.0);
else
{
k= -k;
diff --git a/strings/is_prefix.c b/strings/is_prefix.c
index 2933577b5ab..dfb61612e79 100644
--- a/strings/is_prefix.c
+++ b/strings/is_prefix.c
@@ -31,7 +31,7 @@
Defines: is_prefix()
is_prefix(s, t) returns 1 if s starts with t.
- A empty t is allways a prefix.
+ A empty t is always a prefix.
*/
#include "strings_def.h"
diff --git a/strings/json_lib.c b/strings/json_lib.c
index 3ce9b0c503f..24c79cb9044 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -1,8 +1,6 @@
#include <my_global.h>
#include <string.h>
#include <m_ctype.h>
-
-
#include "json_lib.h"
/*
@@ -187,7 +185,7 @@ static int read_array(json_engine_t *j)
/*
Character classes inside the JSON string constant.
We mostly need this to parse escaping properly.
- Escapings availabe in JSON are:
+ Escapings available in JSON are:
\" - quotation mark
\\ - backslash
\b - backspace UNICODE 8
@@ -1847,4 +1845,3 @@ int json_path_compare(const json_path_t *a, const json_path_t *b,
return json_path_parts_compare(a->steps+1, a->last_step,
b->steps+1, b->last_step, vt);
}
-
diff --git a/strings/longlong2str.c b/strings/longlong2str.c
index 4be380207a4..ab46353d5e1 100644
--- a/strings/longlong2str.c
+++ b/strings/longlong2str.c
@@ -47,7 +47,7 @@
Note: The standard itoa() returns a pointer to the argument, when int2str
returns the pointer to the end-null.
- itoa assumes that 10 -base numbers are allways signed and other arn't.
+ itoa assumes that 10 -base numbers are always signed and other aren't.
*/
#include "strings_def.h"
diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c
index ea556cea127..2311b4e5079 100644
--- a/strings/my_strtoll10.c
+++ b/strings/my_strtoll10.c
@@ -43,7 +43,7 @@ static unsigned long lfactor[9]=
/*
Convert a string to an to unsigned long long integer value
- SYNOPSYS
+ SYNOPSIS
my_strtoll10()
nptr in pointer to the string to be converted
endptr in/out pointer to the end of the string/
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index ad3517e4252..5a161612bc5 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -312,7 +312,7 @@ static char *process_int_arg(char *to, const char *end, size_t length,
/**
- Procesed positional arguments.
+ Processed positional arguments.
@param cs string charset
@param to buffer where processed string will be place
diff --git a/strings/str2int.c b/strings/str2int.c
index fe6cd6b793e..439a50ddef6 100644
--- a/strings/str2int.c
+++ b/strings/str2int.c
@@ -191,7 +191,7 @@ char *str2int(register const char *src, register int radix, long int lower,
return (char*) src;
}
- /* Theese are so slow compared with ordinary, optimized atoi */
+ /* These are so slow compared with ordinary, optimized atoi */
#ifdef WANT_OUR_ATOI
diff --git a/strings/strappend.c b/strings/strappend.c
index 2d04f009a60..b469e7488cb 100644
--- a/strings/strappend.c
+++ b/strings/strappend.c
@@ -33,7 +33,7 @@
strappend(dest, len, fill) appends fill-characters to a string so that
the result length == len. If the string is longer than len it's
- trunked. The des+len character is allways set to NULL.
+ trunked. The des+len character is always set to NULL.
*/
#include "strings_def.h"
diff --git a/strings/strfill.c b/strings/strfill.c
index 377f9b85e36..8f69b092cd1 100644
--- a/strings/strfill.c
+++ b/strings/strfill.c
@@ -32,7 +32,7 @@
Defines: strfill()
strfill(dest, len, fill) makes a string of fill-characters. The result
- string is of length == len. The des+len character is allways set to NULL.
+ string is of length == len. The des+len character is always set to NULL.
strfill() returns pointer to dest+len;
*/
diff --git a/strings/strings_def.h b/strings/strings_def.h
index 34a04458024..b3727321e19 100644
--- a/strings/strings_def.h
+++ b/strings/strings_def.h
@@ -17,8 +17,9 @@
/* This file is to be include first in all files in the string directory */
-#include <my_global.h> /* Define standar vars */
-#include "m_string.h" /* Exernal defintions of string functions */
+#undef DBUG_ASSERT_AS_PRINTF
+#include <my_global.h> /* Define standard vars */
+#include "m_string.h" /* Exernal definitions of string functions */
/*
We can't use the original DBUG_ASSERT() (which includes _db_flush())