delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/01/28/13:30:15

Date: Sun, 28 Jan 2001 20:30:12 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: JT Williams <jeffw AT darwin DOT sfbr DOT org>
Message-Id: <7458-Sun28Jan2001203011+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: djgpp-workers AT delorie DOT com
In-reply-to: <20010128092849.B27091@kendall.sfbr.org> (message from JT
Williams on Sun, 28 Jan 2001 09:28:49 -0600)
Subject: Re: djasm patch #4 (enums)
References: <20010128092849 DOT B27091 AT kendall DOT sfbr DOT org>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sun, 28 Jan 2001 09:28:49 -0600
> From: JT Williams <jeffw AT darwin DOT sfbr DOT org>
>  
> +void add_enum_element(Symbol *s)
> +{
> +  if (islocal(s->name) || istemp(s->name,0)) {
> +    djerror("Cannot have local or temporary labels within an enum");
> +  } else {
> +    char *id=alloca(strlen(s->name)+strlen(struct_sym)+2);
> +    strcpy(id,struct_sym);
> +    strcat(id,".");  /* should this be "_" to disambiguate enums from structs? */
> +    strcat(id,s->name);
> +    if (!s->defined && !s->patches) {
> +      /* only delete fresh symbols */
> +      destroy_symbol(s,0);
> +    }

Please try to preserve the style of the original code (which is also
used throughout in the library).  In that style, the opening braces
are always at the beginning of a new line, like this:

  if (islocal(s->name) || istemp(s->name,0))
  {
    djerror("Cannot have local or temporary labels within an enum");
  } 
  else 
  {
    char *id=alloca(strlen(s->name)+strlen(struct_sym)+2);
    strcpy(id,struct_sym);
    strcat(id,".");  /* should this be "_" to disambiguate enums from structs? */
    strcat(id,s->name);
    if (!s->defined && !s->patches)
    {
      /* only delete fresh symbols */
      destroy_symbol(s,0);
    }

Also, the closing brace is always on a line by itself.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019