summaryrefslogtreecommitdiff
path: root/mysys/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/array.c')
-rw-r--r--mysys/array.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/mysys/array.c b/mysys/array.c
index f42b7c463a6..e92c5b45e67 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -48,7 +48,7 @@ my_bool my_init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
DBUG_ENTER("my_init_dynamic_array2");
if (!alloc_increment)
{
- alloc_increment=max((8192-MALLOC_OVERHEAD)/element_size,16);
+ alloc_increment=MY_MAX((8192-MALLOC_OVERHEAD)/element_size,16);
if (init_alloc > 8 && alloc_increment > init_alloc * 2)
alloc_increment=init_alloc*2;
}
@@ -83,9 +83,9 @@ my_bool my_init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
FALSE Ok
*/
-my_bool insert_dynamic(DYNAMIC_ARRAY *array, const uchar* element)
+my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void * element)
{
- uchar* buffer;
+ void *buffer;
if (array->elements == array->max_element)
{ /* Call only when nessesary */
if (!(buffer=alloc_dynamic(array)))
@@ -118,7 +118,7 @@ my_bool insert_dynamic(DYNAMIC_ARRAY *array, const uchar* element)
0 Error
*/
-uchar *alloc_dynamic(DYNAMIC_ARRAY *array)
+void *alloc_dynamic(DYNAMIC_ARRAY *array)
{
DBUG_ENTER("alloc_dynamic");
if (array->elements == array->max_element)
@@ -164,7 +164,7 @@ uchar *alloc_dynamic(DYNAMIC_ARRAY *array)
0 Array is empty
*/
-uchar *pop_dynamic(DYNAMIC_ARRAY *array)
+void *pop_dynamic(DYNAMIC_ARRAY *array)
{
if (array->elements)
return array->buffer+(--array->elements * array->size_of_element);
@@ -189,7 +189,7 @@ uchar *pop_dynamic(DYNAMIC_ARRAY *array)
FALSE Ok
*/
-my_bool set_dynamic(DYNAMIC_ARRAY *array, uchar* element, uint idx)
+my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element, uint idx)
{
if (idx >= array->elements)
{
@@ -266,7 +266,7 @@ my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements)
idx Index of element wanted.
*/
-void get_dynamic(DYNAMIC_ARRAY *array, uchar* element, uint idx)
+void get_dynamic(DYNAMIC_ARRAY *array, void *element, uint idx)
{
if (idx >= array->elements)
{
@@ -350,7 +350,7 @@ void delete_dynamic_with_callback(DYNAMIC_ARRAY *array, FREE_FUNC f) {
void freeze_size(DYNAMIC_ARRAY *array)
{
- uint elements=max(array->elements,1);
+ uint elements=MY_MAX(array->elements,1);
/*
Do nothing if we are using a static buffer
@@ -378,13 +378,13 @@ void freeze_size(DYNAMIC_ARRAY *array)
*/
-int get_index_dynamic(DYNAMIC_ARRAY *array, uchar* element)
+int get_index_dynamic(DYNAMIC_ARRAY *array, void* element)
{
size_t ret;
- if (array->buffer > element)
+ if (array->buffer > (uchar*) element)
return -1;
- ret= (element - array->buffer) / array->size_of_element;
+ ret= ((uchar*) element - array->buffer) / array->size_of_element;
if (ret > array->elements)
return -1;