[Freeciv-Dev] Re: (PR#2370) Path finding
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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.
> > 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.
> > > Yes but the above starts to make exceptions. What about leaving the
> > > *_data fields and passing the param struct * into the callback instead
> > > of the _data pointers. This way the callback have both the "normal"
> > > fields of the parameter and also the special _data fields.
> >
> > Makes good sense. Shall we cut down number of *data fields? If needed
> *data
> > can point to a struct with more data.
>
> You mean cut down to one?
Yep.
G.
- [Freeciv-Dev] Re: (PR#2370) Path finding, (continued)
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding,
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/21
- [Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/22
- [Freeciv-Dev] Re: (PR#2370) Path finding, Mike Kaufman, 2003/02/22
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/23
- [Freeciv-Dev] Re: (PR#2370) Path finding, Ross Wetmore, 2003/02/23
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/23
- [Freeciv-Dev] Re: (PR#2370) Path finding, Mike Kaufman, 2003/02/23
- [Freeciv-Dev] Re: (PR#2370) Path finding, Raimar Falke, 2003/02/23
|
|