From 656658a0ef54e84df8123640ba7e2e591d903bd2 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Thu, 8 Feb 2018 10:37:44 +0800 Subject: [PATCH] Fix some faults. --- list/list.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/list/list.h b/list/list.h index 38c9203..9b069db 100644 --- a/list/list.h +++ b/list/list.h @@ -1,15 +1,15 @@ typedef struct Node{ - unsigned long int id;//what's this? + unsigned long int id; void *value; - Node *next; - Node *last; -}; + struct Node *next; + struct Node *last; +}Node; typedef struct List{ Node *head; Node *tail; unsigned long int length; -}; +}List; List *init_list(); Node *init_node(); @@ -29,6 +29,7 @@ int insertInHead(List *p_list, Node *p_node){ //p_node->last = NULL; p_node->next = p_list->head; p_list->head = p_node; + return 0; } int insertInTail(List *p_list, Node *p_node){ @@ -36,4 +37,5 @@ int insertInTail(List *p_list, Node *p_node){ //p_node->next = NULL; p_node->last = p_list->tail; p_list->tail = p_node; + return 0; }