Avoid future confusions with how default values are set.

This commit is contained in:
Hisham Muhammad
2015-08-12 17:29:32 -03:00
parent e1e3ffad19
commit 0ebe688d24
5 changed files with 29 additions and 19 deletions

View File

@ -49,11 +49,19 @@ ObjectClass CheckItem_class = {
.delete = CheckItem_delete
};
CheckItem* CheckItem_new(char* text, bool* ref, bool value) {
CheckItem* CheckItem_newByRef(char* text, bool* ref) {
CheckItem* this = AllocThis(CheckItem);
this->text = text;
this->value = false;
this->ref = ref;
return this;
}
CheckItem* CheckItem_newByVal(char* text, bool value) {
CheckItem* this = AllocThis(CheckItem);
this->text = text;
this->value = value;
this->ref = ref;
this->ref = NULL;
return this;
}