aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2013-09-24 00:16:38 -0700
committerPaul Eggert2013-09-24 00:16:38 -0700
commit9da0f50e5ab74e7543f169cef831cc8c22ef4f43 (patch)
treef7bd8f7c4df27dbe45f640a535a88ac14d5753f8 /src
parentd6d9cbc15cbebfe466756a7a75601173c15287a2 (diff)
downloademacs-9da0f50e5ab74e7543f169cef831cc8c22ef4f43.tar.gz
emacs-9da0f50e5ab74e7543f169cef831cc8c22ef4f43.zip
* dispnew.c (clear_glyph_row, copy_row_except_pointers):
Prefer signed to unsigned integers where either will do. No need for 'const' on locals that do not escape. Omit easserts with unnecessary and unportable assumptions about alignment. Avoid unnecessary casts to char *.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/dispnew.c10
2 files changed, 12 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a2eb39e7196..e4d9ad3b835 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12013-09-24 Paul Eggert <eggert@cs.ucla.edu>
2
3 * dispnew.c (clear_glyph_row, copy_row_except_pointers):
4 Prefer signed to unsigned integers where either will do.
5 No need for 'const' on locals that do not escape.
6 Omit easserts with unnecessary and unportable assumptions about
7 alignment. Avoid unnecessary casts to char *.
8
12013-09-24 Dmitry Antipov <dmantipov@yandex.ru> 92013-09-24 Dmitry Antipov <dmantipov@yandex.ru>
2 10
3 Use union for the payload of struct Lisp_Vector. 11 Use union for the payload of struct Lisp_Vector.
diff --git a/src/dispnew.c b/src/dispnew.c
index f7e3fa54441..f9132f37f68 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -838,11 +838,10 @@ clear_window_matrices (struct window *w, bool desired_p)
838void 838void
839clear_glyph_row (struct glyph_row *row) 839clear_glyph_row (struct glyph_row *row)
840{ 840{
841 const size_t off = offsetof (struct glyph_row, used); 841 int off = offsetof (struct glyph_row, used);
842 842
843 eassert (off == sizeof row->glyphs);
844 /* Zero everything except pointers in `glyphs'. */ 843 /* Zero everything except pointers in `glyphs'. */
845 memset ((char *) row + off, 0, sizeof *row - off); 844 memset (row->used, 0, sizeof *row - off);
846} 845}
847 846
848 847
@@ -989,10 +988,9 @@ swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b)
989static void 988static void
990copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from) 989copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
991{ 990{
992 const size_t off = offsetof (struct glyph_row, x); 991 int off = offsetof (struct glyph_row, x);
993 992
994 eassert (off == sizeof to->glyphs + sizeof to->used + sizeof to->hash); 993 memcpy (&to->x, &from->x, sizeof *to - off);
995 memcpy ((char *) to + off, (char *) from + off, sizeof *to - off);
996} 994}
997 995
998 996