summaryrefslogtreecommitdiff
path: root/src/dispnew.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-09-24 00:16:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-09-24 00:16:38 -0700
commit9da0f50e5ab74e7543f169cef831cc8c22ef4f43 (patch)
treef7bd8f7c4df27dbe45f640a535a88ac14d5753f8 /src/dispnew.c
parentd6d9cbc15cbebfe466756a7a75601173c15287a2 (diff)
* 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/dispnew.c')
-rw-r--r--src/dispnew.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index f7e3fa5444..f9132f37f6 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -838,11 +838,10 @@ clear_window_matrices (struct window *w, bool desired_p)
void
clear_glyph_row (struct glyph_row *row)
{
- const size_t off = offsetof (struct glyph_row, used);
+ int off = offsetof (struct glyph_row, used);
- eassert (off == sizeof row->glyphs);
/* Zero everything except pointers in `glyphs'. */
- memset ((char *) row + off, 0, sizeof *row - off);
+ memset (row->used, 0, sizeof *row - off);
}
@@ -989,10 +988,9 @@ 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)
{
- const size_t off = offsetof (struct glyph_row, x);
+ int off = offsetof (struct glyph_row, x);
- eassert (off == sizeof to->glyphs + sizeof to->used + sizeof to->hash);
- memcpy ((char *) to + off, (char *) from + off, sizeof *to - off);
+ memcpy (&to->x, &from->x, sizeof *to - off);
}