Summary: Make API objects' fields immutable
                 Project: Freeciv
            Submitted by: englabenny
            Submitted on: torsdag 2010-03-25 den 18:15
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 



Fixing bug #15696

[PATCH 2/3] Make API objects' fields immutable

All fields not marked const in api.pkg are implicitly writable from
lua scripts. Mostly, this has very unintended consequences; freeciv's
struct values for Players, Cities, Nations etc should not be modified

Marking all fields with 'const' would make the return type of (for
example) a_unit.owner to have type 'const Player', which is
incompatible with API actions that take arguments of 'Player' type. So
to make this a bit easier, we instead just remove the table of setter
functions from all API types.


File Attachments:

Date: torsdag 2010-03-25 den 18:15  Name:
0002-Make-API-objects-fields-immutable.patch  Size: 2 kB   By: englabenny



Reply to this item at:


  Meddelandet skickades via/av Gna!

Freeciv-dev mailing list

Reply via email to