diff options
| author | Paul Eggert | 2013-09-24 08:29:27 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-09-24 08:29:27 -0700 |
| commit | cf647d9300961108f50c6ae47b234d0e9afb89b4 (patch) | |
| tree | 514bdc289a9571c9f2cfc550647bb4441d4f86a2 /src | |
| parent | 4710d6f406ff792aaae65ad141f96346be44909d (diff) | |
| download | emacs-cf647d9300961108f50c6ae47b234d0e9afb89b4.tar.gz emacs-cf647d9300961108f50c6ae47b234d0e9afb89b4.zip | |
* 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
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/dispnew.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 90ffce575f9..3f0c4196afd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2013-09-24 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2013-09-24 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * dispnew.c (clear_glyph_row, copy_row_except_pointers): Use enums | ||
| 4 | instead of ints, as it's the usual style for offsetof constants. See: | ||
| 5 | http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00478.html | ||
| 6 | |||
| 3 | * data.c (POPCOUNT_STATIC_INLINE): New macro, as a hack for popcount. | 7 | * data.c (POPCOUNT_STATIC_INLINE): New macro, as a hack for popcount. |
| 4 | This is ugly, but it should fix the performance problem for older | 8 | This is ugly, but it should fix the performance problem for older |
| 5 | GCC versions in the short run. I'll look into integrating the | 9 | 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) | |||
| 838 | void | 838 | void |
| 839 | clear_glyph_row (struct glyph_row *row) | 839 | clear_glyph_row (struct glyph_row *row) |
| 840 | { | 840 | { |
| 841 | int off = offsetof (struct glyph_row, used); | 841 | enum { off = offsetof (struct glyph_row, used) }; |
| 842 | 842 | ||
| 843 | /* Zero everything except pointers in `glyphs'. */ | 843 | /* Zero everything except pointers in `glyphs'. */ |
| 844 | memset (row->used, 0, sizeof *row - off); | 844 | memset (row->used, 0, sizeof *row - off); |
| @@ -988,7 +988,7 @@ swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b) | |||
| 988 | static void | 988 | static void |
| 989 | copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from) | 989 | copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from) |
| 990 | { | 990 | { |
| 991 | int off = offsetof (struct glyph_row, x); | 991 | enum { off = offsetof (struct glyph_row, x) }; |
| 992 | 992 | ||
| 993 | memcpy (&to->x, &from->x, sizeof *to - off); | 993 | memcpy (&to->x, &from->x, sizeof *to - off); |
| 994 | } | 994 | } |