Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [OB] whitespace cleanup, completer.c
@ 2007-08-10 20:45 msnyder
  2007-08-11  9:42 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: msnyder @ 2007-08-10 20:45 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 37 bytes --]

Spaces, caps, that sort of thing...


[-- Attachment #2: ws.txt --]
[-- Type: text/plain, Size: 8424 bytes --]

2007-08-10  Michael Snyder  <msnyder@access-company.com>

	* completer.c: Comment/whitespace cleanup.

Index: completer.c
===================================================================
RCS file: /cvs/src/src/gdb/completer.c,v
retrieving revision 1.18
diff -p -r1.18 completer.c
*** completer.c	9 Jan 2007 17:58:50 -0000	1.18
--- completer.c	10 Aug 2007 20:34:37 -0000
***************
*** 22,28 ****
  #include "symtab.h"
  #include "gdbtypes.h"
  #include "expression.h"
! #include "filenames.h"		/* for DOSish file names */
  #include "language.h"
  
  #include "cli/cli-decode.h"
--- 22,28 ----
  #include "symtab.h"
  #include "gdbtypes.h"
  #include "expression.h"
! #include "filenames.h"		/* For DOSish file names.  */
  #include "language.h"
  
  #include "cli/cli-decode.h"
***************
*** 40,46 ****
  
  #include "completer.h"
  
! /* Prototypes for local functions */
  static
  char *line_completion_function (const char *text, int matches, 
  				char *line_buffer,
--- 40,46 ----
  
  #include "completer.h"
  
! /* Prototypes for local functions.  */
  static
  char *line_completion_function (const char *text, int matches, 
  				char *line_buffer,
*************** char *line_completion_function (const ch
*** 63,69 ****
     word break characters, since we use it in command names.  If the
     readline library sees one in any of the current completion strings,
     it thinks that the string needs to be quoted and automatically supplies
!    a leading quote. */
  static char *gdb_completer_command_word_break_characters =
  " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,";
  
--- 63,69 ----
     word break characters, since we use it in command names.  If the
     readline library sees one in any of the current completion strings,
     it thinks that the string needs to be quoted and automatically supplies
!    a leading quote.  */
  static char *gdb_completer_command_word_break_characters =
  " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,";
  
*************** static char *gdb_completer_loc_break_cha
*** 85,94 ****
  
  /* Characters that can be used to quote completion strings.  Note that we
     can't include '"' because the gdb C parser treats such quoted sequences
!    as strings. */
  static char *gdb_completer_quote_characters = "'";
  \f
! /* Accessor for some completer data that may interest other files. */
  
  char *
  get_gdb_completer_quote_characters (void)
--- 85,94 ----
  
  /* Characters that can be used to quote completion strings.  Note that we
     can't include '"' because the gdb C parser treats such quoted sequences
!    as strings.  */
  static char *gdb_completer_quote_characters = "'";
  \f
! /* Accessor for some completer data that may interest other files.  */
  
  char *
  get_gdb_completer_quote_characters (void)
*************** location_completer (char *text, char *wo
*** 231,237 ****
  	  if (*p == quote_found)
  	    quote_found = 0;
  	  else
! 	    break;		/* hit the end of text */
  	}
  #if HAVE_DOS_BASED_FILE_SYSTEM
        /* If we have a DOS-style absolute file name at the beginning of
--- 231,237 ----
  	  if (*p == quote_found)
  	    quote_found = 0;
  	  else
! 	    break;		/* Hit the end of text.  */
  	}
  #if HAVE_DOS_BASED_FILE_SYSTEM
        /* If we have a DOS-style absolute file name at the beginning of
*************** complete_line (const char *text, char *l
*** 395,401 ****
    rl_completer_word_break_characters =
      current_language->la_word_break_characters();
  
!       /* Decide whether to complete on a list of gdb commands or on symbols. */
    tmp_command = (char *) alloca (point + 1);
    p = tmp_command;
  
--- 395,401 ----
    rl_completer_word_break_characters =
      current_language->la_word_break_characters();
  
!   /* Decide whether to complete on a list of gdb commands or on symbols. */
    tmp_command = (char *) alloca (point + 1);
    p = tmp_command;
  
*************** complete_line (const char *text, char *l
*** 486,492 ****
  		  list = complete_on_cmdlist (*c->prefixlist, p, word);
  
  		  /* Insure that readline does the right thing
! 		         with respect to inserting quotes.  */
  		  rl_completer_word_break_characters =
  		    gdb_completer_command_word_break_characters;
  		}
--- 486,492 ----
  		  list = complete_on_cmdlist (*c->prefixlist, p, word);
  
  		  /* Insure that readline does the right thing
! 		     with respect to inserting quotes.  */
  		  rl_completer_word_break_characters =
  		    gdb_completer_command_word_break_characters;
  		}
*************** complete_line (const char *text, char *l
*** 551,558 ****
  
  	      list = complete_on_cmdlist (result_list, q, word);
  
! 		  /* Insure that readline does the right thing
! 		     with respect to inserting quotes.  */
  	      rl_completer_word_break_characters =
  		gdb_completer_command_word_break_characters;
  	    }
--- 551,558 ----
  
  	      list = complete_on_cmdlist (result_list, q, word);
  
! 	      /* Insure that readline does the right thing
! 		 with respect to inserting quotes.  */
  	      rl_completer_word_break_characters =
  		gdb_completer_command_word_break_characters;
  	    }
*************** complete_line (const char *text, char *l
*** 624,645 ****
     free the string.  */
  
  static char *
! line_completion_function (const char *text, int matches, char *line_buffer, int point)
  {
!   static char **list = (char **) NULL;	/* Cache of completions */
!   static int index;		/* Next cached completion */
    char *output = NULL;
  
    if (matches == 0)
      {
        /* The caller is beginning to accumulate a new set of completions, so
           we need to find all of them now, and cache them for returning one at
!          a time on future calls. */
  
        if (list)
  	{
  	  /* Free the storage used by LIST, but not by the strings inside.
! 	     This is because rl_complete_internal () frees the strings. */
  	  xfree (list);
  	}
        index = 0;
--- 624,646 ----
     free the string.  */
  
  static char *
! line_completion_function (const char *text, int matches, 
! 			  char *line_buffer, int point)
  {
!   static char **list = (char **) NULL;	/* Cache of completions.  */
!   static int index;			/* Next cached completion.  */
    char *output = NULL;
  
    if (matches == 0)
      {
        /* The caller is beginning to accumulate a new set of completions, so
           we need to find all of them now, and cache them for returning one at
!          a time on future calls.  */
  
        if (list)
  	{
  	  /* Free the storage used by LIST, but not by the strings inside.
! 	     This is because rl_complete_internal () frees the strings.  */
  	  xfree (list);
  	}
        index = 0;
*************** line_completion_function (const char *te
*** 650,656 ****
       dole them out one at a time.  The vector of completions is NULL
       terminated, so after returning the last one, return NULL (and continue
       to do so) each time we are called after that, until a new list is
!      available. */
  
    if (list)
      {
--- 651,657 ----
       dole them out one at a time.  The vector of completions is NULL
       terminated, so after returning the last one, return NULL (and continue
       to do so) each time we are called after that, until a new list is
!      available.  */
  
    if (list)
      {
*************** skip_quoted_chars (char *str, char *quot
*** 696,705 ****
      {
        if (quote_char != '\0')
  	{
! 	  /* Ignore everything until the matching close quote char */
  	  if (*scan == quote_char)
  	    {
! 	      /* Found matching close quote. */
  	      scan++;
  	      break;
  	    }
--- 697,706 ----
      {
        if (quote_char != '\0')
  	{
! 	  /* Ignore everything until the matching close quote char.  */
  	  if (*scan == quote_char)
  	    {
! 	      /* Found matching close quote.  */
  	      scan++;
  	      break;
  	    }
*************** skip_quoted_chars (char *str, char *quot
*** 720,726 ****
  
  /* Skip over the possibly quoted word STR (as defined by the quote
     characters and word break characters used by the completer).
!    Returns pointer to the location after the "word". */
  
  char *
  skip_quoted (char *str)
--- 721,727 ----
  
  /* Skip over the possibly quoted word STR (as defined by the quote
     characters and word break characters used by the completer).
!    Returns pointer to the location after the "word".  */
  
  char *
  skip_quoted (char *str)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-11 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-10 20:45 [OB] whitespace cleanup, completer.c msnyder
2007-08-11  9:42 ` Eli Zaretskii
2007-08-11 20:09   ` msnyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox