all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
       [not found] <E1SvWBA-00078u-9A@vcs.savannah.gnu.org>
@ 2012-07-30 22:33 ` Stefan Monnier
  2012-07-30 22:47   ` Paul Eggert
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2012-07-30 22:33 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

>   * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
[...]
> -    double nlive = 
> -      total_conses + total_symbols + total_markers + total_strings
> -      + total_vectors + total_floats + total_intervals + total_buffers;
> +    double nlive =
> +      (total_conses + total_symbols + total_markers + total_strings
> +       + total_vectors + total_floats + total_intervals + total_buffers);
 
Actually, the GNU coding style additionally recommends to cut the line
before rather than after infix operators.  I.e.

    double nlive
      = (total_conses + total_symbols + total_markers + total_strings
         + total_vectors + total_floats + total_intervals + total_buffers);

-- Stefan



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
  2012-07-30 22:33 ` [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style Stefan Monnier
@ 2012-07-30 22:47   ` Paul Eggert
  2012-07-30 23:11     ` Stefan Monnier
  2012-07-31  6:06     ` Richard Stallman
  0 siblings, 2 replies; 10+ messages in thread
From: Paul Eggert @ 2012-07-30 22:47 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 07/30/2012 03:33 PM, Stefan Monnier wrote:
> the GNU coding style additionally recommends to cut the line
> before rather than after infix operators.  I.e.
> 
>     double nlive
>       = (total_conses + total_symbols + total_markers + total_strings
>          + total_vectors + total_floats + total_intervals + total_buffers);

Sure, but that "=" is not an infix operator; it's
not an operator at all.  Technically, it's
punctuation that is part of an init-declarator.
It can't be nested inside parentheses, so there's
little point to formatting it according to style rules
designed for parentheses and infix operators; and
it's helpful to distinguish it from a true operator,
by putting it at the end of the previous line.



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
  2012-07-30 22:47   ` Paul Eggert
@ 2012-07-30 23:11     ` Stefan Monnier
  2012-07-30 23:32       ` Paul Eggert
  2012-07-31  6:06     ` Richard Stallman
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2012-07-30 23:11 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

>> the GNU coding style additionally recommends to cut the line
>> before rather than after infix operators.  I.e.
>> double nlive
>> = (total_conses + total_symbols + total_markers + total_strings
>> + total_vectors + total_floats + total_intervals + total_buffers);
> Sure, but that "=" is not an infix operator; it's
> not an operator at all.  Technically, it's
> punctuation that is part of an init-declarator.

I do not think the GNU coding style cares about such
philosophical nitpicks.


        Stefan



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
  2012-07-30 23:11     ` Stefan Monnier
@ 2012-07-30 23:32       ` Paul Eggert
  0 siblings, 0 replies; 10+ messages in thread
From: Paul Eggert @ 2012-07-30 23:32 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 07/30/2012 04:11 PM, Stefan Monnier wrote:
> I do not think the GNU coding style cares about such
> philosophical nitpicks.

If the "=" were nestable inside parentheses, so that
one could write declarations like this:

  (double d
   = foo (xyzzy,
          bar (plugh)));

then indeed it would be a nitpick.  But "=" is not
nestable or parenthesizable when it's part of the punctuation
for an initializer.  Indenting styles designed for the
nestable and parenthesizable infix operator "=" are not
necessarily the best when "=" is used for other purposes.



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
  2012-07-30 22:47   ` Paul Eggert
  2012-07-30 23:11     ` Stefan Monnier
@ 2012-07-31  6:06     ` Richard Stallman
  2012-07-31  6:24       ` Paul Eggert
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2012-07-31  6:06 UTC (permalink / raw)
  To: Paul Eggert; +Cc: monnier, emacs-devel

