diff --git a/src/ChangeLog b/src/ChangeLog index 90ffce575f9..3f0c4196afd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2013-09-24 Paul Eggert + * 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 diff --git a/src/dispnew.c b/src/dispnew.c index f9132f37f68..27167f4e1e4 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -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); }