1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58:08 +01:00

Removed some unused code from the treebag

This commit is contained in:
dan
2000-09-15 05:02:01 +00:00
parent 595d2b060b
commit e01ef57d4b
2 changed files with 5 additions and 37 deletions

View File

@@ -333,11 +333,7 @@ extern const WMHashTableCallbacks WMStringPointerHashCallbacks;
* aren't in the end
* Element indexes with large difference will cause large holes
*/
#if 0
WMBag* WMCreateArrayBag(int initialSize);
WMBag* WMCreateArrayBagWithDestructor(int initialSize,
void (*destructor)(void*));
#endif
/*
* Tree bags use a red-black tree for storage.
* Item indexes may be any integer number.
@@ -417,7 +413,6 @@ void* WMBagIteratorAtIndex(WMBag *self, int index, WMBagIterator *ptr);
int WMBagIndexForIterator(WMBag *bag, WMBagIterator ptr);
#define WM_ITERATE_BAG(bag, var, i) \
for (var = WMBagFirst(bag, &(i)); (i) != NULL; \
var = WMBagNext(bag, &(i)))

View File

@@ -30,31 +30,6 @@ typedef struct W_Bag {
} W_Bag;
#if 0
static int getItemCount(WMBag *self);
static int appendBag(WMBag *self, WMBag *bag);
static int putInBag(WMBag *self, void *item);
static int insertInBag(WMBag *self, int index, void *item);
static int removeFromBag(WMBag *bag, void *item);
static int eraseFromBag(WMBag *bag, int index);
static int deleteFromBag(WMBag *bag, int index);
static void *getFromBag(WMBag *bag, int index);
static int countInBag(WMBag *bag, void *item);
static int firstInBag(WMBag *bag, void *item);
static void *replaceInBag(WMBag *bag, int index, void *item);
static int sortBag(WMBag *bag, int (*comparer)(const void*, const void*));
static void emptyBag(WMBag *bag);
static void freeBag(WMBag *bag);
static void mapBag(WMBag *bag, void (*function)(void*, void*), void *data);
static int findInBag(WMBag *bag, int (*match)(void*,void*), void *data);
static void *first(WMBag *bag, WMBagIterator *ptr);
static void *last(WMBag *bag, WMBagIterator *ptr);
static void *next(WMBag *bag, WMBagIterator *ptr);
static void *previous(WMBag *bag, WMBagIterator *ptr);
static void *iteratorAtIndex(WMBag *bag, int index, WMBagIterator *ptr);
static int indexForIterator(WMBag *bag, WMBagIterator ptr);
#endif
#define IS_LEFT(node) (node == node->parent->left)
#define IS_RIGHT(node) (node == node->parent->right)
@@ -382,7 +357,8 @@ treeFind(W_Node *root, W_Node *nil, void *data)
#if 0
static char buf[512];
static void printNodes(W_Node *node, W_Node *nil, int depth)
static void
printNodes(W_Node *node, W_Node *nil, int depth)
{
if (node == nil) {
return;
@@ -401,7 +377,8 @@ static void printNodes(W_Node *node, W_Node *nil, int depth)
}
void PrintTree(WMBag *bag)
void
PrintTree(WMBag *bag)
{
W_TreeBag *tree = (W_TreeBag*)bag->data;
@@ -410,8 +387,6 @@ void PrintTree(WMBag *bag)
#endif
//#define SELF ((W_TreeBag*)self->data)
WMBag*
WMCreateTreeBag(void)
{
@@ -462,14 +437,12 @@ WMAppendBag(WMBag *self, WMBag *bag)
return 1;
}
//extern WMBag *bla;
int
WMPutInBag(WMBag *self, void *item)
{
W_Node *ptr;
ptr = wmalloc(sizeof(W_Node));
ptr->data = item;