diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2008-03-09 08:58:38 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2008-03-09 08:58:38 +0000 |
commit | da23c8c5a188324455c8f417293c10d85f65cb63 (patch) | |
tree | d7a4b8cb0af705de6650e20e00ba3da04d84b27f /CheckItem.c | |
parent | 12f4f09e6ed288bdedc86e4ef22f3cc34f0e787a (diff) |
Clean up headers by using 'static' whenever possible.
Reduces resulting code size.
Diffstat (limited to 'CheckItem.c')
-rw-r--r-- | CheckItem.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/CheckItem.c b/CheckItem.c index 45c0b22b..3808f7ad 100644 --- a/CheckItem.c +++ b/CheckItem.c @@ -28,6 +28,26 @@ char* CHECKITEM_CLASS = "CheckItem"; #define CHECKITEM_CLASS NULL #endif +static void CheckItem_delete(Object* cast) { + CheckItem* this = (CheckItem*)cast; + assert (this != NULL); + + free(this->text); + free(this); +} + +static void CheckItem_display(Object* cast, RichString* out) { + CheckItem* this = (CheckItem*)cast; + assert (this != NULL); + RichString_write(out, CRT_colors[CHECK_BOX], "["); + if (CheckItem_get(this)) + RichString_append(out, CRT_colors[CHECK_MARK], "x"); + else + RichString_append(out, CRT_colors[CHECK_MARK], " "); + RichString_append(out, CRT_colors[CHECK_BOX], "] "); + RichString_append(out, CRT_colors[CHECK_TEXT], this->text); +} + CheckItem* CheckItem_new(char* text, bool* ref, bool value) { CheckItem* this = malloc(sizeof(CheckItem)); Object_setClass(this, CHECKITEM_CLASS); @@ -39,14 +59,6 @@ CheckItem* CheckItem_new(char* text, bool* ref, bool value) { return this; } -void CheckItem_delete(Object* cast) { - CheckItem* this = (CheckItem*)cast; - assert (this != NULL); - - free(this->text); - free(this); -} - void CheckItem_set(CheckItem* this, bool value) { if (this->ref) *(this->ref) = value; @@ -60,15 +72,3 @@ bool CheckItem_get(CheckItem* this) { else return this->value; } - -void CheckItem_display(Object* cast, RichString* out) { - CheckItem* this = (CheckItem*)cast; - assert (this != NULL); - RichString_write(out, CRT_colors[CHECK_BOX], "["); - if (CheckItem_get(this)) - RichString_append(out, CRT_colors[CHECK_MARK], "x"); - else - RichString_append(out, CRT_colors[CHECK_MARK], " "); - RichString_append(out, CRT_colors[CHECK_BOX], "] "); - RichString_append(out, CRT_colors[CHECK_TEXT], this->text); -} |