X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/dbfefcf1c7180deedc221f927dd01e8cbf3d6d21..19e44013088ff80c11e1d7c045331b96f4dc41f0:/blinklist.pas?ds=sidebyside diff --git a/blinklist.pas b/blinklist.pas old mode 100755 new mode 100644 index 5c3391d..ca05847 --- a/blinklist.pas +++ b/blinklist.pas @@ -1,10 +1,9 @@ - { Copyright (C) 2005 Bas Steendijk For conditions of distribution and use, see copyright notice in zlib_license.txt - which is included in the package - ----------------------------------------------------------------------------- } - + which is included in the package + ----------------------------------------------------------------------------- } unit blinklist; + {$ifdef fpc} {$mode delphi} {$endif} @@ -32,11 +31,11 @@ type end; tstringlinklist=class(tlinklist) - s:string; + s:ansistring; end; tthing=class(tlinklist) - name:string; {name/nick} + name:ansistring; {name/nick} hashname:integer; {hash of name} end; @@ -54,14 +53,14 @@ var linklistdebug:integer; implementation - -uses sysutils; + +uses sysutils; procedure linklistadd(var baseptr:tlinklist;newptr:tlinklist); var p:tlinklist; begin - if (newptr=baseptr) or assigned(newptr.prev) then raise exception.create('linklist double insertion detected'); + if (newptr=baseptr) or assigned(newptr.prev) then raise exception.create('linklist double insertion detected'); p := baseptr; baseptr := newptr; baseptr.prev := nil; @@ -73,8 +72,8 @@ procedure linklistdel(var baseptr:tlinklist;item:tlinklist); begin if item = baseptr then baseptr := item.next; if item.prev <> nil then item.prev.next := item.next; - if item.next <> nil then item.next.prev := item.prev; - item.prev := nil; + if item.next <> nil then item.next.prev := item.prev; + item.prev := nil; item.next := nil; end; @@ -82,7 +81,7 @@ procedure linklist2add(var baseptr,newptr:tlinklist2); var p:tlinklist2; begin - if (newptr=baseptr) or assigned(newptr.prev2) then raise exception.create('linklist2 double insertion detected'); + if (newptr=baseptr) or assigned(newptr.prev2) then raise exception.create('linklist2 double insertion detected'); p := baseptr; baseptr := newptr; baseptr.prev2 := nil; @@ -94,8 +93,8 @@ procedure linklist2del(var baseptr:tlinklist2;item:tlinklist2); begin if item = baseptr then baseptr := item.next2; if item.prev2 <> nil then item.prev2.next2 := item.next2; - if item.next2 <> nil then item.next2.prev2 := item.prev2; - item.prev2 := nil; + if item.next2 <> nil then item.next2.prev2 := item.prev2; + item.prev2 := nil; item.next2 := nil; end;