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