Although the = in an initializer is not strictly speaking an infix
operator, the style rule still applies to it.

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
  2012-07-31  6:06     ` Richard Stallman
@ 2012-07-31  6:24       ` Paul Eggert
  2012-07-31 22:31         ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Eggert @ 2012-07-31  6:24 UTC (permalink / raw)
  To: rms; +Cc: monnier, emacs-devel

On 07/30/2012 11:06 PM, Richard Stallman wrote:
> Although the = in an initializer is not strictly speaking an infix
> operator, the style rule still applies to it.

Ah, OK, then I'll use that style in Emacs from now on.

In Emacs, several hundred initializers do not follow that style rule;
should these be changed?  Here are a few examples of the sort of changes
that I imagine would be needed.

=== modified file 'lib-src/ebrowse.c'
*** lib-src/ebrowse.c	2012-06-24 17:39:14 +0000
--- lib-src/ebrowse.c	2012-07-31 06:09:55 +0000
***************
*** 306,329 ****
 	
 	/* Command line options structure for getopt_long.  */
 	
!	struct option options[] =
!	{
!	  {"append", 			no_argument, 	   NULL, 'a'},
!	  {"files", 			required_argument, NULL, 'f'},
!	  {"help", 			no_argument, 	   NULL, -2},
!	  {"min-regexp-length", 	required_argument, NULL, 'm'},
!	  {"max-regexp-length", 	required_argument, NULL, 'M'},
!	  {"no-nested-classes", 	no_argument, 	   NULL, 'n'},
!	  {"no-regexps", 		no_argument, 	   NULL, 'x'},
!	  {"no-structs-or-unions", 	no_argument, 	   NULL, 's'},
!	  {"output-file", 		required_argument, NULL, 'o'},
!	  {"position-info", 		required_argument, NULL, 'p'},
!	  {"search-path", 		required_argument, NULL, 'I'},
!	  {"verbose", 			no_argument, 	   NULL, 'v'},
!	  {"version", 			no_argument, 	   NULL, -3},
!	  {"very-verbose", 		no_argument, 	   NULL, 'V'},
!	  {NULL, 			0, 		   NULL, 0}
!	};
 	
 	/* Semantic values of tokens.  Set by yylex..  */
 	
--- 306,329 ----
 	
 	/* Command line options structure for getopt_long.  */
 	
!	struct option options[]
!	  = {
!	      {"append", 		no_argument, 	   NULL, 'a'},
!	      {"files", 		required_argument, NULL, 'f'},
!	      {"help", 			no_argument, 	   NULL, -2},
!	      {"min-regexp-length", 	required_argument, NULL, 'm'},
!	      {"max-regexp-length", 	required_argument, NULL, 'M'},
!	      {"no-nested-classes", 	no_argument, 	   NULL, 'n'},
!	      {"no-regexps", 		no_argument, 	   NULL, 'x'},
!	      {"no-structs-or-unions", 	no_argument, 	   NULL, 's'},
!	      {"output-file", 		required_argument, NULL, 'o'},
!	      {"position-info", 	required_argument, NULL, 'p'},
!	      {"search-path", 		required_argument, NULL, 'I'},
!	      {"verbose", 		no_argument, 	   NULL, 'v'},
!	      {"version", 		no_argument, 	   NULL, -3},
!	      {"very-verbose", 		no_argument, 	   NULL, 'V'},
!	      {NULL, 			0, 		   NULL, 0}
!	    };
 	
 	/* Semantic values of tokens.  Set by yylex..  */
 	

=== modified file 'lib-src/emacsclient.c'
*** lib-src/emacsclient.c	2012-07-11 05:44:06 +0000
--- lib-src/emacsclient.c	2012-07-31 06:15:26 +0000
***************
*** 172,199 ****
 	static _Noreturn void print_help_and_exit (void);
 	
 	
