1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

WL1034 update for latest 5.1 sources

BUILD/SETUP.sh:
  for now no optimizations in debug build - get rid of "value optimized out"
This commit is contained in:
unknown
2005-12-02 13:07:02 +01:00
parent dad8c66501
commit 4d891eb91c
21 changed files with 676 additions and 68 deletions

View File

@ -278,3 +278,28 @@ void freeze_size(DYNAMIC_ARRAY *array)
array->max_element=elements;
}
}
/*
Get the index of a dynamic element
SYNOPSIS
get_index_dynamic()
array Array
element Whose element index
*/
int get_index_dynamic(DYNAMIC_ARRAY *array, gptr element)
{
uint ret;
if (array->buffer > element)
return -1;
ret= (element - array->buffer) / array->size_of_element;
if (ret > array->elements)
return -1;
return ret;
}