From: xchaos Date: Tue, 8 Jan 2008 01:29:18 +0000 (+0000) Subject: bugfix in drop(item,list) X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=79c1af4ba4ce2faca03a60d9768873f494dd4c8b;p=svn%2FCll1h%2F.git bugfix in drop(item,list) git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@5 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- diff --git a/cll1.h b/cll1.h index 597a76a..47e7024 100644 --- a/cll1.h +++ b/cll1.h @@ -52,7 +52,7 @@ #define push(A,B) ((A && A!=B)?A->_next=B:0,B=A) #define pop(A,B) (B?((A?free(A):0),A=B=B->_next):(A=NULL)) #define append(A,B) if(B) { void *N=A; A->_next=NULL; for_search(A,B,!A->_next) {A->_next=N; break;}} else push(A,B); -#define remove(A,B,C) { void **_D=NULL; for_search(A,B,C) { if(_D)*_D=A->_next; else B=A->_next; free(A); A=NULL;} else _D=(void *)&(A->_next); } +#define remove(A,B,C) { void **_D=NULL; for_search(A,B,C) { if(_D)*_D=A->_next; else B=A->_next; free(A); } else _D=(void *)&(A->_next); } #define drop(A,B) for( A=B; A || (B=NULL); B=A, A=A->_next, free(B) ) /* ------------------------------------------------------------------- */ /* 3. C<<1 iterators - updated 2008-01-07 by xCh. */