!	struct option longopts[] =
!	{
!	  { "no-wait",	no_argument,	   NULL, 'n' },
!	  { "quiet",	no_argument,	   NULL, 'q' },
!	  { "eval",	no_argument,	   NULL, 'e' },
!	  { "help",	no_argument,	   NULL, 'H' },
!	  { "version",	no_argument,	   NULL, 'V' },
!	  { "tty",	no_argument,       NULL, 't' },
!	  { "nw",	no_argument,       NULL, 't' },
!	  { "create-frame", no_argument,   NULL, 'c' },
!	  { "alternate-editor", required_argument, NULL, 'a' },
!	  { "frame-parameters", required_argument, NULL, 'F' },
 	#ifndef NO_SOCKETS_IN_FILE_SYSTEM
!	  { "socket-name",	required_argument, NULL, 's' },
 	#endif
!	  { "server-file",	required_argument, NULL, 'f' },
 	#ifndef WINDOWSNT
!	  { "display",	required_argument, NULL, 'd' },
 	#endif
!	  { "parent-id", required_argument, NULL, 'p' },
!	  { 0, 0, 0, 0 }
!	};
 	
 	\f
 	/* Like malloc but get fatal error if memory is exhausted.  */
--- 172,199 ----
 	static _Noreturn void print_help_and_exit (void);
 	
 	
!	struct option longopts[]
!	  = {
!	      { "no-wait",		no_argument,	   NULL, 'n' },
!	      { "quiet",		no_argument,	   NULL, 'q' },
!	      { "eval",			no_argument,	   NULL, 'e' },
!	      { "help",			no_argument,	   NULL, 'H' },
!	      { "version",		no_argument,	   NULL, 'V' },
!	      { "tty",			no_argument,       NULL, 't' },
!	      { "nw",			no_argument,       NULL, 't' },
!	      { "create-frame",		no_argument,	   NULL, 'c' },
!	      { "alternate-editor",	required_argument, NULL, 'a' },
!	      { "frame-parameters",	required_argument, NULL, 'F' },
 	#ifndef NO_SOCKETS_IN_FILE_SYSTEM
!	      { "socket-name",		required_argument, NULL, 's' },
 	#endif
!	      { "server-file",		required_argument, NULL, 'f' },
 	#ifndef WINDOWSNT
!	      { "display",		required_argument, NULL, 'd' },
 	#endif
!	      { "parent-id",		required_argument, NULL, 'p' },
!	      { 0, 0, 0, 0 }
!	    };
 	
 	\f
 	/* Like malloc but get fatal error if memory is exhausted.  */

=== modified file 'lib-src/etags.c'
*** lib-src/etags.c	2012-07-10 22:42:22 +0000
--- lib-src/etags.c	2012-07-31 06:13:41 +0000
***************
*** 460,525 ****
 	static regexp *p_head;		/* list of all regexps */
 	static bool need_filebuf;	/* some regexes are multi-line */
 	
