URL:
<http://gna.org/patch/?4670>
Summary: extra_index() as macro
Project: Freeciv
Submitted by: cazfi
Submitted on: Sun 27 Apr 2014 12:01:07 AM EEST
Category: general
Priority: 5 - Normal
Status: Ready For Test
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: 2.6.0
_______________________________________________________
Details:
extra_index() is the most often called function. Iẗ́'s also trivial, so
there's no need to have it as an separate function. In fact, attached patch to
implement it as macro makes code size to go slighly down (calling separate
function takes more instructions than having it inlined). The goal with this
avoidance of calling a sepate function is speed, though.
Since extra_index() -function needs array local to extras.c, the macro is
implemented like extra_number() instead. This is not a problem at the moment
as they currently always give identical results.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sun 27 Apr 2014 12:01:07 AM EEST Name: ExtraIndexMacro.patch Size: 1kB
By: cazfi
<http://gna.org/patch/download.php?file_id=20586>
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?4670>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev