aboutsummaryrefslogtreecommitdiffstats
path: root/src/font.c
diff options
context:
space:
mode:
authorPaul Eggert2015-01-19 00:56:18 -0800
committerPaul Eggert2015-01-19 01:01:58 -0800
commitb7f83adda5a32140811e8e7decc4394d64cada3d (patch)
tree98d7d6763a62fc033464e4f2d5edde5c937623dd /src/font.c
parent9592a014df784e67a4647d5b6424f2758dfaad3c (diff)
downloademacs-b7f83adda5a32140811e8e7decc4394d64cada3d.tar.gz
emacs-b7f83adda5a32140811e8e7decc4394d64cada3d.zip
Prefer memset to repeatedly assigning Qnil
* alloc.c (allocate_pseudovector): Catch more bogus values. * alloc.c (allocate_pseudovector): * callint.c (Fcall_interactively): * coding.c (syms_of_coding): * fringe.c (init_fringe): Verify that Qnil == 0. * callint.c (Fcall_interactively): * eval.c (Fapply, Ffuncall): * fns.c (mapcar1, larger_vector): * font.c (font_expand_wildcards): * fringe.c (init_fringe): Prefer memset to assigning zeros by hand. * callint.c (Fcall_interactively): Remove duplicate assignment of Qnil to args[i]. * coding.c (syms_of_coding): Prefer LISP_INITIALLY_ZERO to assigning zeros by hand. * fileio.c (Ffile_selinux_context): Rewrite to avoid need for Lisp_Object array. * lisp.h (XLI_BUILTIN_LISPSYM): New macro. (DEFINE_LISP_SYMBOL_END): Use it. (NIL_IS_ZERO): New constant. (memsetnil): New function.
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/font.c b/src/font.c
index 56a27821718..190b33a8ef0 100644
--- a/src/font.c
+++ b/src/font.c
@@ -989,15 +989,14 @@ font_expand_wildcards (Lisp_Object *field, int n)
989 if (i == 0 || ! NILP (tmp[i - 1])) 989 if (i == 0 || ! NILP (tmp[i - 1]))
990 /* None of TMP[X] corresponds to Jth field. */ 990 /* None of TMP[X] corresponds to Jth field. */
991 return -1; 991 return -1;
992 for (; j < range[i].from; j++) 992 memsetnil (field + j, range[i].from - j);
993 field[j] = Qnil; 993 j = range[i].from;
994 } 994 }
995 field[j++] = tmp[i]; 995 field[j++] = tmp[i];
996 } 996 }
997 if (! NILP (tmp[n - 1]) && j < XLFD_REGISTRY_INDEX) 997 if (! NILP (tmp[n - 1]) && j < XLFD_REGISTRY_INDEX)
998 return -1; 998 return -1;
999 for (; j < XLFD_LAST_INDEX; j++) 999 memsetnil (field + j, XLFD_LAST_INDEX - j);
1000 field[j] = Qnil;
1001 if (INTEGERP (field[XLFD_ENCODING_INDEX])) 1000 if (INTEGERP (field[XLFD_ENCODING_INDEX]))
1002 field[XLFD_ENCODING_INDEX] 1001 field[XLFD_ENCODING_INDEX]
1003 = Fintern (Fnumber_to_string (field[XLFD_ENCODING_INDEX]), Qnil); 1002 = Fintern (Fnumber_to_string (field[XLFD_ENCODING_INDEX]), Qnil);