Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chk_list.h 文件里 chk_list_pushback 函数 #12

Open
zzh442856860 opened this issue Jan 5, 2017 · 1 comment
Open

chk_list.h 文件里 chk_list_pushback 函数 #12

zzh442856860 opened this issue Jan 5, 2017 · 1 comment

Comments

@zzh442856860
Copy link

//if push success,return the new size,else return -1
static inline size_t chk_list_pushback(chk_list *l,chk_list_entry *n) {
if(n->next) return chk_error_common;
if(0 == l->size) l->head = l->tail = n;
else {
l->tail->next = n; //这个尾指针的next,不应该是null吗,为何还是自己?
l->tail = n;
}
++l->size;
return chk_error_ok;
}

如果成功返回new size;未返回,实际返回chk_error_ok; 如果失败,返回的chk_error_common 是 1, 也不是-1

@sniperHW
Copy link
Owner

sniperHW commented Jan 5, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants