Changeset bbd74a9


Ignore:
Timestamp:
Mar 7, 2010, 10:25:56 PM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
0fef6eb
Parents:
3b0edaa
git-author:
Anders Kaseorg <andersk@mit.edu> (02/27/10 20:13:32)
git-committer:
Anders Kaseorg <andersk@mit.edu> (03/07/10 22:25:56)
Message:
Rename owl_variable.free_fn to delete_fn.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Nelson Elhage <nelhage@mit.edu>
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • owl.h

    rdffb8b8 rbbd74a9  
    252252                                /* converts val to a string
    253253                                 * and puts into buf */
    254   void  (*free_fn)(struct _owl_variable *v);
     254  void (*delete_fn)(struct _owl_variable *v);
    255255                                /* frees val as needed */
    256256} owl_variable;
  • variable.c

    r3b0edaa rbbd74a9  
    482482      if (!cur->get_tostring_fn)
    483483        cur->get_tostring_fn = owl_variable_string_get_tostring_default;     
    484       if (!cur->free_fn)
    485         cur->free_fn = owl_variable_free_default;
     484      if (!cur->delete_fn)
     485        cur->delete_fn = owl_variable_delete_default;
    486486      cur->set_fn(cur, cur->pval_default);
    487487      break;
     
    497497      if (!cur->get_tostring_fn)
    498498        cur->get_tostring_fn = owl_variable_bool_get_tostring_default;     
    499       if (!cur->free_fn)
    500         cur->free_fn = owl_variable_free_default;
     499      if (!cur->delete_fn)
     500        cur->delete_fn = owl_variable_delete_default;
    501501      cur->val = owl_malloc(sizeof(int));
    502502      cur->set_fn(cur, &cur->ival_default);
     
    513513      if (!cur->get_tostring_fn)
    514514        cur->get_tostring_fn = owl_variable_int_get_tostring_default;     
    515       if (!cur->free_fn)
    516         cur->free_fn = owl_variable_free_default;
     515      if (!cur->delete_fn)
     516        cur->delete_fn = owl_variable_delete_default;
    517517      cur->val = owl_malloc(sizeof(int));
    518518      cur->set_fn(cur, &cur->ival_default);
     
    562562    var->get_fn = owl_variable_get_default;
    563563    var->get_tostring_fn = owl_variable_string_get_tostring_default;
    564     var->free_fn = owl_variable_free_default;
     564    var->delete_fn = owl_variable_delete_default;
    565565    var->set_fn(var, initval);
    566566    owl_variable_dict_add_variable(vd, var);
     
    582582    var->get_fn = owl_variable_get_default;
    583583    var->get_tostring_fn = owl_variable_int_get_tostring_default;
    584     var->free_fn = owl_variable_free_default;
     584    var->delete_fn = owl_variable_delete_default;
    585585    var->val = owl_malloc(sizeof(int));
    586586    var->set_fn(var, &initval);
     
    603603    var->get_fn = owl_variable_get_default;
    604604    var->get_tostring_fn = owl_variable_bool_get_tostring_default;
    605     var->free_fn = owl_variable_free_default;
     605    var->delete_fn = owl_variable_delete_default;
    606606    var->val = owl_malloc(sizeof(int));
    607607    var->set_fn(var, &initval);
     
    625625void owl_variable_delete(owl_variable *v)
    626626{
    627   if (v->free_fn) v->free_fn(v);
     627  if (v->delete_fn) v->delete_fn(v);
    628628  owl_free(v);
    629629}
     
    845845}
    846846
    847 void owl_variable_free_default(owl_variable *v) {
     847void owl_variable_delete_default(owl_variable *v)
     848{
    848849  if (v->val) owl_free(v->val);
    849850}
Note: See TracChangeset for help on using the changeset viewer.