Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] Re: TODO
Home

[Freeciv-Dev] Re: TODO

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Erik Sigra <freeciv@xxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: TODO
From: Jules Bean <jules@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 22 Sep 2000 10:56:58 +0100

On Fri, Sep 22, 2000 at 11:55:43AM +0200, Erik Sigra wrote:
> Falk Hueffner wrote:
> > 
> > Erik Sigra <freeciv@xxxxxxx> writes:
> > 
> > > Yes, my implementation requires a lot of recoding (I'm doing it
> > > right now). But it can be done in steps. It just takes some
> > > typecasting klugdes ("(struct locus({x, y}") in some places during
> 
> Should have been "(struct locus){x, y}" of course.
> 
> > > the transition.
> > 
> > Please don't; this is not portable, it's a gcc extension.
> 
> Really, I didn't know. Then how it is it done by ANSI?

'on-the-fly' struct creation is not possible.

Instead use a 'constructor' function

struct locus make_locus(int x,int y) {
  struct locus l;
  l.x=x; l.y=y;
  return l;
}

Jules



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