Date: Tue, 28 Oct 2008 20:24:35 +0100 From: clemens fischer <ino-news@spotteswoode.dnsalias.org> To: freebsd-questions@freebsd.org Subject: Re: reviving games/freebsd-games Message-ID: <jg5kt5xn5t1.ln2@nntp.spotteswoode.dnsalias.org> References: <ariht5xulu1.ln2@nntp.spotteswoode.dnsalias.org> <20081027200749.GB29814@icarus.home.lan> <20081027202219.GE2435@spotteswoode.de.eu.org> <20081028105715.GA33501@stack.nl> <klbjt5xb52.ln2@nntp.spotteswoode.dnsalias.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 28 Oct 2008 13:03:32 +0100 clemens fischer wrote:
> On Tue, 28 Oct 2008 11:57:15 +0100 Jurjen Middendorp wrote:
>
>> If you do char *p = "something", you can't write to that string
>> (it's a pointer into some stringtable: easy way to look at it
>> :). You have to use char p[] = "something", then it's an array
>> with enough storage to write to :) maybe try something like char
>> scrollname[NUMSCROLLS][]; ?
this type of declaration evokes "array type has incomplete element
type", which is seen as compliant behaviour by gcc experts. so this is
a no go.
> I thought I'd clean up that code declaring a real struct like:
>
> struct scrollname_s {
> int active;
> char name[] = "...";
> };
this is what i actually did. it makes the code way more easier to read
and keep.
> then name could stay read-only. OTOH I found numerous larn versions,
> so keeping ours "compatible" might keep maintenance costs down.
I'd still be interested in what others did.
-c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?jg5kt5xn5t1.ln2>