!	static struct option longopts[] =
!	{
!	  { "append",             no_argument,       NULL,               'a'   },
!	  { "packages-only",      no_argument,       &packages_only,     TRUE  },
!	  { "c++",                no_argument,       NULL,               'C'   },
!	  { "declarations",       no_argument,       &declarations,      TRUE  },
!	  { "no-line-directive",  no_argument,       &no_line_directive, TRUE  },
!	  { "no-duplicates",      no_argument,       &no_duplicates,     TRUE  },
!	  { "help",               no_argument,       NULL,               'h'   },
!	  { "help",               no_argument,       NULL,               'H'   },
!	  { "ignore-indentation", no_argument,       NULL,               'I'   },
!	  { "language",           required_argument, NULL,               'l'   },
!	  { "members",            no_argument,       &members,           TRUE  },
!	  { "no-members",         no_argument,       &members,           FALSE },
!	  { "output",             required_argument, NULL,               'o'   },
!	  { "regex",              required_argument, NULL,               'r'   },
!	  { "no-regex",           no_argument,       NULL,               'R'   },
!	  { "ignore-case-regex",  required_argument, NULL,               'c'   },
!	  { "parse-stdin",        required_argument, NULL,               STDIN },
!	  { "version",            no_argument,       NULL,               'V'   },
!	
!	#if CTAGS /* Ctags options */
!	  { "backward-search",    no_argument,       NULL,               'B'   },
!	  { "cxref",              no_argument,       NULL,               'x'   },
!	  { "defines",            no_argument,       NULL,               'd'   },
!	  { "globals",            no_argument,       &globals,           TRUE  },
!	  { "typedefs",           no_argument,       NULL,               't'   },
!	  { "typedefs-and-c++",   no_argument,       NULL,               'T'   },
!	  { "update",             no_argument,       NULL,               'u'   },
!	  { "vgrind",             no_argument,       NULL,               'v'   },
!	  { "no-warn",            no_argument,       NULL,               'w'   },
!	
!	#else /* Etags options */
!	  { "no-defines",         no_argument,       NULL,               'D'   },
!	  { "no-globals",         no_argument,       &globals,           FALSE },
!	  { "include",            required_argument, NULL,               'i'   },
!	#endif
!	  { NULL }
!	};
!	
!	static compressor compressors[] =
!	{
!	  { "z", "gzip -d -c"},
!	  { "Z", "gzip -d -c"},
!	  { "gz", "gzip -d -c"},
!	  { "GZ", "gzip -d -c"},
!	  { "bz2", "bzip2 -d -c" },
!	  { "xz", "xz -d -c" },
!	  { NULL }
!	};
 	
 	/*
 	 * Language stuff.
 	 */
 	
 	/* Ada code */
!	static const char *Ada_suffixes [] =
!	  { "ads", "adb", "ada", NULL };
!	static const char Ada_help [] =
!	"In Ada code, functions, procedures, packages, tasks and types are\n\
 	tags.  Use the `--packages-only' option to create tags for\n\
 	packages only.\n\
 	Ada tag names have suffixes indicating the type of entity:\n\
--- 460,525 ----
 	static regexp *p_head;		/* list of all regexps */
 	static bool need_filebuf;	/* some regexes are multi-line */
 	
!	static struct option longopts[]
!	  = {
!	      { "append",             no_argument,       NULL,               'a'   },
!	      { "packages-only",      no_argument,       &packages_only,     TRUE  },
!	      { "c++",                no_argument,       NULL,               'C'   },
!	      { "declarations",       no_argument,       &declarations,      TRUE  },
!	      { "no-line-directive",  no_argument,       &no_line_directive, TRUE  },
!	      { "no-duplicates",      no_argument,       &no_duplicates,     TRUE  },
!	      { "help",               no_argument,       NULL,               'h'   },
!	      { "help",               no_argument,       NULL,               'H'   },
!	      { "ignore-indentation", no_argument,       NULL,               'I'   },
!	      { "language",           required_argument, NULL,               'l'   },
!	      { "members",            no_argument,       &members,           TRUE  },
!	      { "no-members",         no_argument,       &members,           FALSE },
!	      { "output",             required_argument, NULL,               'o'   },
!	      { "regex",              required_argument, NULL,               'r'   },
!	      { "no-regex",           no_argument,       NULL,               'R'   },
!	      { "ignore-case-regex",  required_argument, NULL,               'c'   },
!	      { "parse-stdin",        required_argument, NULL,               STDIN },
!	      { "version",            no_argument,       NULL,               'V'   },
!	
!	    #if CTAGS /* Ctags options */
!	      { "backward-search",    no_argument,       NULL,               'B'   },
!	      { "cxref",              no_argument,       NULL,               'x'   },
!	      { "defines",            no_argument,       NULL,               'd'   },
!	      { "globals",            no_argument,       &globals,           TRUE  },
!	      { "typedefs",           no_argument,       NULL,               't'   },
!	      { "typedefs-and-c++",   no_argument,       NULL,               'T'   },
!	      { "update",             no_argument,       NULL,               'u'   },
!	      { "vgrind",             no_argument,       NULL,               'v'   },
!	      { "no-warn",            no_argument,       NULL,               'w'   },
!	
!	    #else /* Etags options */
!	      { "no-defines",         no_argument,       NULL,               'D'   },
!	      { "no-globals",         no_argument,       &globals,           FALSE },
!	      { "include",            required_argument, NULL,               'i'   },
!	    #endif
!	      { NULL }
!	    };
!	
!	static compressor compressors[]
!	  = {
!	      { "z", "gzip -d -c"},
!	      { "Z", "gzip -d -c"},
!	      { "gz", "gzip -d -c"},
!	      { "GZ", "gzip -d -c"},
!	      { "bz2", "bzip2 -d -c" },
!	      { "xz", "xz -d -c" },
!	      { NULL }
!	    };
 	
 	/*
 	 * Language stuff.
 	 */
 	
 	/* Ada code */
