~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/array.c

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    false       Ok
41
41
*/
42
42
 
43
 
bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
44
 
                            void *init_buffer, uint init_alloc, 
45
 
                            uint alloc_increment CALLER_INFO_PROTO)
 
43
bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint32_t element_size,
 
44
                            void *init_buffer, uint32_t init_alloc, 
 
45
                            uint32_t alloc_increment CALLER_INFO_PROTO)
46
46
{
47
47
  if (!alloc_increment)
48
48
  {
71
71
  return(false);
72
72
73
73
 
74
 
bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
75
 
                           uint init_alloc, 
76
 
                           uint alloc_increment CALLER_INFO_PROTO)
 
74
bool init_dynamic_array(DYNAMIC_ARRAY *array, uint32_t element_size,
 
75
                           uint32_t init_alloc, 
 
76
                           uint32_t alloc_increment CALLER_INFO_PROTO)
77
77
{
78
78
  /* placeholder to preserve ABI */
79
79
  return my_init_dynamic_array_ci(array, element_size, init_alloc, 
196
196
    false       Ok
197
197
*/
198
198
 
199
 
bool set_dynamic(DYNAMIC_ARRAY *array, unsigned char* element, uint idx)
 
199
bool set_dynamic(DYNAMIC_ARRAY *array, unsigned char* element, uint32_t idx)
200
200
{
201
201
  if (idx >= array->elements)
202
202
  {
228
228
    true        Allocation of new memory failed
229
229
*/
230
230
 
231
 
bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements)
 
231
bool allocate_dynamic(DYNAMIC_ARRAY *array, uint32_t max_elements)
232
232
{
233
233
  if (max_elements >= array->max_element)
234
234
  {
235
 
    uint size;
 
235
    uint32_t size;
236
236
    unsigned char *new_ptr;
237
237
    size= (max_elements + array->alloc_increment)/array->alloc_increment;
238
238
    size*= array->alloc_increment;
273
273
      idx       Index of element wanted. 
274
274
*/
275
275
 
276
 
void get_dynamic(DYNAMIC_ARRAY *array, unsigned char* element, uint idx)
 
276
void get_dynamic(DYNAMIC_ARRAY *array, unsigned char* element, uint32_t idx)
277
277
{
278
278
  if (idx >= array->elements)
279
279
  {
318
318
      idx        Index of element to be deleted
319
319
*/
320
320
 
321
 
void delete_dynamic_element(DYNAMIC_ARRAY *array, uint idx)
 
321
void delete_dynamic_element(DYNAMIC_ARRAY *array, uint32_t idx)
322
322
{
323
323
  char *ptr= (char*) array->buffer+array->size_of_element*idx;
324
324
  array->elements--;
338
338
 
339
339
void freeze_size(DYNAMIC_ARRAY *array)
340
340
{
341
 
  uint elements=cmax(array->elements,1);
 
341
  uint32_t elements=cmax(array->elements,1);
342
342
 
343
343
  /*
344
344
    Do nothing if we are using a static buffer
368
368
 
369
369
int get_index_dynamic(DYNAMIC_ARRAY *array, unsigned char* element)
370
370
{
371
 
  uint ret;
 
371
  uint32_t ret;
372
372
  if (array->buffer > element)
373
373
    return -1;
374
374