[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r114450: * dispnew.c (clear_glyph_row, copy_row_exce
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] trunk r114450: * dispnew.c (clear_glyph_row, copy_row_except_pointers): |
Date: |
Tue, 24 Sep 2013 07:16:55 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 114450
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2013-09-24 00:16:38 -0700
message:
* 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 *.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/dispnew.c dispnew.c-20091113204419-o5vbwnq5f7feedwu-258
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-09-24 06:43:20 +0000
+++ b/src/ChangeLog 2013-09-24 07:16:38 +0000
@@ -1,3 +1,11 @@
+2013-09-24 Paul Eggert <address@hidden>
+
+ * 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 *.
+
2013-09-24 Dmitry Antipov <address@hidden>
Use union for the payload of struct Lisp_Vector.
=== modified file 'src/dispnew.c'
--- a/src/dispnew.c 2013-09-24 05:42:30 +0000
+++ b/src/dispnew.c 2013-09-24 07:16:38 +0000
@@ -838,11 +838,10 @@
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 @@
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);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r114450: * dispnew.c (clear_glyph_row, copy_row_except_pointers):,
Paul Eggert <=