!	static const char *Ada_suffixes []
!	  = { "ads", "adb", "ada", NULL };
!	static const char Ada_help []
!	  = "In Ada code, functions, procedures, packages, tasks and types are\n\
 	tags.  Use the `--packages-only' option to create tags for\n\
 	packages only.\n\
 	Ada tag names have suffixes indicating the type of entity:\n\
***************
*** 536,552 ****
 	will just search for any tag `bidule'.";
 	
 	/* Assembly code */
!	static const char *Asm_suffixes [] =
!	  { "a",	/* Unix assembler */
!	    "asm", /* Microcontroller assembly */
!	    "def", /* BSO/Tasking definition includes  */
!	    "inc", /* Microcontroller include files */
!	    "ins", /* Microcontroller include files */
!	    "s", "sa", /* Unix assembler */
!	    "S",   /* cpp-processed Unix assembler */
!	    "src", /* BSO/Tasking C compiler output */
!	    NULL
!	  };
 	static const char Asm_help [] =
 	"In assembler code, labels appearing at the beginning of a line,\n\
 	followed by a colon, are tags.";
--- 536,553 ----
 	will just search for any tag `bidule'.";
 	
 	/* Assembly code */
!	static const char *Asm_suffixes []
!	  = {
!	      "a",	/* Unix assembler */
!	      "asm",	/* Microcontroller assembly */
!	      "def",	/* BSO/Tasking definition includes  */
!	      "inc",	/* Microcontroller include files */
!	      "ins",	/* Microcontroller include files */
!	      "s", "sa", /* Unix assembler */
!	      "S",	/* cpp-processed Unix assembler */
!	      "src",	/* BSO/Tasking C compiler output */
!	      NULL
!	    };
 	static const char Asm_help [] =
 	"In assembler code, labels appearing at the beginning of a line,\n\
 	followed by a colon, are tags.";





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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
  2012-07-31  6:24       ` Paul Eggert
@ 2012-07-31 22:31         ` Richard Stallman
  2012-07-31 23:28           ` Paul Eggert
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2012-07-31 22:31 UTC (permalink / raw)
  To: Paul Eggert; +Cc: monnier, emacs-devel

When the initializer is long and in braces, it's ok to break
after the = sign and put the open brace in column zero,
because that makes the whole initializer a defun.

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
  2012-07-31 22:31         ` Richard Stallman
@ 2012-07-31 23:28           ` Paul Eggert
  2012-08-01  3:39             ` Richard Stallman
  2012-08-01 23:31             ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Paul Eggert @ 2012-07-31 23:28 UTC (permalink / raw)
  To: rms; +Cc: monnier, emacs-devel

On 07/31/2012 03:31 PM, Richard Stallman wrote:
> When the initializer is long and in braces, it's ok to break
> after the = sign and put the open brace in column zero,
> because that makes the whole initializer a defun.

OK, that blesses some of the use of trailing '=' in lines,
but there are still lots of places where the style
guideline isn't being followed now.  Would it be a good idea
to change this systematically, with patches like the following?
(This patch is just a sample: it covers just src/alloc.c.)

