mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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.
This commit is contained in:
@ -191,9 +191,10 @@ public:
|
||||
return *((Elem*)pop_dynamic(&array));
|
||||
}
|
||||
|
||||
void del(uint idx)
|
||||
void del(size_t idx)
|
||||
{
|
||||
delete_dynamic_element(&array, idx);
|
||||
DBUG_ASSERT(idx <= array.max_element);
|
||||
delete_dynamic_element(&array, (uint)idx);
|
||||
}
|
||||
|
||||
size_t elements() const
|
||||
@ -204,7 +205,7 @@ public:
|
||||
void elements(size_t num_elements)
|
||||
{
|
||||
DBUG_ASSERT(num_elements <= array.max_element);
|
||||
array.elements= num_elements;
|
||||
array.elements= (uint)num_elements;
|
||||
}
|
||||
|
||||
void clear()
|
||||
@ -220,12 +221,12 @@ public:
|
||||
bool resize(size_t new_size, Elem default_val)
|
||||
{
|
||||
size_t old_size= elements();
|
||||
if (allocate_dynamic(&array, new_size))
|
||||
if (allocate_dynamic(&array, (uint)new_size))
|
||||
return true;
|
||||
|
||||
if (new_size > old_size)
|
||||
{
|
||||
set_dynamic(&array, (uchar*)&default_val, new_size - 1);
|
||||
set_dynamic(&array, (uchar*)&default_val, (uint)(new_size - 1));
|
||||
/*for (size_t i= old_size; i != new_size; i++)
|
||||
{
|
||||
at(i)= default_val;
|
||||
|
Reference in New Issue
Block a user