summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-03-11 19:42:39 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-07-04 17:42:28 +0300
commit513d6260f27e9d46461980e023bd8ba39f1a8705 (patch)
tree42d9a20e8974aa79388f10850ae9338940231aec /sql/sql_class.cc
parent9de362fbde8e240adf66300f62418456fe82448b (diff)
downloadmariadb-git-bb-10.3-size_t.tar.gz
Use size_t in thd_alloc() and friendsbb-10.3-size_t
FIXME: This is updating .pp files. API/ABI version should be bumped(?) THD::alloc() and related member functions use size_t parameters. thd_alloc(), thd_calloc(), thd_strmake(), thd_memdup(): Define the interface with size_t instead of unsigned int, to avoid truncating integer conversions on 64-bit Windows, where size_t is longer than unsigned int.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index d4c498a1813..ff6d7749ba4 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1169,13 +1169,13 @@ Sql_condition* THD::raise_condition(uint sql_errno,
}
extern "C"
-void *thd_alloc(MYSQL_THD thd, unsigned int size)
+void *thd_alloc(MYSQL_THD thd, size_t size)
{
return thd->alloc(size);
}
extern "C"
-void *thd_calloc(MYSQL_THD thd, unsigned int size)
+void *thd_calloc(MYSQL_THD thd, size_t size)
{
return thd->calloc(size);
}
@@ -1187,14 +1187,14 @@ char *thd_strdup(MYSQL_THD thd, const char *str)
}
extern "C"
-char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size)
+char *thd_strmake(MYSQL_THD thd, const char *str, size_t size)
{
return thd->strmake(str, size);
}
extern "C"
LEX_CSTRING *thd_make_lex_string(THD *thd, LEX_CSTRING *lex_str,
- const char *str, unsigned int size,
+ const char *str, size_t size,
int allocate_lex_string)
{
return allocate_lex_string ? thd->make_clex_string(str, size)
@@ -1202,7 +1202,7 @@ LEX_CSTRING *thd_make_lex_string(THD *thd, LEX_CSTRING *lex_str,
}
extern "C"
-void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size)
+void *thd_memdup(MYSQL_THD thd, const void* str, size_t size)
{
return thd->memdup(str, size);
}