URL:
<http://gna.org/patch/?1561>
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:
_______________________________________________________
Details:
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
directly.
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
<http://gna.org/patch/download.php?file_id=8649>
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?1561>
_______________________________________________
Meddelandet skickades via/av Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev