~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/list.c

  • Committer: Brian Aker
  • Date: 2008-08-11 04:55:59 UTC
  • Revision ID: brian@tangent.org-20080811045559-azgfc343y0igyzsz
ulong cleanup, remove log code from myisam.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "mysys_priv.h"
21
21
#include <my_list.h>
22
 
#include <stdlib.h>
23
22
 
24
23
 
25
24
 
53
52
}
54
53
 
55
54
 
56
 
void list_free(LIST *root, uint32_t free_data)
 
55
void list_free(LIST *root, uint free_data)
57
56
{
58
57
  LIST *next;
59
58
  while (root)
60
59
  {
61
60
    next=root->next;
62
61
    if (free_data)
63
 
      free((unsigned char*) root->data);
64
 
    free((unsigned char*) root);
 
62
      my_free((uchar*) root->data,MYF(0));
 
63
    my_free((uchar*) root,MYF(0));
65
64
    root=next;
66
65
  }
67
66
}
69
68
 
70
69
LIST *list_cons(void *data, LIST *list)
71
70
{
72
 
  LIST * const new_charset=(LIST*) malloc(sizeof(LIST));
 
71
  LIST * const new_charset=(LIST*) my_malloc(sizeof(LIST),MYF(MY_FAE));
73
72
  if (!new_charset)
74
73
    return NULL;
75
74
  new_charset->data=data;
92
91
  return last;
93
92
}
94
93
 
95
 
int list_walk(LIST *list, list_walk_action action, unsigned char* argument)
 
94
int list_walk(LIST *list, list_walk_action action, uchar* argument)
96
95
{
97
96
  while (list)
98
97
  {