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 02 May 2010 09:35:31 PM UTC  
 
Category: generalPriority: 3 - Low
Status: DonePrivacy: 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.

 

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

Wed 30 Jun 2010 07:01:55 PM UTC, 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 09 Jun 2010 09:54:25 PM UTC, comment #6:

update (08/10)

(file #9287)

Matthias Pfafferodt <syntron>
Project MemberIn charge of this item.
Tue 04 May 2010 02:39:54 PM UTC, 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 04 May 2010 09:11:40 AM UTC, 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 04 May 2010 05:08:51 AM UTC, 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 03 May 2010 09:43:49 PM UTC, 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 03 May 2010 02:50:58 AM UTC, 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 02 May 2010 09:35:31 PM UTC, 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.

     

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

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 30 Jun 2010 07:02:23 PM UTCsyntronStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Wed 09 Jun 2010 09:54:25 PM UTCsyntronAttached File-=>Added 20100609-08-trunk-use-specenum_gen-for-enum-terrain_class-and-enum-ter.patch, #9287
    Sun 02 May 2010 09:37:03 PM UTCsyntronDependencies-=>patch #1446 is dependent
    Sun 02 May 2010 09:35:31 PM UTCsyntronAttached 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