diff options
author | Angelo Marletta <angelo.marletta@gmail.com> | 2015-02-17 01:04:25 -0800 |
---|---|---|
committer | Angelo Marletta <angelo.marletta@gmail.com> | 2015-02-17 01:04:25 -0800 |
commit | fd48ecf5a123ddaf5dd02d7928f975db719975bb (patch) | |
tree | 7164753f2c3889cf29a21fab166a052f073a38de /src/list.c | |
parent | fbed9dd0ba1e849ebc07f512903996879096df2d (diff) | |
parent | 37f61593b40aa98b465692d9a40c6ac03264a29a (diff) | |
download | cpulimit-fd48ecf5a123ddaf5dd02d7928f975db719975bb.tar.gz |
Merge pull request #43 from opsengine/cppcheck
fix cppcheck warnings
Diffstat (limited to 'src/list.c')
-rw-r--r-- | src/list.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -66,7 +66,6 @@ void delete_node(struct list *l,struct list_node *node) { } l->count--; free(node); - node = NULL; } void destroy_node(struct list *l,struct list_node *node) { @@ -75,7 +74,7 @@ void destroy_node(struct list *l,struct list_node *node) { delete_node(l,node); } -int is_EMPTYLIST_list(struct list *l) { +int is_empty_list(struct list *l) { return (l->count==0?TRUE:FALSE); } @@ -123,8 +122,8 @@ void *locate_elem(struct list *l,void *elem) { } void clear_list(struct list *l) { - struct list_node *tmp; while(l->first!=EMPTYLIST) { + struct list_node *tmp; tmp=l->first; l->first=l->first->next; free(tmp); @@ -135,8 +134,8 @@ void clear_list(struct list *l) { } void destroy_list(struct list *l) { - struct list_node *tmp; while(l->first!=EMPTYLIST) { + struct list_node *tmp; tmp=l->first; l->first=l->first->next; free(tmp->data); |