Changeset bbd74a9
- Timestamp:
- Mar 7, 2010, 10:25:56 PM (15 years ago)
- Branches:
- master, release-1.10, 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)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.h
rdffb8b8 rbbd74a9 252 252 /* converts val to a string 253 253 * and puts into buf */ 254 void (*free_fn)(struct _owl_variable *v);254 void (*delete_fn)(struct _owl_variable *v); 255 255 /* frees val as needed */ 256 256 } owl_variable; -
variable.c
r3b0edaa rbbd74a9 482 482 if (!cur->get_tostring_fn) 483 483 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; 486 486 cur->set_fn(cur, cur->pval_default); 487 487 break; … … 497 497 if (!cur->get_tostring_fn) 498 498 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; 501 501 cur->val = owl_malloc(sizeof(int)); 502 502 cur->set_fn(cur, &cur->ival_default); … … 513 513 if (!cur->get_tostring_fn) 514 514 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; 517 517 cur->val = owl_malloc(sizeof(int)); 518 518 cur->set_fn(cur, &cur->ival_default); … … 562 562 var->get_fn = owl_variable_get_default; 563 563 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; 565 565 var->set_fn(var, initval); 566 566 owl_variable_dict_add_variable(vd, var); … … 582 582 var->get_fn = owl_variable_get_default; 583 583 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; 585 585 var->val = owl_malloc(sizeof(int)); 586 586 var->set_fn(var, &initval); … … 603 603 var->get_fn = owl_variable_get_default; 604 604 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; 606 606 var->val = owl_malloc(sizeof(int)); 607 607 var->set_fn(var, &initval); … … 625 625 void owl_variable_delete(owl_variable *v) 626 626 { 627 if (v-> free_fn) v->free_fn(v);627 if (v->delete_fn) v->delete_fn(v); 628 628 owl_free(v); 629 629 } … … 845 845 } 846 846 847 void owl_variable_free_default(owl_variable *v) { 847 void owl_variable_delete_default(owl_variable *v) 848 { 848 849 if (v->val) owl_free(v->val); 849 850 }
Note: See TracChangeset
for help on using the changeset viewer.