[Freeciv-Dev] Re: bug in cr_entry_building (PR#1289)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, Mar 01, 2002 at 05:48:14AM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> I've logged this as a separate bug report, although most of it is
> related to #1283 (s/999/never/ in turns-to-build).
>
> cr_entry_building has a bug: it checks whether the city is building
> B_CAPITAL before checking to see whether or not the city is building a
> unit or building (capitalization counts as a building). This means
> whatever unit gets the same ID as capitalization will be shown incorrectly.
>
> The attached patch fixes this in the process of special-casing the "999"
> case as never (or in this case "-").
>
>
> But really, what's up with cr_entry_building and the whole city_rep_data
> file? This function is declared static and never used.
Nasty preprocessor tricks:
/* This generates the function name and the tagname: */
#define FUNC_TAG(var) cr_entry_##var, #var
^^^^^^^^^
struct city_report_spec city_report_specs[] = {
...
{ 1, 0, 1, N_("Currently Building"), N_("(Stock,Target,Turns,Buy)"),
N_("Currently Building"),
FUNC_TAG(building) }
^^^^^^^^
> It _looks_ like
> it should take care of all the work for a city report entry, but
> currently there is very similar code among the different GUIs to do
> this. I get the impression there is some overridding structure for
> automatically generating city reports here, but it's incomplete and I
> don't think the original intent is completely clear. Should the full
> system be implemented? Should individual functions be made public and
> used in place of the (very similar code) among the gui's?
I'm for unification with the other users. Maybe you can a base_*
version which can be customized with some flags.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"These download files are in Microsoft Word 6.0 format. After
unzipping, these files can be viewed in any text editor, including
all versions of Microsoft Word, WordPad, and Microsoft Word Viewer."
-- http://www.microsoft.com/hwdev/pc99.htm
|
|