patchFreeciv - Patches: patch #1659, use specenum_gen for enum...

 
 
Show feedback again

patch #1659: use specenum_gen for enum terrain_class and enum terrain_alteration

Submitted by:  Matthias Pfafferodt <syntron>
Submitted on:  Sun May 2 21:35:31 2010  
 
Category: generalPriority: 3 - Low
Status: DonePrivacy: 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.

 

(Jump to the original submission Jump to the original submission)

Wed Jun 30 19:01:55 2010, SVN revision 17511:

use specenum_gen for enum terrain_class and enum terrain_alteration

see gna patch #1659

(Browse SVN revision 17511)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Wed Jun 9 21:54:25 2010, comment #6:

update (08/10)

(file #9287)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Tue May 4 14:39:54 2010, comment #5:

SPECENUM_LAST doesn't make sense for bitwise definitions. There maybe a SPECENUM_MASK would be required in some case, but it seems a bit more complex to implement.

pepeto <pepeto>
Project Member
Tue May 4 09:11:40 2010, comment #4:

> Static arrays cannot use a function. Maybe there is a simple way to add a SPECENUM_LAST value?


Would something like the following work? I don't know if this is OK for bitwise definitions. Or should it only be defined if !bitwise?

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Tue May 4 05:08:51 2010, comment #3:

Static arrays cannot use a function. Maybe there is a simple way to add a SPECENUM_LAST value?

pepeto <pepeto>
Project Member
Mon May 3 21:43:49 2010, comment #2:

Yes; I did notice this at the time I send the patches. I will add the needed checks. Most of the time the *_LAST value is needed for the definition of arrays (see network code). Or could <enum>_class_max() be used there?

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Mon May 3 02:50:58 2010, comment #1:

Notice here that the code before and after don't do the same thing; TC_LAST is a valid value since it is defined in the enumeration like the others. The new code will consider 'TC_LAST' to be the name of a valid terrain class.

I have not confirmed this, but TC_LAST is a sentinel value that was used to signal invalid values; now this is handled differently in specenum and because of this, TC_LAST is no longer needed? Or is it needed to be around for other reasons (compatibility?).

specenum's terrain_class_max() function should be able to replace the *_LAST value's use when the value is needed.

Engla <englabenny>
Project Member
Sun May 2 21:35:31 2010, original submission:
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 englabenny (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Jun 30 19:02:23 2010syntronStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Wed Jun 9 21:54:25 2010syntronAttached File-=>Added 20100609-08-trunk-use-specenum_gen-for-enum-terrain_class-and-enum-ter.patch, #9287
    Sun May 2 21:37:03 2010syntronDependencies-=>patch #1446 is dependent
    Sun May 2 21:35:31 2010syntronAttached File-=>Added 20100502-07-trunk-use-specenum_gen-for-enum-terrain_class-and-enum-ter.patch, #9115
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup