From da23c8c5a188324455c8f417293c10d85f65cb63 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sun, 9 Mar 2008 08:58:38 +0000 Subject: Clean up headers by using 'static' whenever possible. Reduces resulting code size. --- CheckItem.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'CheckItem.c') 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); -} -- cgit v1.2.3