aboutsummaryrefslogtreecommitdiffstats
path: root/src/list.c
diff options
context:
space:
mode:
authorAngelo Marletta <angelo.marletta@gmail.com>2015-02-17 01:04:25 -0800
committerAngelo Marletta <angelo.marletta@gmail.com>2015-02-17 01:04:25 -0800
commitfd48ecf5a123ddaf5dd02d7928f975db719975bb (patch)
tree7164753f2c3889cf29a21fab166a052f073a38de /src/list.c
parentfbed9dd0ba1e849ebc07f512903996879096df2d (diff)
parent37f61593b40aa98b465692d9a40c6ac03264a29a (diff)
downloadcpulimit-fd48ecf5a123ddaf5dd02d7928f975db719975bb.tar.gz
Merge pull request #43 from opsengine/cppcheck
fix cppcheck warnings
Diffstat (limited to 'src/list.c')
-rw-r--r--src/list.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/list.c b/src/list.c
index a1c20a3..2a78358 100644
--- a/src/list.c
+++ b/src/list.c
@@ -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);
Un proyecto texto-plano.xyz