patchFreeciv - Patches: patch #1651, <genlist>_list_update() and...

Show feedback again

patch #1651: <genlist>_list_update() and <genlist>_list_index()

Submitted by:  Matthias Pfafferodt <syntron>
Submitted on:  Sun Apr 25 16:39:31 2010  
Category: generalPriority: 5 - Normal
Status: InvalidPrivacy: Public
Assigned to: Matthias Pfafferodt <syntron>Open/Closed: Closed
Planned Release: 2.3.0Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Tue Nov 23 08:50:40 2010, comment #5:

I think this patch is obsolete and will not be used in the future.

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Mon Oct 25 18:41:34 2010, comment #4:

Reading over this item I forgot about...

I just posted some extension of the genlist. It makes genlist_list_index() obsolete, as genlist_search() now returns the link.

genlist_list_update() maybe should be genlist_link_set(). But, I still think the old data should be free and not returned.

I really doubt we need to use genlists for doing a ruleset object. As rulesets types have identifiers, using double-linked lists is an error, because they don't grant a constant time to access the datas (items in the middle of the list will be long to reach).

pepeto <pepeto>
Project Member
Sun Apr 25 17:02:55 2010, comment #3:

hash_replace() also returns it, but it frees it before returning, maybe that's a wrong way. But lot of code assume it does...

pepeto <pepeto>
Project Member
Sun Apr 25 16:58:38 2010, comment #2:

genlist_list_update() returns the old value; the caller has to free it; I did not knew about hash_replace().

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Sun Apr 25 16:49:12 2010, comment #1:

Shouldn't genlist_list_update() free with the appropriate callback the replaced data? At least, hash_replace() do it, so we should probably have the same behaviour in both functions.

pepeto <pepeto>
Project Member
Sun Apr 25 16:39:31 2010, original submission:

<genlist>_list_update(): update an entry of the list
<genlist>_list_index(): return the index of an entry

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):


Depends on the following items: None found

   patch dependencies.


Carbon-Copy List
  • -unavailable- added by pepeto (Posted a comment)
  • -unavailable- added by syntron (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Nov 23 08:50:40 2010syntronStatusIn Progress=>Invalid
    Sun Apr 25 16:43:27 2010syntronDependencies-=>patch #1446 is dependent
    Sun Apr 25 16:39:31 2010syntronAttached File-=>Added 20100418-06-trunk--genlist-_list_update-genlist-_list_index.patch, #9071
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup