Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] Re: (PR#2370) Path finding
Home

[Freeciv-Dev] Re: (PR#2370) Path finding

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Cc: Freeciv Development List <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: (PR#2370) Path finding
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Sat, 22 Feb 2003 00:09:22 +0100

On Fri, Feb 21, 2003 at 10:58:51PM +0000, Gregory Berkolaiko wrote:
> Quoting Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>:
> 
> > On Fri, Feb 21, 2003 at 10:25:22PM +0000, Gregory Berkolaiko wrote:
> > > > > > > +   */
> > > > > > > +  int (*get_MC) (int from_x, int from_y, enum direction8 dir,
> > > > > > > +          int to_x, int to_y, void *);
> > > > > > 
> > > > > > We should also supply "known".
> > > > > 
> > > > > When any user code needs it, it will be added.
> > > > 
> > > > Based on this we would have to remove this parameter also from the
> > > > other callbacks. It should be added here and also to is_pos_dangerous.
> > > 
> > > Definitely add to is_pos_dangerous, I am surprised it's not there yet.
> > > Definitely not here.  I am not having it just for uniformity's sake.  
> > > This is a back-bone of the whole module and +- one byte makes a 
> > > difference.
> > 
> > > Give me a problem that requires "known" here and cannot be solved by
> > existing
> > > call-backs and then we can negotiate.
> > 
> > This one extra argument is one extra push for the caller. Thats it. No
> > other cost. gcc doesn't pop but just adjusts the %esp directly. And it
> > has no influence on the called function (if the function doesn't use
> > it). I expect that a push is fast. Very fast since you need it
> > everytime you call a function.
> 
> Don't push it on me, man!  Since you are not giving me the example
> that needs it, we will assume that none such exists.

That callback were your idea. I have no code which needs this callback
at all.

But your point (add it if current code needs it) is mood. This way we
wouldn't have EC, is_pos_dangerous and TM_*_TIME.

> > > While waiting for comments, I can suggest an alternative: return a 
> > > negative
> > number.
> > 
> > This is slightly better. But still not clean.
> 
> Cleaner than the way you suggest.

I disagree.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "There are three ways to get something done. Do it yourself, hire someone
  to do it for you or forbid your kids to do it."



[Prev in Thread] Current Thread [Next in Thread]