=== modified file 'src/alloc.c'
*** src/alloc.c	2012-07-31 12:36:19 +0000
--- src/alloc.c	2012-07-31 23:22:42 +0000
***************
*** 537,552 ****
 	    - XMALLOC_OVERRUN_CHECK_SIZE)
 	
 	static char const xmalloc_overrun_check_header[XMALLOC_OVERRUN_CHECK_SIZE] =
!	  { '\x9a', '\x9b', '\xae', '\xaf',
!	    '\xbf', '\xbe', '\xce', '\xcf',
!	    '\xea', '\xeb', '\xec', '\xed',
!	    '\xdf', '\xde', '\x9c', '\x9d' };
 	
 	static char const xmalloc_overrun_check_trailer[XMALLOC_OVERRUN_CHECK_SIZE] =
!	  { '\xaa', '\xab', '\xac', '\xad',
!	    '\xba', '\xbb', '\xbc', '\xbd',
!	    '\xca', '\xcb', '\xcc', '\xcd',
!	    '\xda', '\xdb', '\xdc', '\xdd' };
 	
 	/* Insert and extract the block size in the header.  */
 	
--- 537,556 ----
 	    - XMALLOC_OVERRUN_CHECK_SIZE)
 	
 	static char const xmalloc_overrun_check_header[XMALLOC_OVERRUN_CHECK_SIZE] =
!	{
!	  '\x9a', '\x9b', '\xae', '\xaf',
!	  '\xbf', '\xbe', '\xce', '\xcf',
!	  '\xea', '\xeb', '\xec', '\xed',
!	  '\xdf', '\xde', '\x9c', '\x9d'
!	};
 	
 	static char const xmalloc_overrun_check_trailer[XMALLOC_OVERRUN_CHECK_SIZE] =
!	{
!	  '\xaa', '\xab', '\xac', '\xad',
!	  '\xba', '\xbb', '\xbc', '\xbd',
!	  '\xca', '\xcb', '\xcc', '\xcd',
!	  '\xda', '\xdb', '\xdc', '\xdd'
!	};
 	
 	/* Insert and extract the block size in the header.  */
 	
***************
*** 1135,1142 ****
 	    }
 	
 	  abase = ABLOCK_ABASE (free_ablock);
!	  ABLOCKS_BUSY (abase) =
!	    (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase));
 	  val = free_ablock;
 	  free_ablock = free_ablock->x.next_free;
 	
--- 1139,1146 ----
 	    }
 	
 	  abase = ABLOCK_ABASE (free_ablock);
!	  ABLOCKS_BUSY (abase)
!	    = (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase));
 	  val = free_ablock;
 	  free_ablock = free_ablock->x.next_free;
 	
***************
*** 1728,1735 ****
 	   presence of this cookie during GC.  */
 	
 	#define GC_STRING_OVERRUN_COOKIE_SIZE	4
!	static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] =
!	  { '\xde', '\xad', '\xbe', '\xef' };
 	
 	#else
 	#define GC_STRING_OVERRUN_COOKIE_SIZE 0
--- 1732,1739 ----
 	   presence of this cookie during GC.  */
 	
 	#define GC_STRING_OVERRUN_COOKIE_SIZE	4
!	static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE]
!	  = { '\xde', '\xad', '\xbe', '\xef' };
 	
 	#else
 	#define GC_STRING_OVERRUN_COOKIE_SIZE 0
***************
*** 1774,1786 ****
 	   STRING_BYTES_BOUND, nor can it be so long that the size_t
 	   arithmetic in allocate_string_data would overflow while it is
 	   calculating a value to be passed to malloc.  */
!	static ptrdiff_t const STRING_BYTES_MAX =
!	  min (STRING_BYTES_BOUND,
!	       ((SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD
!		 - GC_STRING_EXTRA
!		 - offsetof (struct sblock, first_data)
!		 - SDATA_DATA_OFFSET)
!		& ~(sizeof (EMACS_INT) - 1)));
 	
 	/* Initialize string allocation.  Called from init_alloc_once.  */
 	
