fix indent
This commit is contained in:
parent
fa80d635c0
commit
f2dda6e115
@ -4,12 +4,12 @@
|
||||
/* */
|
||||
struct capwap_list* capwap_list_create(void) {
|
||||
struct capwap_list* list;
|
||||
|
||||
|
||||
list = (struct capwap_list*)capwap_alloc(sizeof(struct capwap_list));
|
||||
if (!list) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
|
||||
memset(list, 0, sizeof(struct capwap_list));
|
||||
return list;
|
||||
}
|
||||
@ -17,7 +17,7 @@ struct capwap_list* capwap_list_create(void) {
|
||||
/* */
|
||||
void capwap_list_free(struct capwap_list* list) {
|
||||
ASSERT(list != NULL);
|
||||
|
||||
|
||||
capwap_list_flush(list);
|
||||
capwap_free(list);
|
||||
}
|
||||
@ -35,7 +35,7 @@ void capwap_list_flush(struct capwap_list* list) {
|
||||
capwap_itemlist_free(item);
|
||||
item = next;
|
||||
}
|
||||
|
||||
|
||||
list->first = NULL;
|
||||
list->last = NULL;
|
||||
list->count = 0;
|
||||
@ -44,17 +44,17 @@ void capwap_list_flush(struct capwap_list* list) {
|
||||
/* */
|
||||
struct capwap_list_item* capwap_itemlist_create_with_item(void* item, int size) {
|
||||
struct capwap_list_item* itemlist;
|
||||
|
||||
|
||||
itemlist = (struct capwap_list_item*)capwap_alloc(sizeof(struct capwap_list_item));
|
||||
if (!itemlist) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
|
||||
memset(itemlist, 0, sizeof(struct capwap_list_item));
|
||||
itemlist->item = item;
|
||||
itemlist->itemsize = size;
|
||||
itemlist->autodelete = 1;
|
||||
|
||||
|
||||
return itemlist;
|
||||
}
|
||||
|
||||
@ -63,12 +63,12 @@ struct capwap_list_item* capwap_itemlist_create(int size) {
|
||||
void* item;
|
||||
|
||||
ASSERT(size > 0);
|
||||
|
||||
|
||||
item = capwap_alloc(size);
|
||||
if (!item) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
|
||||
return capwap_itemlist_create_with_item(item, size);
|
||||
}
|
||||
|
||||
@ -76,11 +76,11 @@ struct capwap_list_item* capwap_itemlist_create(int size) {
|
||||
void capwap_itemlist_free(struct capwap_list_item* item) {
|
||||
ASSERT(item != NULL);
|
||||
ASSERT(item->item != NULL);
|
||||
|
||||
|
||||
if (item->autodelete) {
|
||||
capwap_free(item->item);
|
||||
}
|
||||
|
||||
|
||||
capwap_free(item);
|
||||
}
|
||||
|
||||
@ -104,16 +104,16 @@ struct capwap_list_item* capwap_itemlist_remove(struct capwap_list* list, struct
|
||||
item->next = NULL;
|
||||
item->prev = NULL;
|
||||
list->count--;
|
||||
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
/* */
|
||||
struct capwap_list_item* capwap_itemlist_remove_head(struct capwap_list* list) {
|
||||
struct capwap_list_item* item;
|
||||
|
||||
|
||||
ASSERT(list != NULL);
|
||||
|
||||
|
||||
item = list->first;
|
||||
if (item != NULL) {
|
||||
list->first = item->next;
|
||||
@ -122,12 +122,12 @@ struct capwap_list_item* capwap_itemlist_remove_head(struct capwap_list* list) {
|
||||
} else {
|
||||
list->last = NULL;
|
||||
}
|
||||
|
||||
|
||||
item->next = NULL;
|
||||
item->prev = NULL;
|
||||
list->count--;
|
||||
}
|
||||
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ void capwap_itemlist_insert_before(struct capwap_list* list, struct capwap_list_
|
||||
ASSERT(item != NULL);
|
||||
|
||||
list->count++;
|
||||
|
||||
|
||||
if (!before) {
|
||||
if (list->first) {
|
||||
before = list->first;
|
||||
@ -149,7 +149,7 @@ void capwap_itemlist_insert_before(struct capwap_list* list, struct capwap_list_
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
item->prev = before->prev;
|
||||
item->next = before;
|
||||
if (!before->prev) {
|
||||
@ -164,7 +164,7 @@ void capwap_itemlist_insert_before(struct capwap_list* list, struct capwap_list_
|
||||
void capwap_itemlist_insert_after(struct capwap_list* list, struct capwap_list_item* after, struct capwap_list_item* item) {
|
||||
ASSERT(list != NULL);
|
||||
ASSERT(item != NULL);
|
||||
|
||||
|
||||
list->count++;
|
||||
|
||||
if (!after) {
|
||||
@ -178,7 +178,7 @@ void capwap_itemlist_insert_after(struct capwap_list* list, struct capwap_list_i
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
item->prev = after;
|
||||
item->next = after->next;
|
||||
if (!after->next) {
|
||||
|
Loading…
Reference in New Issue
Block a user