* dispnew.c (clear_glyph_row, copy_row_except_pointers): Use enums

instead of ints, as it's the usual style for offsetof constants.  See:
http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00478.html
This commit is contained in:
Paul Eggert 2013-09-24 08:29:27 -07:00
parent 4710d6f406
commit cf647d9300
2 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,9 @@
2013-09-24 Paul Eggert <eggert@cs.ucla.edu>
* dispnew.c (clear_glyph_row, copy_row_except_pointers): Use enums
instead of ints, as it's the usual style for offsetof constants. See:
http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00478.html
* data.c (POPCOUNT_STATIC_INLINE): New macro, as a hack for popcount.
This is ugly, but it should fix the performance problem for older
GCC versions in the short run. I'll look into integrating the

View file

@ -838,7 +838,7 @@ clear_window_matrices (struct window *w, bool desired_p)
void
clear_glyph_row (struct glyph_row *row)
{
int off = offsetof (struct glyph_row, used);
enum { off = offsetof (struct glyph_row, used) };
/* Zero everything except pointers in `glyphs'. */
memset (row->used, 0, sizeof *row - off);
@ -988,7 +988,7 @@ swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b)
static void
copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
{
int off = offsetof (struct glyph_row, x);
enum { off = offsetof (struct glyph_row, x) };
memcpy (&to->x, &from->x, sizeof *to - off);
}