gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] persistent cache reorganization


From: Paul Pogonyshev
Subject: Re: [gnugo-devel] persistent cache reorganization
Date: Thu, 24 Jun 2004 18:20:24 +0300
User-agent: KMail/1.6.52

Arend Bayer wrote:
> 
> Paul wrote:
> > Arend wrote:
> > 
> > > 1.) Defining the cache itself:
> > > struct persistent_cache reading_cache =
> > >   { .max_size = MAX_READING_CACHE_SIZE,
> > >     .max_stackp = MAX_READING_CACHE_DEPTH,
> > >     .age_factor = 1.0,
> > >     .name = "reading cache", 
> > >     .compute_active_area = compute_active_reading_area };
> 
> > I believe the above syntax is GCC extension.  Are there strong
> > reasons to use it?  Because if it is GCC-only, you will have to
> > provide #if'ed alternative.
> 
> It's part of C99 but it you may very well be right that it's new there.
> Maybe I should go buy the C89 standard some time...
> 
> How should this be done in C89?

Just initialize every field in their respective order.  This is of course
more error-prone if you change the structure, but there is hardly any way
out.  Since the structure is large, you can add comments in initialization
with fields name, like this:

struct persistent_cache reading_cache =
  {
     NULL,                              /* table */
     MAX_READING_CACHE_SIZE,            /* max_size */
     ...
  };

Paul




reply via email to

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