Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2000:
[Freeciv-Dev] patch: genlist doc/comments and fixes
Home

[Freeciv-Dev] patch: genlist doc/comments and fixes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] patch: genlist doc/comments and fixes
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 23 Jan 2000 14:35:18 +1100 (EST)

There was some recent mention of genlists being scary and/or 
hard to understand, so I thought I'd add some comments to the
genlist code.  

While reading the code to make sure my comments were right, I
also noticed and fixed some deficiencies:

- find_genlist_position() would break for pos<-1; now it 
  returns null_link as in other out-of-bounds cases;

- genlist_insert() was completely broken for pos other than
  0 or -1.  However this has never showed up because the Freeciv
  code only ever uses genlist_insert() with pos of 0 or -1 (!(?))
  Fixed, and also made sure pos out of range does something sensible
  (treats as -1).

genlists are pretty simple, really ;-)

-- David

Attachment: doc_genlist.diff.gz
Description: GNU Zip compressed data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] patch: genlist doc/comments and fixes, David Pfitzner <=