Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: AI cleanup Version 3 (PR#1174)
Home

[Freeciv-Dev] Re: AI cleanup Version 3 (PR#1174)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: AI cleanup Version 3 (PR#1174)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Sun, 30 Dec 2001 01:13:21 -0800 (PST)

Dear diary, on Sun, Dec 30, 2001 at 02:41:38AM CET, I got a letter, where
Raahul Kumar <raahul_da_man@xxxxxxxxx> told me, that...
> > >  ***********************************************************************/
> > >  static int unit_move_turns(struct unit *punit, int x, int y)
> > ...  Cleaning up this functions appears useless to me, as we have probably
> > better candidate for include, IIRC Greg made it, haven't we?
> > >   
> > >
> 
> Yes, but so far it is not in CVS. I'm not going to start ripping off Greg's
> code to make mine better. When Greg's entire warmap series gets into CVS, he
> can handle it then.
Ok - it just seems worthless for me to clean this up if it's gonna be replaced
anyway - but that's evidently just a matter of taste ;).

> > Well, honestly, I would welcome rather patches for smaller scope, but much
> > higher focus, attempting to clean given function completely - this way it's
> > hard for me to review something, as only de-facto details are changed
> > (sure, it helps, but not much) and one can't see them in the context (as
> > the context is messy ;) and you can easily change them when you will clean
> > this function by yourself.
> > 
> 
> I'm not quite sure what you are asking here. I believe you want me to finish
> replacing all the one letter variables in a single function first, and make
> minor cleanups as I go.
Well, basically yes ;-).

> What my plan of attack was:
> 
> Identify the uses of a one letter variable(m) Where m is used to represent 2
> or 3 different things get rid of them, substitute in better names, and make
> sure every time move_rate is referenced, it is the same thing as elsewhere.
> 
> Also get rid of hardcoded nos where I understand the consequences. I
> deliberately did not touch formatting, because I assumed the maintainer would
> let me know how he wanted the patch formatted.
Well, this will obviously help, but if you will do this for each (set of)
variable(s), you are gonna to touch one function (and context) many times, but
after that the function will still need a separate cleanup for reformatting and
comments ;). But I'm basically ok with it too, it will help and save some work.
I'm just usually a little more comfortable with my approach, but that's
obviously matter of taste and I'm not going to force anyone my taste ;).

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv, (e)links
.
Firewall in a way is like the doorkeeper of a local pub. If you don't have your
I.D. on you, or if for some reason you do not qualify to enter, the doorkeeper
will not permit you to enter. In some extreme cases these doorkeepers will not
let you out, or at least give you a hard time before they finally let you out.
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: AI cleanup Version 3 (PR#1174), Petr Baudis <=