[Freeciv-Dev] patch: genlist doc/comments and fixes
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
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 <=
|
|