diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:20 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:20 +0200 |
commit | 85bb4ad9cb820ac3b8e935a930084a06cbfd2847 (patch) | |
tree | 681fd9b2d9fa80931b2a8bec4bb6667865b7c569 /ListItem.c | |
parent | ea859f50d9438bc61ae96721a4d255b49de78653 (diff) | |
download | debian_htop-85bb4ad9cb820ac3b8e935a930084a06cbfd2847.tar.gz debian_htop-85bb4ad9cb820ac3b8e935a930084a06cbfd2847.tar.bz2 debian_htop-85bb4ad9cb820ac3b8e935a930084a06cbfd2847.zip |
Imported Upstream version 0.6.3upstream/0.6.3
Diffstat (limited to 'ListItem.c')
-rw-r--r-- | ListItem.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -21,18 +21,19 @@ typedef struct ListItem_ { int key; } ListItem; -extern char* LISTITEM_CLASS; }*/ -/* private property */ +#ifdef DEBUG char* LISTITEM_CLASS = "ListItem"; +#else +#define LISTITEM_CLASS NULL +#endif ListItem* ListItem_new(char* value, int key) { ListItem* this = malloc(sizeof(ListItem)); - ((Object*)this)->class = LISTITEM_CLASS; + Object_setClass(this, LISTITEM_CLASS); ((Object*)this)->display = ListItem_display; ((Object*)this)->delete = ListItem_delete; - ((Object*)this)->compare = ListItem_compare; this->value = String_copy(value); this->key = key; return this; @@ -64,7 +65,7 @@ const char* ListItem_getRef(ListItem* this) { return this->value; } -int ListItem_compare(const Object* cast1, const Object* cast2) { +int ListItem_compare(const void* cast1, const void* cast2) { ListItem* obj1 = (ListItem*) cast1; ListItem* obj2 = (ListItem*) cast2; return strcmp(obj1->value, obj2->value); |