diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2018-02-06 12:55:58 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-02-06 12:55:58 +0000 |
commit | 6c279ad6a71c63cb595fde7c951aadb31c3dbebc (patch) | |
tree | 3603f88e1b3bd1e622edb182cccd882dd31ddc8a /sql/sp_pcontext.cc | |
parent | f271100836d8a91a775894ec36b869a66a3145e5 (diff) | |
download | mariadb-git-6c279ad6a71c63cb595fde7c951aadb31c3dbebc.tar.gz |
MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from 'size_t' to 'type', possible loss of data)
Handle string length as size_t, consistently (almost always:))
Change function prototypes to accept size_t, where in the past
ulong or uint were used. change local/member variables to size_t
when appropriate.
This fix excludes rocksdb, spider,spider, sphinx and connect for now.
Diffstat (limited to 'sql/sp_pcontext.cc')
-rw-r--r-- | sql/sp_pcontext.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index d7bc26901b0..83d674e7500 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -171,12 +171,12 @@ uint sp_pcontext::diff_handlers(const sp_pcontext *ctx, bool exclusive) const while (pctx && pctx != ctx) { - n+= pctx->m_handlers.elements(); + n+= (uint)pctx->m_handlers.elements(); last_ctx= pctx; pctx= pctx->parent_context(); } if (pctx) - return (exclusive && last_ctx ? n - last_ctx->m_handlers.elements() : n); + return (exclusive && last_ctx ? n -(uint) last_ctx->m_handlers.elements() : n); return 0; // Didn't find ctx } @@ -189,12 +189,12 @@ uint sp_pcontext::diff_cursors(const sp_pcontext *ctx, bool exclusive) const while (pctx && pctx != ctx) { - n+= pctx->m_cursors.elements(); + n+= (uint)pctx->m_cursors.elements(); last_ctx= pctx; pctx= pctx->parent_context(); } if (pctx) - return (exclusive && last_ctx ? n - last_ctx->m_cursors.elements() : n); + return (exclusive && last_ctx ? (uint)(n - last_ctx->m_cursors.elements()) : n); return 0; // Didn't find ctx } @@ -202,7 +202,7 @@ uint sp_pcontext::diff_cursors(const sp_pcontext *ctx, bool exclusive) const sp_variable *sp_pcontext::find_variable(const LEX_CSTRING *name, bool current_scope_only) const { - uint i= m_vars.elements() - m_pboundary; + size_t i= m_vars.elements() - m_pboundary; while (i--) { @@ -392,7 +392,7 @@ bool sp_pcontext::add_condition(THD *thd, sp_condition_value *sp_pcontext::find_condition(const LEX_CSTRING *name, bool current_scope_only) const { - uint i= m_conditions.elements(); + size_t i= m_conditions.elements(); while (i--) { @@ -605,7 +605,7 @@ const sp_pcursor *sp_pcontext::find_cursor(const LEX_CSTRING *name, uint *poff, bool current_scope_only) const { - uint i= m_cursors.elements(); + uint i= (uint)m_cursors.elements(); while (i--) { |