Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Sami Wagiaalla <swagiaal@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [patch] Add namespace aliasing support.
Date: Fri, 29 Jan 2010 20:23:00 -0000	[thread overview]
Message-ID: <m3y6jg7ja6.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4B630D3F.8010507@redhat.com> (Sami Wagiaalla's message of "Fri, 	29 Jan 2010 11:30:55 -0500")

>>>>> "Sami" == Sami Wagiaalla <swagiaal@redhat.com> writes:

Sami> 2010-01-29  Sami Wagiaalla  <swagiaal@redhat.com>
Sami>    * cp-support.h: Added char* alias element to using_direct data
Sami>    struct.
Sami>    (cp_add_using): Added char* alias argument.
Sami>    (cp_add_using_directive): Ditto.
Sami>    * cp-namespace.c: Updated with the above changes.
Sami>    (cp_lookup_symbol_imports): Check for aliases.
Sami>    * dwarf2read.c (read_import_statement): Figure out local alias
Sami>    for the import and pass it on to cp_add_using.
Sami>    (read_namespace): Pass alias argument to cp_add_using.
Sami>        2010-01-29  Sami Wagiaalla  <swagiaal@redhat.com>

Lots of formatting nits, plus one slightly more substantial comment.

Sami> +cp_add_using_directive (const char *dest, const char *src, const char* alias)

"char *", not "char*".

Sami> +   scope DEST. ALIAS is the name of the imported namespace in the current
Sami> +   scope. If ALIAS is an empty string  then the namespace is known by its
Sami> +   original name.

Two spaces after a period.  Only one space between "string then".

Sami> +  retval->alias = savestring (alias, strlen(alias));

Space before open paren.

Sami> +	else if (strcmp ("", current->alias) == 0)

It is more idiomatic in C to use NULL rather than the empty string as a
special value.  Please make this change.

Sami> +	  {
Sami> +	  /* If this import statement creates no alias, pass current->inner as
Sami> +	     NAMESPACE to direct the search towards the imported namespace.  */
Sami> +	  sym = cp_lookup_symbol_imports (current->import_src,

The code here should be indented 2 spaces beyond the open brace, not
lined up with it.

Sami> +   namespace IMPORT_DEST. These form a linked list; NEXT is the next element
Sami> +   of the list. ALIAS is set to a non empty string if the imported namespace
Sami> +   has been aliased.

The period rule again.

Sami> +  import_alias = dwarf2_name (die, cu);
Sami> +  if (import_alias == NULL)
Sami> +    {
Sami> +    import_alias = "";
Sami> +    }

This code will be going away, but just FYI, don't brace a single
statement.

Tom


  reply	other threads:[~2010-01-29 20:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-29 16:27 Sami Wagiaalla
2010-01-29 20:23 ` Tom Tromey [this message]
2010-02-01 20:25   ` Sami Wagiaalla
2010-02-02 19:23     ` Tom Tromey
2010-02-09  0:38       ` Doug Evans
2010-02-09  1:38         ` Tom Tromey
2010-02-09 17:03           ` Sami Wagiaalla
2010-02-09 19:37         ` Sami Wagiaalla
2010-02-09 19:56           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3y6jg7ja6.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=swagiaal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox