diff options
| author | Dmitry Antipov | 2012-08-21 14:21:04 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-08-21 14:21:04 +0400 |
| commit | 086ca913a8495b1d4f0d7eae58aea75f2f5e44ae (patch) | |
| tree | 0eb5a3cb36efc4b1f2209dfa74be7d6fd3c1b034 /src/xfont.c | |
| parent | 0e733db9150ea50dc1a3687a0898d6264c4cabd8 (diff) | |
| download | emacs-086ca913a8495b1d4f0d7eae58aea75f2f5e44ae.tar.gz emacs-086ca913a8495b1d4f0d7eae58aea75f2f5e44ae.zip | |
Avoid direct writes to contents member of struct Lisp_Vector.
* lisp.h (vcopy): New function to copy data into vector.
* dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
* fns.c (Ffillarray): Use ASET.
* keyboard.c (timer_check_2): Use AREF and ASET.
(append_tool_bar_item, Frecent_keys): Use vcopy.
* lread.c (read_vector): Use ASET.
* msdos.c (Frecent_doskeys): Use vcopy.
* xface.c (Finternal_copy_lisp_face): Use vcopy.
(Finternal_merge_in_global_face): Use ASET and vcopy.
* xfont.c (xfont_list_pattern): Likewise.
Diffstat (limited to 'src/xfont.c')
| -rw-r--r-- | src/xfont.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/xfont.c b/src/xfont.c index 072bce7bb0a..cbb24622ae9 100644 --- a/src/xfont.c +++ b/src/xfont.c | |||
| @@ -390,7 +390,7 @@ xfont_list_pattern (Display *display, const char *pattern, | |||
| 390 | Lisp_Object scripts = Qnil; | 390 | Lisp_Object scripts = Qnil; |
| 391 | 391 | ||
| 392 | for (i = 0; i < ASIZE (xfont_scratch_props); i++) | 392 | for (i = 0; i < ASIZE (xfont_scratch_props); i++) |
| 393 | props[i] = Qnil; | 393 | ASET (xfont_scratch_props, i, Qnil); |
| 394 | for (i = 0; i < num_fonts; i++) | 394 | for (i = 0; i < num_fonts; i++) |
| 395 | indices[i] = names[i]; | 395 | indices[i] = names[i]; |
| 396 | qsort (indices, num_fonts, sizeof (char *), compare_font_names); | 396 | qsort (indices, num_fonts, sizeof (char *), compare_font_names); |
| @@ -467,9 +467,9 @@ xfont_list_pattern (Display *display, const char *pattern, | |||
| 467 | word_size * 7) | 467 | word_size * 7) |
| 468 | || ! EQ (AREF (entity, FONT_SPACING_INDEX), props[7])) | 468 | || ! EQ (AREF (entity, FONT_SPACING_INDEX), props[7])) |
| 469 | { | 469 | { |
| 470 | memcpy (props, aref_addr (entity, FONT_FOUNDRY_INDEX), | 470 | vcopy (xfont_scratch_props, 0, |
| 471 | word_size * 7); | 471 | aref_addr (entity, FONT_FOUNDRY_INDEX), 7); |
| 472 | props[7] = AREF (entity, FONT_SPACING_INDEX); | 472 | ASET (xfont_scratch_props, 7, AREF (entity, FONT_SPACING_INDEX)); |
| 473 | scripts = xfont_supported_scripts (display, indices[i], | 473 | scripts = xfont_supported_scripts (display, indices[i], |
| 474 | xfont_scratch_props, encoding); | 474 | xfont_scratch_props, encoding); |
| 475 | } | 475 | } |