Changeset f4e857f
- Timestamp:
- Jun 27, 2011, 4:28:51 AM (14 years ago)
- Children:
- 0d935a1
- Parents:
- eeba011
- git-author:
- Jason Gross <jgross@mit.edu> (06/27/11 02:04:09)
- git-committer:
- Jason Gross <jgross@mit.edu> (06/27/11 04:28:51)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
variable.c
reeba011 rf4e857f 726 726 727 727 const char *owl_variable_get_validsettings(const owl_variable *v) { 728 if (v->validsettings) { 729 return v->validsettings; 730 } else { 731 return ""; 732 } 728 return v->validsettings; 733 729 } 734 730 … … 758 754 return -1; 759 755 } 760 if (msg && v->get_tostring_fn) {756 if (msg) { 761 757 tostring = v->get_tostring_fn(v, v->get_fn(v)); 762 758 owl_function_makemsg("%s = '%s'", name, tostring); … … 797 793 if (!name) return NULL; 798 794 v = owl_dict_find_element(d, name); 799 if (v == NULL || !v->get_tostring_fn) return NULL;795 if (v == NULL) return NULL; 800 796 return v->get_tostring_fn(v, v->get_fn(v)); 801 797 } … … 806 802 if (!name) return NULL; 807 803 v = owl_dict_find_element(d, name); 808 if (v == NULL || !v->get_tostring_fn) return NULL;804 if (v == NULL) return NULL; 809 805 if (v->type == OWL_VARIABLE_INT || v->type == OWL_VARIABLE_BOOL) { 810 806 return v->get_tostring_fn(v, &(v->ival_default)); … … 819 815 if (!name) return(NULL); 820 816 v = owl_dict_find_element(d, name); 821 if (v == NULL || !v->get_fn) return NULL;817 if (v == NULL) return NULL; 822 818 return v; 823 819 } … … 862 858 863 859 if (!name 864 || (v = owl_dict_find_element(d, name)) == NULL 865 || !v->get_fn) { 860 || (v = owl_dict_find_element(d, name)) == NULL) { 866 861 owl_fmtext_appendf_normal(fm, " No such variable '%s'\n", name); 867 862 return; … … 883 878 884 879 if (!name 885 || (v = owl_dict_find_element(d, name)) == NULL 886 || !v->get_fn) { 880 || (v = owl_dict_find_element(d, name)) == NULL) { 887 881 owl_fmtext_append_normal(fm, "No such variable...\n"); 888 882 return;
Note: See TracChangeset
for help on using the changeset viewer.