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 25 Apr 2010 04:39:31 PM UTC  
 
Category: generalPriority: 5 - Normal
Status: InvalidPrivacy: Public
Assigned to: Matthias Pfafferodt <syntron>Open/Closed: Closed
Planned Release: 2.3.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Tue 23 Nov 2010 08:50:40 AM UTC, 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 25 Oct 2010 06:41:34 PM UTC, 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 25 Apr 2010 05:02:55 PM UTC, 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 25 Apr 2010 04:58:38 PM UTC, 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 25 Apr 2010 04:49:12 PM UTC, 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 25 Apr 2010 04:39:31 PM UTC, 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):
   
   
Comment:
   

 

Depends on the following items: None found

Digest:
   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.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 23 Nov 2010 08:50:40 AM UTCsyntronStatusIn Progress=>Invalid
      Open/ClosedOpen=>Closed
    Sun 25 Apr 2010 04:43:27 PM UTCsyntronDependencies-=>patch #1446 is dependent
    Sun 25 Apr 2010 04:39:31 PM UTCsyntronAttached 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