--- 1778,1790 ----
 	   STRING_BYTES_BOUND, nor can it be so long that the size_t
 	   arithmetic in allocate_string_data would overflow while it is
 	   calculating a value to be passed to malloc.  */
!	static ptrdiff_t const STRING_BYTES_MAX
!	  = min (STRING_BYTES_BOUND,
!		 ((SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD
!		   - GC_STRING_EXTRA
!		   - offsetof (struct sblock, first_data)
!		   - SDATA_DATA_OFFSET)
!		  & ~(sizeof (EMACS_INT) - 1)));
 	
 	/* Initialize string allocation.  Called from init_alloc_once.  */
 	
***************
*** 1802,1809 ****
 	ptrdiff_t
 	string_bytes (struct Lisp_String *s)
 	{
!	  ptrdiff_t nbytes =
!	    (s->size_byte < 0 ? s->size & ~ARRAY_MARK_FLAG : s->size_byte);
 	
 	  if (!PURE_POINTER_P (s)
 	      && s->data
--- 1806,1813 ----
 	ptrdiff_t
 	string_bytes (struct Lisp_String *s)
 	{
!	  ptrdiff_t nbytes
!	    = (s->size_byte < 0 ? s->size & ~ARRAY_MARK_FLAG : s->size_byte);
 	
 	  if (!PURE_POINTER_P (s)
 	      && s->data
***************
*** 5685,5693 ****
 	#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
 	  {
 	    /* Compute average percentage of zombies.  */
!	    double nlive =
!	      (total_conses + total_symbols + total_markers + total_strings
!	       + total_vectors + total_floats + total_intervals + total_buffers);
 	
 	    avg_live = (avg_live * ngcs + nlive) / (ngcs + 1);
 	    max_live = max (nlive, max_live);
--- 5689,5697 ----
 	#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
 	  {
 	    /* Compute average percentage of zombies.  */
!	    double nlive
!	      = (total_conses + total_symbols + total_markers + total_strings
!		 + total_vectors + total_floats + total_intervals + total_buffers);
 	
 	    avg_live = (avg_live * ngcs + nlive) / (ngcs + 1);
 	    max_live = max (nlive, max_live);





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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
  2012-07-31 23:28           ` Paul Eggert
@ 2012-08-01  3:39             ` Richard Stallman
  2012-08-01 23:31             ` Stefan Monnier
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2012-08-01  3:39 UTC (permalink / raw)
  To: Paul Eggert; +Cc: monnier, emacs-devel

These alloc.c changes look good to me.

--
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call



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

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
  2012-07-31 23:28           ` Paul Eggert
  2012-08-01  3:39             ` Richard Stallman
@ 2012-08-01 23:31             ` Stefan Monnier
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2012-08-01 23:31 UTC (permalink / raw)
  To: Paul Eggert; +Cc: rms, emacs-devel

> guideline isn't being followed now.  Would it be a good idea
> to change this systematically, with patches like the following?

I do not like such systematic cosmetic changes.  So feel free to make
such changes, when making changes in corresponding areas, but don't try
and make such changes in all files in one go, please.


        Stefan



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

end of thread, other threads:[~2012-08-01 23:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1SvWBA-00078u-9A@vcs.savannah.gnu.org>
2012-07-30 22:33 ` [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style Stefan Monnier
2012-07-30 22:47   ` Paul Eggert
2012-07-30 23:11     ` Stefan Monnier
2012-07-30 23:32       ` Paul Eggert
2012-07-31  6:06     ` Richard Stallman
2012-07-31  6:24       ` Paul Eggert
2012-07-31 22:31         ` Richard Stallman
2012-07-31 23:28           ` Paul Eggert
2012-08-01  3:39             ` Richard Stallman
2012-08-01 23:31             ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.