diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-08 10:49:18 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-08 10:49:18 -0400 |
commit | c8a1e0531d7ccdce5f76aec8a5b6147c686d3403 (patch) | |
tree | 2a68ab7da901a96fea975ca2ec02a9c77137686b /kernel/old/list.c | |
parent | tty => term (diff) | |
download | comus-c8a1e0531d7ccdce5f76aec8a5b6147c686d3403.tar.gz comus-c8a1e0531d7ccdce5f76aec8a5b6147c686d3403.tar.bz2 comus-c8a1e0531d7ccdce5f76aec8a5b6147c686d3403.zip |
fix old checkout
Diffstat (limited to 'kernel/old/list.c')
-rw-r--r-- | kernel/old/list.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/old/list.c b/kernel/old/list.c index 5492615..084000a 100644 --- a/kernel/old/list.c +++ b/kernel/old/list.c @@ -29,11 +29,11 @@ ** @param[in,out] list The address of a list_t variable ** @param[in] data The data to prepend to the list */ -void list_add(list_t *list, void *data) -{ +void list_add( list_t *list, void *data ) { + // sanity checks - assert1(list != NULL); - assert1(data != NULL); + assert1( list != NULL ); + assert1( data != NULL ); list_t *tmp = (list_t *)data; tmp->next = list->next; @@ -49,15 +49,16 @@ void list_add(list_t *list, void *data) ** ** @return a pointer to the removed data, or NULL if the list was empty */ -void *list_remove(list_t *list) -{ - assert1(list != NULL); +void *list_remove( list_t *list ) { + + assert1( list != NULL ); list_t *data = list->next; - if (data != NULL) { + if( data != NULL ) { list->next = data->next; data->next = NULL; } return (void *)data; } + |