Changeset 4d86e06 for variable.c
- Timestamp:
- Jul 23, 2009, 12:53:57 AM (16 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- ba6c8bd
- Parents:
- 029a8b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
variable.c
rd43edd2 r4d86e06 521 521 return(-2); 522 522 } 523 owl_dict_insert_element(vd, cur->name, (void*)cur, NULL);523 owl_dict_insert_element(vd, cur->name, cur, NULL); 524 524 } 525 525 return 0; … … 528 528 void owl_variable_dict_add_variable(owl_vardict * vardict, 529 529 owl_variable * var) { 530 owl_dict_insert_element(vardict, var->name, (void*)var, (void(*)(void*))owl_variable_free);530 owl_dict_insert_element(vardict, var->name, var, (void(*)(void*))owl_variable_free); 531 531 } 532 532 533 533 owl_variable * owl_variable_newvar(char *name, char *summary, char * description) { 534 owl_variable * var = (owl_variable*)owl_malloc(sizeof(owl_variable));534 owl_variable * var = owl_malloc(sizeof(owl_variable)); 535 535 memset(var, 0, sizeof(owl_variable)); 536 536 var->name = owl_strdup(name); … … 739 739 /* returns a reference */ 740 740 char *owl_variable_get_string(owl_vardict *d, char *name) { 741 return (char*)owl_variable_get(d,name, OWL_VARIABLE_STRING);741 return owl_variable_get(d,name, OWL_VARIABLE_STRING); 742 742 } 743 743 744 744 /* returns a reference */ 745 745 void *owl_variable_get_other(owl_vardict *d, char *name) { 746 return (char*)owl_variable_get(d,name, OWL_VARIABLE_OTHER);746 return owl_variable_get(d,name, OWL_VARIABLE_OTHER); 747 747 } 748 748 749 749 int owl_variable_get_int(owl_vardict *d, char *name) { 750 750 int *pi; 751 pi = (int*)owl_variable_get(d,name,OWL_VARIABLE_INT);751 pi = owl_variable_get(d,name,OWL_VARIABLE_INT); 752 752 if (!pi) return(-1); 753 753 return(*pi); … … 756 756 int owl_variable_get_bool(owl_vardict *d, char *name) { 757 757 int *pi; 758 pi = (int*)owl_variable_get(d,name,OWL_VARIABLE_BOOL);758 pi = owl_variable_get(d,name,OWL_VARIABLE_BOOL); 759 759 if (!pi) return(-1); 760 760 return(*pi);
Note: See TracChangeset
for help on using the changeset viewer.