aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/alloc.c14
-rw-r--r--src/buffer.c3
-rw-r--r--src/bytecode.c10
-rw-r--r--src/callint.c2
-rw-r--r--src/category.c5
-rw-r--r--src/ccl.c4
-rw-r--r--src/character.c2
-rw-r--r--src/charset.c16
-rw-r--r--src/chartab.c13
-rw-r--r--src/coding.c65
-rw-r--r--src/composite.c31
-rw-r--r--src/composite.h2
-rw-r--r--src/dispnew.c4
-rw-r--r--src/fns.c20
-rw-r--r--src/font.c25
-rw-r--r--src/fontset.c26
-rw-r--r--src/image.c2
-rw-r--r--src/json.c2
-rw-r--r--src/keyboard.c32
-rw-r--r--src/keymap.c20
-rw-r--r--src/lisp.h11
-rw-r--r--src/lread.c28
-rw-r--r--src/macfont.m6
-rw-r--r--src/menu.c2
-rw-r--r--src/nsfns.m2
-rw-r--r--src/process.c47
-rw-r--r--src/profiler.c5
-rw-r--r--src/term.c15
-rw-r--r--src/window.c3
-rw-r--r--src/xdisp.c4
-rw-r--r--src/xfaces.c10
-rw-r--r--src/xfns.c4
-rw-r--r--src/xfont.c2
-rw-r--r--src/xselect.c2
-rw-r--r--src/xwidget.c2
35 files changed, 195 insertions, 246 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 201e3f0b13f..503ef98b983 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3353,7 +3353,7 @@ static struct Lisp_Vector *
3353allocate_vectorlike (ptrdiff_t len) 3353allocate_vectorlike (ptrdiff_t len)
3354{ 3354{
3355 eassert (0 < len && len <= VECTOR_ELTS_MAX); 3355 eassert (0 < len && len <= VECTOR_ELTS_MAX);
3356 size_t nbytes = header_size + len * word_size; 3356 ptrdiff_t nbytes = header_size + len * word_size;
3357 struct Lisp_Vector *p; 3357 struct Lisp_Vector *p;
3358 3358
3359 MALLOC_BLOCK_INPUT; 3359 MALLOC_BLOCK_INPUT;
@@ -3496,8 +3496,16 @@ See also the function `vector'. */)
3496{ 3496{
3497 CHECK_TYPE (FIXNATP (length) && XFIXNAT (length) <= PTRDIFF_MAX, 3497 CHECK_TYPE (FIXNATP (length) && XFIXNAT (length) <= PTRDIFF_MAX,
3498 Qwholenump, length); 3498 Qwholenump, length);
3499 struct Lisp_Vector *p = allocate_vector (XFIXNAT (length)); 3499 return make_vector (XFIXNAT (length), init);
3500 for (ptrdiff_t i = 0; i < XFIXNAT (length); i++) 3500}
3501
3502/* Return a new vector of length LENGTH with each element being INIT. */
3503
3504Lisp_Object
3505make_vector (ptrdiff_t length, Lisp_Object init)
3506{
3507 struct Lisp_Vector *p = allocate_vector (length);
3508 for (ptrdiff_t i = 0; i < length; i++)
3501 p->contents[i] = init; 3509 p->contents[i] = init;
3502 return make_lisp_ptr (p, Lisp_Vectorlike); 3510 return make_lisp_ptr (p, Lisp_Vectorlike);
3503} 3511}
diff --git a/src/buffer.c b/src/buffer.c
index 90ef886b229..a71bd77de9f 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5410,8 +5410,7 @@ void
5410syms_of_buffer (void) 5410syms_of_buffer (void)
5411{ 5411{
5412 staticpro (&last_overlay_modification_hooks); 5412 staticpro (&last_overlay_modification_hooks);
5413 last_overlay_modification_hooks 5413 last_overlay_modification_hooks = make_nil_vector (10);
5414 = Fmake_vector (make_fixnum (10), Qnil);
5415 5414
5416 staticpro (&QSFundamental); 5415 staticpro (&QSFundamental);
5417 staticpro (&Vbuffer_alist); 5416 staticpro (&Vbuffer_alist);
diff --git a/src/bytecode.c b/src/bytecode.c
index 40389e08f0e..95f7b32a036 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1494,13 +1494,9 @@ If a symbol has a property named `byte-code-meter' whose value is an
1494integer, it is incremented each time that symbol's function is called. */); 1494integer, it is incremented each time that symbol's function is called. */);
1495 1495
1496 byte_metering_on = false; 1496 byte_metering_on = false;
1497 Vbyte_code_meter = Fmake_vector (make_fixnum (256), make_fixnum (0)); 1497 Vbyte_code_meter = make_nil_vector (256);
1498 DEFSYM (Qbyte_code_meter, "byte-code-meter"); 1498 DEFSYM (Qbyte_code_meter, "byte-code-meter");
1499 { 1499 for (int i = 0; i < 256; i++)
1500 int i = 256; 1500 ASET (Vbyte_code_meter, i, make_vector (256, make_fixnum (0)));
1501 while (i--)
1502 ASET (Vbyte_code_meter, i,
1503 Fmake_vector (make_fixnum (256), make_fixnum (0)));
1504 }
1505#endif 1501#endif
1506} 1502}
diff --git a/src/callint.c b/src/callint.c
index 81efb267bdf..87411005a3c 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -589,7 +589,7 @@ invoke it. If KEYS is omitted or nil, the return value of
589 case 'U': /* Up event from last k or K. */ 589 case 'U': /* Up event from last k or K. */
590 if (!NILP (up_event)) 590 if (!NILP (up_event))
591 { 591 {
592 args[i] = Fmake_vector (make_fixnum (1), up_event); 592 args[i] = make_vector (1, up_event);
593 up_event = Qnil; 593 up_event = Qnil;
594 visargs[i] = Fkey_description (args[i], Qnil); 594 visargs[i] = Fkey_description (args[i], Qnil);
595 } 595 }
diff --git a/src/category.c b/src/category.c
index d6ccde5369b..c316e9a0234 100644
--- a/src/category.c
+++ b/src/category.c
@@ -271,8 +271,7 @@ DEFUN ("make-category-table", Fmake_category_table, Smake_category_table,
271 set_char_table_defalt (val, MAKE_CATEGORY_SET); 271 set_char_table_defalt (val, MAKE_CATEGORY_SET);
272 for (i = 0; i < (1 << CHARTAB_SIZE_BITS_0); i++) 272 for (i = 0; i < (1 << CHARTAB_SIZE_BITS_0); i++)
273 set_char_table_contents (val, i, MAKE_CATEGORY_SET); 273 set_char_table_contents (val, i, MAKE_CATEGORY_SET);
274 Fset_char_table_extra_slot (val, make_fixnum (0), 274 Fset_char_table_extra_slot (val, make_fixnum (0), make_nil_vector (95));
275 Fmake_vector (make_fixnum (95), Qnil));
276 return val; 275 return val;
277} 276}
278 277
@@ -446,7 +445,7 @@ init_category_once (void)
446 /* Set a category set which contains nothing to the default. */ 445 /* Set a category set which contains nothing to the default. */
447 set_char_table_defalt (Vstandard_category_table, MAKE_CATEGORY_SET); 446 set_char_table_defalt (Vstandard_category_table, MAKE_CATEGORY_SET);
448 Fset_char_table_extra_slot (Vstandard_category_table, make_fixnum (0), 447 Fset_char_table_extra_slot (Vstandard_category_table, make_fixnum (0),
449 Fmake_vector (make_fixnum (95), Qnil)); 448 make_nil_vector (95));
450} 449}
451 450
452void 451void
diff --git a/src/ccl.c b/src/ccl.c
index 31d0a28c5aa..64e70456aca 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -2275,7 +2275,7 @@ void
2275syms_of_ccl (void) 2275syms_of_ccl (void)
2276{ 2276{
2277 staticpro (&Vccl_program_table); 2277 staticpro (&Vccl_program_table);
2278 Vccl_program_table = Fmake_vector (make_fixnum (32), Qnil); 2278 Vccl_program_table = make_nil_vector (32);
2279 2279
2280 DEFSYM (Qccl, "ccl"); 2280 DEFSYM (Qccl, "ccl");
2281 DEFSYM (Qcclp, "cclp"); 2281 DEFSYM (Qcclp, "cclp");
@@ -2291,7 +2291,7 @@ syms_of_ccl (void)
2291 2291
2292 DEFVAR_LISP ("code-conversion-map-vector", Vcode_conversion_map_vector, 2292 DEFVAR_LISP ("code-conversion-map-vector", Vcode_conversion_map_vector,
2293 doc: /* Vector of code conversion maps. */); 2293 doc: /* Vector of code conversion maps. */);
2294 Vcode_conversion_map_vector = Fmake_vector (make_fixnum (16), Qnil); 2294 Vcode_conversion_map_vector = make_nil_vector (16);
2295 2295
2296 DEFVAR_LISP ("font-ccl-encoder-alist", Vfont_ccl_encoder_alist, 2296 DEFVAR_LISP ("font-ccl-encoder-alist", Vfont_ccl_encoder_alist,
2297 doc: /* Alist of fontname patterns vs corresponding CCL program. 2297 doc: /* Alist of fontname patterns vs corresponding CCL program.
diff --git a/src/character.c b/src/character.c
index 0b14e476c13..63cb1fcc093 100644
--- a/src/character.c
+++ b/src/character.c
@@ -1124,7 +1124,7 @@ syms_of_character (void)
1124Vector recording all translation tables ever defined. 1124Vector recording all translation tables ever defined.
1125Each element is a pair (SYMBOL . TABLE) relating the table to the 1125Each element is a pair (SYMBOL . TABLE) relating the table to the
1126symbol naming it. The ID of a translation table is an index into this vector. */); 1126symbol naming it. The ID of a translation table is an index into this vector. */);
1127 Vtranslation_table_vector = Fmake_vector (make_fixnum (16), Qnil); 1127 Vtranslation_table_vector = make_nil_vector (16);
1128 1128
1129 DEFVAR_LISP ("auto-fill-chars", Vauto_fill_chars, 1129 DEFVAR_LISP ("auto-fill-chars", Vauto_fill_chars,
1130 doc: /* 1130 doc: /*
diff --git a/src/charset.c b/src/charset.c
index c1a237835c7..83f4de7ed24 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -261,7 +261,7 @@ load_charset_map (struct charset *charset, struct charset_map_entries *entries,
261 { 261 {
262 int n = CODE_POINT_TO_INDEX (charset, max_code) + 1; 262 int n = CODE_POINT_TO_INDEX (charset, max_code) + 1;
263 263
264 vec = Fmake_vector (make_fixnum (n), make_fixnum (-1)); 264 vec = make_vector (n, make_fixnum (-1));
265 set_charset_attr (charset, charset_decoder, vec); 265 set_charset_attr (charset, charset_decoder, vec);
266 } 266 }
267 else 267 else
@@ -856,7 +856,7 @@ usage: (define-charset-internal ...) */)
856 Fcons (intern ("define-charset-internal"), 856 Fcons (intern ("define-charset-internal"),
857 make_fixnum (nargs))); 857 make_fixnum (nargs)));
858 858
859 attrs = Fmake_vector (make_fixnum (charset_attr_max), Qnil); 859 attrs = make_nil_vector (charset_attr_max);
860 860
861 CHECK_SYMBOL (args[charset_arg_name]); 861 CHECK_SYMBOL (args[charset_arg_name]);
862 ASET (attrs, charset_name, args[charset_arg_name]); 862 ASET (attrs, charset_name, args[charset_arg_name]);
@@ -1563,7 +1563,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
1563 1563
1564 from_byte = CHAR_TO_BYTE (from); 1564 from_byte = CHAR_TO_BYTE (from);
1565 1565
1566 charsets = Fmake_vector (make_fixnum (charset_table_used), Qnil); 1566 charsets = make_nil_vector (charset_table_used);
1567 while (1) 1567 while (1)
1568 { 1568 {
1569 find_charsets_in_text (BYTE_POS_ADDR (from_byte), stop - from, 1569 find_charsets_in_text (BYTE_POS_ADDR (from_byte), stop - from,
@@ -1594,18 +1594,14 @@ If STR is unibyte, the returned list may contain
1594only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) 1594only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
1595 (Lisp_Object str, Lisp_Object table) 1595 (Lisp_Object str, Lisp_Object table)
1596{ 1596{
1597 Lisp_Object charsets;
1598 int i;
1599 Lisp_Object val;
1600
1601 CHECK_STRING (str); 1597 CHECK_STRING (str);
1602 1598
1603 charsets = Fmake_vector (make_fixnum (charset_table_used), Qnil); 1599 Lisp_Object charsets = make_nil_vector (charset_table_used);
1604 find_charsets_in_text (SDATA (str), SCHARS (str), SBYTES (str), 1600 find_charsets_in_text (SDATA (str), SCHARS (str), SBYTES (str),
1605 charsets, table, 1601 charsets, table,
1606 STRING_MULTIBYTE (str)); 1602 STRING_MULTIBYTE (str));
1607 val = Qnil; 1603 Lisp_Object val = Qnil;
1608 for (i = charset_table_used - 1; i >= 0; i--) 1604 for (int i = charset_table_used - 1; i >= 0; i--)
1609 if (!NILP (AREF (charsets, i))) 1605 if (!NILP (AREF (charsets, i)))
1610 val = Fcons (CHARSET_NAME (charset_table + i), val); 1606 val = Fcons (CHARSET_NAME (charset_table + i), val);
1611 return val; 1607 return val;
diff --git a/src/chartab.c b/src/chartab.c
index 3d38b3ce12e..16017f4a49a 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -125,7 +125,7 @@ the char-table has no extra slot. */)
125 } 125 }
126 126
127 size = CHAR_TABLE_STANDARD_SLOTS + n_extras; 127 size = CHAR_TABLE_STANDARD_SLOTS + n_extras;
128 vector = Fmake_vector (make_fixnum (size), init); 128 vector = make_vector (size, init);
129 XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE); 129 XSETPVECTYPE (XVECTOR (vector), PVEC_CHAR_TABLE);
130 set_char_table_parent (vector, Qnil); 130 set_char_table_parent (vector, Qnil);
131 set_char_table_purpose (vector, purpose); 131 set_char_table_purpose (vector, purpose);
@@ -184,16 +184,13 @@ copy_sub_char_table (Lisp_Object table)
184Lisp_Object 184Lisp_Object
185copy_char_table (Lisp_Object table) 185copy_char_table (Lisp_Object table)
186{ 186{
187 Lisp_Object copy;
188 int size = PVSIZE (table); 187 int size = PVSIZE (table);
189 int i; 188 Lisp_Object copy = make_nil_vector (size);
190
191 copy = Fmake_vector (make_fixnum (size), Qnil);
192 XSETPVECTYPE (XVECTOR (copy), PVEC_CHAR_TABLE); 189 XSETPVECTYPE (XVECTOR (copy), PVEC_CHAR_TABLE);
193 set_char_table_defalt (copy, XCHAR_TABLE (table)->defalt); 190 set_char_table_defalt (copy, XCHAR_TABLE (table)->defalt);
194 set_char_table_parent (copy, XCHAR_TABLE (table)->parent); 191 set_char_table_parent (copy, XCHAR_TABLE (table)->parent);
195 set_char_table_purpose (copy, XCHAR_TABLE (table)->purpose); 192 set_char_table_purpose (copy, XCHAR_TABLE (table)->purpose);
196 for (i = 0; i < chartab_size[0]; i++) 193 for (int i = 0; i < chartab_size[0]; i++)
197 set_char_table_contents 194 set_char_table_contents
198 (copy, i, 195 (copy, i,
199 (SUB_CHAR_TABLE_P (XCHAR_TABLE (table)->contents[i]) 196 (SUB_CHAR_TABLE_P (XCHAR_TABLE (table)->contents[i])
@@ -201,7 +198,7 @@ copy_char_table (Lisp_Object table)
201 : XCHAR_TABLE (table)->contents[i])); 198 : XCHAR_TABLE (table)->contents[i]));
202 set_char_table_ascii (copy, char_table_ascii (copy)); 199 set_char_table_ascii (copy, char_table_ascii (copy));
203 size -= CHAR_TABLE_STANDARD_SLOTS; 200 size -= CHAR_TABLE_STANDARD_SLOTS;
204 for (i = 0; i < size; i++) 201 for (int i = 0; i < size; i++)
205 set_char_table_extras (copy, i, XCHAR_TABLE (table)->extras[i]); 202 set_char_table_extras (copy, i, XCHAR_TABLE (table)->extras[i]);
206 203
207 XSETCHAR_TABLE (copy, XCHAR_TABLE (copy)); 204 XSETCHAR_TABLE (copy, XCHAR_TABLE (copy));
@@ -1249,7 +1246,7 @@ uniprop_encode_value_numeric (Lisp_Object table, Lisp_Object value)
1249 set_char_table_extras (table, 4, 1246 set_char_table_extras (table, 4,
1250 CALLN (Fvconcat, 1247 CALLN (Fvconcat,
1251 XCHAR_TABLE (table)->extras[4], 1248 XCHAR_TABLE (table)->extras[4],
1252 Fmake_vector (make_fixnum (1), value))); 1249 make_vector (1, value)));
1253 return make_fixnum (i); 1250 return make_fixnum (i);
1254} 1251}
1255 1252
diff --git a/src/coding.c b/src/coding.c
index 0f715a2d7cd..398691fc864 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -10062,36 +10062,28 @@ DEFUN ("define-coding-system-internal", Fdefine_coding_system_internal,
10062usage: (define-coding-system-internal ...) */) 10062usage: (define-coding-system-internal ...) */)
10063 (ptrdiff_t nargs, Lisp_Object *args) 10063 (ptrdiff_t nargs, Lisp_Object *args)
10064{ 10064{
10065 Lisp_Object name;
10066 Lisp_Object spec_vec; /* [ ATTRS ALIASE EOL_TYPE ] */
10067 Lisp_Object attrs; /* Vector of attributes. */
10068 Lisp_Object eol_type;
10069 Lisp_Object aliases;
10070 Lisp_Object coding_type, charset_list, safe_charsets;
10071 enum coding_category category; 10065 enum coding_category category;
10072 Lisp_Object tail, val;
10073 int max_charset_id = 0; 10066 int max_charset_id = 0;
10074 int i;
10075 10067
10076 if (nargs < coding_arg_max) 10068 if (nargs < coding_arg_max)
10077 goto short_args; 10069 goto short_args;
10078 10070
10079 attrs = Fmake_vector (make_fixnum (coding_attr_last_index), Qnil); 10071 Lisp_Object attrs = make_nil_vector (coding_attr_last_index);
10080 10072
10081 name = args[coding_arg_name]; 10073 Lisp_Object name = args[coding_arg_name];
10082 CHECK_SYMBOL (name); 10074 CHECK_SYMBOL (name);
10083 ASET (attrs, coding_attr_base_name, name); 10075 ASET (attrs, coding_attr_base_name, name);
10084 10076
10085 val = args[coding_arg_mnemonic]; 10077 Lisp_Object val = args[coding_arg_mnemonic];
10086 if (! STRINGP (val)) 10078 if (! STRINGP (val))
10087 CHECK_CHARACTER (val); 10079 CHECK_CHARACTER (val);
10088 ASET (attrs, coding_attr_mnemonic, val); 10080 ASET (attrs, coding_attr_mnemonic, val);
10089 10081
10090 coding_type = args[coding_arg_coding_type]; 10082 Lisp_Object coding_type = args[coding_arg_coding_type];
10091 CHECK_SYMBOL (coding_type); 10083 CHECK_SYMBOL (coding_type);
10092 ASET (attrs, coding_attr_type, coding_type); 10084 ASET (attrs, coding_attr_type, coding_type);
10093 10085
10094 charset_list = args[coding_arg_charset_list]; 10086 Lisp_Object charset_list = args[coding_arg_charset_list];
10095 if (SYMBOLP (charset_list)) 10087 if (SYMBOLP (charset_list))
10096 { 10088 {
10097 if (EQ (charset_list, Qiso_2022)) 10089 if (EQ (charset_list, Qiso_2022))
@@ -10106,7 +10098,7 @@ usage: (define-coding-system-internal ...) */)
10106 error ("Invalid charset-list"); 10098 error ("Invalid charset-list");
10107 charset_list = Vemacs_mule_charset_list; 10099 charset_list = Vemacs_mule_charset_list;
10108 } 10100 }
10109 for (tail = charset_list; CONSP (tail); tail = XCDR (tail)) 10101 for (Lisp_Object tail = charset_list; CONSP (tail); tail = XCDR (tail))
10110 { 10102 {
10111 if (! RANGED_FIXNUMP (0, XCAR (tail), INT_MAX - 1)) 10103 if (! RANGED_FIXNUMP (0, XCAR (tail), INT_MAX - 1))
10112 error ("Invalid charset-list"); 10104 error ("Invalid charset-list");
@@ -10117,7 +10109,7 @@ usage: (define-coding-system-internal ...) */)
10117 else 10109 else
10118 { 10110 {
10119 charset_list = Fcopy_sequence (charset_list); 10111 charset_list = Fcopy_sequence (charset_list);
10120 for (tail = charset_list; CONSP (tail); tail = XCDR (tail)) 10112 for (Lisp_Object tail = charset_list; CONSP (tail); tail = XCDR (tail))
10121 { 10113 {
10122 struct charset *charset; 10114 struct charset *charset;
10123 10115
@@ -10138,9 +10130,9 @@ usage: (define-coding-system-internal ...) */)
10138 } 10130 }
10139 ASET (attrs, coding_attr_charset_list, charset_list); 10131 ASET (attrs, coding_attr_charset_list, charset_list);
10140 10132
10141 safe_charsets = make_uninit_string (max_charset_id + 1); 10133 Lisp_Object safe_charsets = make_uninit_string (max_charset_id + 1);
10142 memset (SDATA (safe_charsets), 255, max_charset_id + 1); 10134 memset (SDATA (safe_charsets), 255, max_charset_id + 1);
10143 for (tail = charset_list; CONSP (tail); tail = XCDR (tail)) 10135 for (Lisp_Object tail = charset_list; CONSP (tail); tail = XCDR (tail))
10144 SSET (safe_charsets, XFIXNAT (XCAR (tail)), 0); 10136 SSET (safe_charsets, XFIXNAT (XCAR (tail)), 0);
10145 ASET (attrs, coding_attr_safe_charsets, safe_charsets); 10137 ASET (attrs, coding_attr_safe_charsets, safe_charsets);
10146 10138
@@ -10194,9 +10186,9 @@ usage: (define-coding-system-internal ...) */)
10194 If Nth element is a list of charset IDs, N is the first byte 10186 If Nth element is a list of charset IDs, N is the first byte
10195 of one of them. The list is sorted by dimensions of the 10187 of one of them. The list is sorted by dimensions of the
10196 charsets. A charset of smaller dimension comes first. */ 10188 charsets. A charset of smaller dimension comes first. */
10197 val = Fmake_vector (make_fixnum (256), Qnil); 10189 val = make_nil_vector (256);
10198 10190
10199 for (tail = charset_list; CONSP (tail); tail = XCDR (tail)) 10191 for (Lisp_Object tail = charset_list; CONSP (tail); tail = XCDR (tail))
10200 { 10192 {
10201 struct charset *charset = CHARSET_FROM_ID (XFIXNAT (XCAR (tail))); 10193 struct charset *charset = CHARSET_FROM_ID (XFIXNAT (XCAR (tail)));
10202 int dim = CHARSET_DIMENSION (charset); 10194 int dim = CHARSET_DIMENSION (charset);
@@ -10205,7 +10197,7 @@ usage: (define-coding-system-internal ...) */)
10205 if (CHARSET_ASCII_COMPATIBLE_P (charset)) 10197 if (CHARSET_ASCII_COMPATIBLE_P (charset))
10206 ASET (attrs, coding_attr_ascii_compat, Qt); 10198 ASET (attrs, coding_attr_ascii_compat, Qt);
10207 10199
10208 for (i = charset->code_space[idx]; 10200 for (int i = charset->code_space[idx];
10209 i <= charset->code_space[idx + 1]; i++) 10201 i <= charset->code_space[idx + 1]; i++)
10210 { 10202 {
10211 Lisp_Object tmp, tmp2; 10203 Lisp_Object tmp, tmp2;
@@ -10265,7 +10257,7 @@ usage: (define-coding-system-internal ...) */)
10265 10257
10266 val = args[coding_arg_ccl_valids]; 10258 val = args[coding_arg_ccl_valids];
10267 valids = Fmake_string (make_fixnum (256), make_fixnum (0), Qnil); 10259 valids = Fmake_string (make_fixnum (256), make_fixnum (0), Qnil);
10268 for (tail = val; CONSP (tail); tail = XCDR (tail)) 10260 for (Lisp_Object tail = val; CONSP (tail); tail = XCDR (tail))
10269 { 10261 {
10270 int from, to; 10262 int from, to;
10271 10263
@@ -10290,7 +10282,7 @@ usage: (define-coding-system-internal ...) */)
10290 XCAR (val), make_fixnum (255)); 10282 XCAR (val), make_fixnum (255));
10291 to = XFIXNUM (XCDR (val)); 10283 to = XFIXNUM (XCDR (val));
10292 } 10284 }
10293 for (i = from; i <= to; i++) 10285 for (int i = from; i <= to; i++)
10294 SSET (valids, i, 1); 10286 SSET (valids, i, 1);
10295 } 10287 }
10296 ASET (attrs, coding_attr_ccl_valids, valids); 10288 ASET (attrs, coding_attr_ccl_valids, valids);
@@ -10344,7 +10336,7 @@ usage: (define-coding-system-internal ...) */)
10344 10336
10345 initial = Fcopy_sequence (args[coding_arg_iso2022_initial]); 10337 initial = Fcopy_sequence (args[coding_arg_iso2022_initial]);
10346 CHECK_VECTOR (initial); 10338 CHECK_VECTOR (initial);
10347 for (i = 0; i < 4; i++) 10339 for (int i = 0; i < 4; i++)
10348 { 10340 {
10349 val = AREF (initial, i); 10341 val = AREF (initial, i);
10350 if (! NILP (val)) 10342 if (! NILP (val))
@@ -10366,7 +10358,7 @@ usage: (define-coding-system-internal ...) */)
10366 CHECK_FIXNUM_CDR (reg_usage); 10358 CHECK_FIXNUM_CDR (reg_usage);
10367 10359
10368 request = Fcopy_sequence (args[coding_arg_iso2022_request]); 10360 request = Fcopy_sequence (args[coding_arg_iso2022_request]);
10369 for (tail = request; CONSP (tail); tail = XCDR (tail)) 10361 for (Lisp_Object tail = request; CONSP (tail); tail = XCDR (tail))
10370 { 10362 {
10371 int id; 10363 int id;
10372 Lisp_Object tmp1; 10364 Lisp_Object tmp1;
@@ -10377,13 +10369,14 @@ usage: (define-coding-system-internal ...) */)
10377 CHECK_CHARSET_GET_ID (tmp1, id); 10369 CHECK_CHARSET_GET_ID (tmp1, id);
10378 CHECK_FIXNAT_CDR (val); 10370 CHECK_FIXNAT_CDR (val);
10379 if (XFIXNUM (XCDR (val)) >= 4) 10371 if (XFIXNUM (XCDR (val)) >= 4)
10380 error ("Invalid graphic register number: %"pI"d", XFIXNUM (XCDR (val))); 10372 error ("Invalid graphic register number: %"pI"d",
10373 XFIXNUM (XCDR (val)));
10381 XSETCAR (val, make_fixnum (id)); 10374 XSETCAR (val, make_fixnum (id));
10382 } 10375 }
10383 10376
10384 flags = args[coding_arg_iso2022_flags]; 10377 flags = args[coding_arg_iso2022_flags];
10385 CHECK_FIXNAT (flags); 10378 CHECK_FIXNAT (flags);
10386 i = XFIXNUM (flags) & INT_MAX; 10379 int i = XFIXNUM (flags) & INT_MAX;
10387 if (EQ (args[coding_arg_charset_list], Qiso_2022)) 10380 if (EQ (args[coding_arg_charset_list], Qiso_2022))
10388 i |= CODING_ISO_FLAG_FULL_SUPPORT; 10381 i |= CODING_ISO_FLAG_FULL_SUPPORT;
10389 flags = make_fixnum (i); 10382 flags = make_fixnum (i);
@@ -10542,19 +10535,19 @@ usage: (define-coding-system-internal ...) */)
10542 Fcons (CODING_ATTR_ASCII_COMPAT (attrs), 10535 Fcons (CODING_ATTR_ASCII_COMPAT (attrs),
10543 CODING_ATTR_PLIST (attrs)))); 10536 CODING_ATTR_PLIST (attrs))));
10544 10537
10545 eol_type = args[coding_arg_eol_type]; 10538 Lisp_Object eol_type = args[coding_arg_eol_type];
10546 if (! NILP (eol_type) 10539 if (! NILP (eol_type)
10547 && ! EQ (eol_type, Qunix) 10540 && ! EQ (eol_type, Qunix)
10548 && ! EQ (eol_type, Qdos) 10541 && ! EQ (eol_type, Qdos)
10549 && ! EQ (eol_type, Qmac)) 10542 && ! EQ (eol_type, Qmac))
10550 error ("Invalid eol-type"); 10543 error ("Invalid eol-type");
10551 10544
10552 aliases = list1 (name); 10545 Lisp_Object aliases = list1 (name);
10553 10546
10554 if (NILP (eol_type)) 10547 if (NILP (eol_type))
10555 { 10548 {
10556 eol_type = make_subsidiaries (name); 10549 eol_type = make_subsidiaries (name);
10557 for (i = 0; i < 3; i++) 10550 for (int i = 0; i < 3; i++)
10558 { 10551 {
10559 Lisp_Object this_spec, this_name, this_aliases, this_eol_type; 10552 Lisp_Object this_spec, this_name, this_aliases, this_eol_type;
10560 10553
@@ -10575,7 +10568,7 @@ usage: (define-coding-system-internal ...) */)
10575 } 10568 }
10576 } 10569 }
10577 10570
10578 spec_vec = make_uninit_vector (3); 10571 Lisp_Object spec_vec = make_uninit_vector (3);
10579 ASET (spec_vec, 0, attrs); 10572 ASET (spec_vec, 0, attrs);
10580 ASET (spec_vec, 1, aliases); 10573 ASET (spec_vec, 1, aliases);
10581 ASET (spec_vec, 2, eol_type); 10574 ASET (spec_vec, 2, eol_type);
@@ -10587,12 +10580,9 @@ usage: (define-coding-system-internal ...) */)
10587 Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (name), Qnil), 10580 Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (name), Qnil),
10588 Vcoding_system_alist); 10581 Vcoding_system_alist);
10589 10582
10590 { 10583 int id = coding_categories[category].id;
10591 int id = coding_categories[category].id; 10584 if (id < 0 || EQ (name, CODING_ID_NAME (id)))
10592
10593 if (id < 0 || EQ (name, CODING_ID_NAME (id)))
10594 setup_coding_system (name, &coding_categories[category]); 10585 setup_coding_system (name, &coding_categories[category]);
10595 }
10596 10586
10597 return Qnil; 10587 return Qnil;
10598 10588
@@ -10915,8 +10905,7 @@ syms_of_coding (void)
10915 DEFSYM (QCpre_write_conversion, ":pre-write-conversion"); 10905 DEFSYM (QCpre_write_conversion, ":pre-write-conversion");
10916 DEFSYM (QCascii_compatible_p, ":ascii-compatible-p"); 10906 DEFSYM (QCascii_compatible_p, ":ascii-compatible-p");
10917 10907
10918 Vcoding_category_table 10908 Vcoding_category_table = make_nil_vector (coding_category_max);
10919 = Fmake_vector (make_fixnum (coding_category_max), Qnil);
10920 staticpro (&Vcoding_category_table); 10909 staticpro (&Vcoding_category_table);
10921 /* Followings are target of code detection. */ 10910 /* Followings are target of code detection. */
10922 ASET (Vcoding_category_table, coding_category_iso_7, 10911 ASET (Vcoding_category_table, coding_category_iso_7,
@@ -11220,7 +11209,7 @@ a coding system of ISO 2022 variant which has a flag
11220`accept-latin-extra-code' t (e.g. iso-latin-1) on reading a file 11209`accept-latin-extra-code' t (e.g. iso-latin-1) on reading a file
11221or reading output of a subprocess. 11210or reading output of a subprocess.
11222Only 128th through 159th elements have a meaning. */); 11211Only 128th through 159th elements have a meaning. */);
11223 Vlatin_extra_code_table = Fmake_vector (make_fixnum (256), Qnil); 11212 Vlatin_extra_code_table = make_nil_vector (256);
11224 11213
11225 DEFVAR_LISP ("select-safe-coding-system-function", 11214 DEFVAR_LISP ("select-safe-coding-system-function",
11226 Vselect_safe_coding_system_function, 11215 Vselect_safe_coding_system_function,
diff --git a/src/composite.c b/src/composite.c
index 39c54fcfab3..9819805c399 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -216,7 +216,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
216 COMPONENTS (converted to a vector COMPONENTS-VEC) or, if it is 216 COMPONENTS (converted to a vector COMPONENTS-VEC) or, if it is
217 nil, vector of characters in the composition range. */ 217 nil, vector of characters in the composition range. */
218 if (FIXNUMP (components)) 218 if (FIXNUMP (components))
219 key = Fmake_vector (make_fixnum (1), components); 219 key = make_vector (1, components);
220 else if (STRINGP (components) || CONSP (components)) 220 else if (STRINGP (components) || CONSP (components))
221 key = Fvconcat (1, &components); 221 key = Fvconcat (1, &components);
222 else if (VECTORP (components)) 222 else if (VECTORP (components))
@@ -654,27 +654,22 @@ Lisp_Object
654composition_gstring_put_cache (Lisp_Object gstring, ptrdiff_t len) 654composition_gstring_put_cache (Lisp_Object gstring, ptrdiff_t len)
655{ 655{
656 struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); 656 struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table);
657 EMACS_UINT hash; 657 Lisp_Object header = LGSTRING_HEADER (gstring);
658 Lisp_Object header, copy; 658 EMACS_UINT hash = h->test.hashfn (&h->test, header);
659 ptrdiff_t i;
660
661 header = LGSTRING_HEADER (gstring);
662 hash = h->test.hashfn (&h->test, header);
663 if (len < 0) 659 if (len < 0)
664 { 660 {
665 ptrdiff_t j, glyph_len = LGSTRING_GLYPH_LEN (gstring); 661 ptrdiff_t glyph_len = LGSTRING_GLYPH_LEN (gstring);
666 for (j = 0; j < glyph_len; j++) 662 for (len = 0; len < glyph_len; len++)
667 if (NILP (LGSTRING_GLYPH (gstring, j))) 663 if (NILP (LGSTRING_GLYPH (gstring, len)))
668 break; 664 break;
669 len = j;
670 } 665 }
671 666
672 copy = Fmake_vector (make_fixnum (len + 2), Qnil); 667 Lisp_Object copy = make_nil_vector (len + 2);
673 LGSTRING_SET_HEADER (copy, Fcopy_sequence (header)); 668 LGSTRING_SET_HEADER (copy, Fcopy_sequence (header));
674 for (i = 0; i < len; i++) 669 for (ptrdiff_t i = 0; i < len; i++)
675 LGSTRING_SET_GLYPH (copy, i, Fcopy_sequence (LGSTRING_GLYPH (gstring, i))); 670 LGSTRING_SET_GLYPH (copy, i, Fcopy_sequence (LGSTRING_GLYPH (gstring, i)));
676 i = hash_put (h, LGSTRING_HEADER (copy), copy, hash); 671 ptrdiff_t id = hash_put (h, LGSTRING_HEADER (copy), copy, hash);
677 LGSTRING_SET_ID (copy, make_fixnum (i)); 672 LGSTRING_SET_ID (copy, make_fixnum (id));
678 return copy; 673 return copy;
679} 674}
680 675
@@ -1759,7 +1754,7 @@ should be ignored. */)
1759 return gstring; 1754 return gstring;
1760 1755
1761 if (LGSTRING_GLYPH_LEN (gstring_work) < topos - frompos) 1756 if (LGSTRING_GLYPH_LEN (gstring_work) < topos - frompos)
1762 gstring_work = Fmake_vector (make_fixnum (topos - frompos + 2), Qnil); 1757 gstring_work = make_nil_vector (topos - frompos + 2);
1763 LGSTRING_SET_HEADER (gstring_work, header); 1758 LGSTRING_SET_HEADER (gstring_work, header);
1764 LGSTRING_SET_ID (gstring_work, Qnil); 1759 LGSTRING_SET_ID (gstring_work, Qnil);
1765 fill_gstring_body (gstring_work); 1760 fill_gstring_body (gstring_work);
@@ -1917,9 +1912,9 @@ syms_of_composite (void)
1917 staticpro (&gstring_work_headers); 1912 staticpro (&gstring_work_headers);
1918 gstring_work_headers = make_uninit_vector (8); 1913 gstring_work_headers = make_uninit_vector (8);
1919 for (i = 0; i < 8; i++) 1914 for (i = 0; i < 8; i++)
1920 ASET (gstring_work_headers, i, Fmake_vector (make_fixnum (i + 2), Qnil)); 1915 ASET (gstring_work_headers, i, make_nil_vector (i + 2));
1921 staticpro (&gstring_work); 1916 staticpro (&gstring_work);
1922 gstring_work = Fmake_vector (make_fixnum (10), Qnil); 1917 gstring_work = make_nil_vector (10);
1923 1918
1924 /* Text property `composition' should be nonsticky by default. */ 1919 /* Text property `composition' should be nonsticky by default. */
1925 Vtext_property_default_nonsticky 1920 Vtext_property_default_nonsticky
diff --git a/src/composite.h b/src/composite.h
index 8039113d872..ad39a08dca3 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -274,7 +274,7 @@ enum lglyph_indices
274 LGLYPH_SIZE 274 LGLYPH_SIZE
275 }; 275 };
276 276
277#define LGLYPH_NEW() Fmake_vector (make_fixnum (LGLYPH_SIZE), Qnil) 277#define LGLYPH_NEW() make_nil_vector (LGLYPH_SIZE)
278#define LGLYPH_FROM(g) XFIXNUM (AREF ((g), LGLYPH_IX_FROM)) 278#define LGLYPH_FROM(g) XFIXNUM (AREF ((g), LGLYPH_IX_FROM))
279#define LGLYPH_TO(g) XFIXNUM (AREF ((g), LGLYPH_IX_TO)) 279#define LGLYPH_TO(g) XFIXNUM (AREF ((g), LGLYPH_IX_TO))
280#define LGLYPH_CHAR(g) XFIXNUM (AREF ((g), LGLYPH_IX_CHAR)) 280#define LGLYPH_CHAR(g) XFIXNUM (AREF ((g), LGLYPH_IX_CHAR))
diff --git a/src/dispnew.c b/src/dispnew.c
index 8742d584930..b628c694e85 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5938,7 +5938,7 @@ pass nil for VARIABLE. */)
5938 || n + 20 < ASIZE (state) / 2) 5938 || n + 20 < ASIZE (state) / 2)
5939 /* Add 20 extra so we grow it less often. */ 5939 /* Add 20 extra so we grow it less often. */
5940 { 5940 {
5941 state = Fmake_vector (make_fixnum (n + 20), Qlambda); 5941 state = make_vector (n + 20, Qlambda);
5942 if (! NILP (variable)) 5942 if (! NILP (variable))
5943 Fset (variable, state); 5943 Fset (variable, state);
5944 else 5944 else
@@ -6236,7 +6236,7 @@ syms_of_display (void)
6236 defsubr (&Sdump_redisplay_history); 6236 defsubr (&Sdump_redisplay_history);
6237#endif 6237#endif
6238 6238
6239 frame_and_buffer_state = Fmake_vector (make_fixnum (20), Qlambda); 6239 frame_and_buffer_state = make_vector (20, Qlambda);
6240 staticpro (&frame_and_buffer_state); 6240 staticpro (&frame_and_buffer_state);
6241 6241
6242 /* This is the "purpose" slot of a display table. */ 6242 /* This is the "purpose" slot of a display table. */
diff --git a/src/fns.c b/src/fns.c
index c9a6dd6de1e..9ef9601e062 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -732,7 +732,7 @@ concat (ptrdiff_t nargs, Lisp_Object *args,
732 if (target_type == Lisp_Cons) 732 if (target_type == Lisp_Cons)
733 val = Fmake_list (make_fixnum (result_len), Qnil); 733 val = Fmake_list (make_fixnum (result_len), Qnil);
734 else if (target_type == Lisp_Vectorlike) 734 else if (target_type == Lisp_Vectorlike)
735 val = Fmake_vector (make_fixnum (result_len), Qnil); 735 val = make_nil_vector (result_len);
736 else if (some_multibyte) 736 else if (some_multibyte)
737 val = make_uninit_multibyte_string (result_len, result_len_byte); 737 val = make_uninit_multibyte_string (result_len, result_len_byte);
738 else 738 else
@@ -3127,7 +3127,7 @@ The data read from the system are decoded using `locale-coding-system'. */)
3127#ifdef DAY_1 3127#ifdef DAY_1
3128 else if (EQ (item, Qdays)) /* e.g. for calendar-day-name-array */ 3128 else if (EQ (item, Qdays)) /* e.g. for calendar-day-name-array */
3129 { 3129 {
3130 Lisp_Object v = Fmake_vector (make_fixnum (7), Qnil); 3130 Lisp_Object v = make_nil_vector (7);
3131 const int days[7] = {DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7}; 3131 const int days[7] = {DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7};
3132 int i; 3132 int i;
3133 synchronize_system_time_locale (); 3133 synchronize_system_time_locale ();
@@ -3146,12 +3146,11 @@ The data read from the system are decoded using `locale-coding-system'. */)
3146#ifdef MON_1 3146#ifdef MON_1
3147 else if (EQ (item, Qmonths)) /* e.g. for calendar-month-name-array */ 3147 else if (EQ (item, Qmonths)) /* e.g. for calendar-month-name-array */
3148 { 3148 {
3149 Lisp_Object v = Fmake_vector (make_fixnum (12), Qnil); 3149 Lisp_Object v = make_nil_vector (12);
3150 const int months[12] = {MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7, 3150 const int months[12] = {MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7,
3151 MON_8, MON_9, MON_10, MON_11, MON_12}; 3151 MON_8, MON_9, MON_10, MON_11, MON_12};
3152 int i;
3153 synchronize_system_time_locale (); 3152 synchronize_system_time_locale ();
3154 for (i = 0; i < 12; i++) 3153 for (int i = 0; i < 12; i++)
3155 { 3154 {
3156 str = nl_langinfo (months[i]); 3155 str = nl_langinfo (months[i]);
3157 AUTO_STRING (val, str); 3156 AUTO_STRING (val, str);
@@ -3987,10 +3986,10 @@ make_hash_table (struct hash_table_test test, EMACS_INT size,
3987 h->rehash_threshold = rehash_threshold; 3986 h->rehash_threshold = rehash_threshold;
3988 h->rehash_size = rehash_size; 3987 h->rehash_size = rehash_size;
3989 h->count = 0; 3988 h->count = 0;
3990 h->key_and_value = Fmake_vector (make_fixnum (2 * size), Qnil); 3989 h->key_and_value = make_nil_vector (2 * size);
3991 h->hash = Fmake_vector (make_fixnum (size), Qnil); 3990 h->hash = make_nil_vector (size);
3992 h->next = Fmake_vector (make_fixnum (size), make_fixnum (-1)); 3991 h->next = make_vector (size, make_fixnum (-1));
3993 h->index = Fmake_vector (make_fixnum (index_size), make_fixnum (-1)); 3992 h->index = make_vector (index_size, make_fixnum (-1));
3994 h->pure = pure; 3993 h->pure = pure;
3995 3994
3996 /* Set up the free list. */ 3995 /* Set up the free list. */
@@ -4085,8 +4084,7 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
4085 set_hash_key_and_value (h, larger_vector (h->key_and_value, 4084 set_hash_key_and_value (h, larger_vector (h->key_and_value,
4086 2 * (new_size - old_size), -1)); 4085 2 * (new_size - old_size), -1));
4087 set_hash_hash (h, larger_vector (h->hash, new_size - old_size, -1)); 4086 set_hash_hash (h, larger_vector (h->hash, new_size - old_size, -1));
4088 set_hash_index (h, Fmake_vector (make_fixnum (index_size), 4087 set_hash_index (h, make_vector (index_size, make_fixnum (-1)));
4089 make_fixnum (-1)));
4090 set_hash_next (h, larger_vecalloc (h->next, new_size - old_size, -1)); 4088 set_hash_next (h, larger_vecalloc (h->next, new_size - old_size, -1));
4091 4089
4092 /* Update the free list. Do it so that new entries are added at 4090 /* Update the free list. Do it so that new entries are added at
diff --git a/src/font.c b/src/font.c
index 799d5db205c..e81c267de41 100644
--- a/src/font.c
+++ b/src/font.c
@@ -374,10 +374,10 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val,
374 if (! noerror) 374 if (! noerror)
375 return -1; 375 return -1;
376 eassert (len < 255); 376 eassert (len < 255);
377 elt = Fmake_vector (make_fixnum (2), make_fixnum (100)); 377 elt = make_vector (2, make_fixnum (100));
378 ASET (elt, 1, val); 378 ASET (elt, 1, val);
379 ASET (font_style_table, prop - FONT_WEIGHT_INDEX, 379 ASET (font_style_table, prop - FONT_WEIGHT_INDEX,
380 CALLN (Fvconcat, table, Fmake_vector (make_fixnum (1), elt))); 380 CALLN (Fvconcat, table, make_vector (1, elt)));
381 return (100 << 8) | (i << 4); 381 return (100 << 8) | (i << 4);
382 } 382 }
383 else 383 else
@@ -2035,7 +2035,7 @@ font_otf_DeviceTable (OTF_DeviceTable *device_table)
2035Lisp_Object 2035Lisp_Object
2036font_otf_ValueRecord (int value_format, OTF_ValueRecord *value_record) 2036font_otf_ValueRecord (int value_format, OTF_ValueRecord *value_record)
2037{ 2037{
2038 Lisp_Object val = Fmake_vector (make_fixnum (8), Qnil); 2038 Lisp_Object val = make_nil_vector (8);
2039 2039
2040 if (value_format & OTF_XPlacement) 2040 if (value_format & OTF_XPlacement)
2041 ASET (val, 0, make_fixnum (value_record->XPlacement)); 2041 ASET (val, 0, make_fixnum (value_record->XPlacement));
@@ -2059,9 +2059,7 @@ font_otf_ValueRecord (int value_format, OTF_ValueRecord *value_record)
2059Lisp_Object 2059Lisp_Object
2060font_otf_Anchor (OTF_Anchor *anchor) 2060font_otf_Anchor (OTF_Anchor *anchor)
2061{ 2061{
2062 Lisp_Object val; 2062 Lisp_Object val = make_nil_vector (anchor->AnchorFormat + 1);
2063
2064 val = Fmake_vector (make_fixnum (anchor->AnchorFormat + 1), Qnil);
2065 ASET (val, 0, make_fixnum (anchor->XCoordinate)); 2063 ASET (val, 0, make_fixnum (anchor->XCoordinate));
2066 ASET (val, 1, make_fixnum (anchor->YCoordinate)); 2064 ASET (val, 1, make_fixnum (anchor->YCoordinate));
2067 if (anchor->AnchorFormat == 2) 2065 if (anchor->AnchorFormat == 2)
@@ -5170,14 +5168,13 @@ If the named font is not yet loaded, return nil. */)
5170static Lisp_Object 5168static Lisp_Object
5171build_style_table (const struct table_entry *entry, int nelement) 5169build_style_table (const struct table_entry *entry, int nelement)
5172{ 5170{
5173 int i, j; 5171 Lisp_Object table = make_uninit_vector (nelement);
5174 Lisp_Object table, elt; 5172 for (int i = 0; i < nelement; i++)
5175
5176 table = make_uninit_vector (nelement);
5177 for (i = 0; i < nelement; i++)
5178 { 5173 {
5179 for (j = 0; entry[i].names[j]; j++); 5174 int j;
5180 elt = Fmake_vector (make_fixnum (j + 1), Qnil); 5175 for (j = 0; entry[i].names[j]; j++)
5176 continue;
5177 Lisp_Object elt = make_nil_vector (j + 1);
5181 ASET (elt, 0, make_fixnum (entry[i].numeric)); 5178 ASET (elt, 0, make_fixnum (entry[i].numeric));
5182 for (j = 0; entry[i].names[j]; j++) 5179 for (j = 0; entry[i].names[j]; j++)
5183 ASET (elt, j + 1, intern_c_string (entry[i].names[j])); 5180 ASET (elt, j + 1, intern_c_string (entry[i].names[j]));
@@ -5359,7 +5356,7 @@ syms_of_font (void)
5359 scratch_font_prefer = Ffont_spec (0, NULL); 5356 scratch_font_prefer = Ffont_spec (0, NULL);
5360 5357
5361 staticpro (&Vfont_log_deferred); 5358 staticpro (&Vfont_log_deferred);
5362 Vfont_log_deferred = Fmake_vector (make_fixnum (3), Qnil); 5359 Vfont_log_deferred = make_nil_vector (3);
5363 5360
5364#if 0 5361#if 0
5365#ifdef HAVE_LIBOTF 5362#ifdef HAVE_LIBOTF
diff --git a/src/fontset.c b/src/fontset.c
index 1f877eb606a..07f42331170 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -281,10 +281,10 @@ set_fontset_fallback (Lisp_Object fontset, Lisp_Object fallback)
281 ASET ((rfont_def), 3, make_fixnum (score)) 281 ASET ((rfont_def), 3, make_fixnum (score))
282#define RFONT_DEF_NEW(rfont_def, font_def) \ 282#define RFONT_DEF_NEW(rfont_def, font_def) \
283 do { \ 283 do { \
284 (rfont_def) = Fmake_vector (make_fixnum (4), Qnil); \ 284 (rfont_def) = make_nil_vector (4); \
285 ASET ((rfont_def), 1, (font_def)); \ 285 ASET (rfont_def, 1, font_def); \
286 RFONT_DEF_SET_SCORE ((rfont_def), 0); \ 286 RFONT_DEF_SET_SCORE (rfont_def, 0); \
287 } while (0) 287 } while (false)
288 288
289 289
290/* Return the element of FONTSET for the character C. If FONTSET is a 290/* Return the element of FONTSET for the character C. If FONTSET is a
@@ -327,11 +327,8 @@ fontset_ref (Lisp_Object fontset, int c)
327#define FONTSET_ADD(fontset, range, elt, add) \ 327#define FONTSET_ADD(fontset, range, elt, add) \
328 (NILP (add) \ 328 (NILP (add) \
329 ? (NILP (range) \ 329 ? (NILP (range) \
330 ? (set_fontset_fallback \ 330 ? set_fontset_fallback (fontset, make_vector (1, elt)) \
331 (fontset, Fmake_vector (make_fixnum (1), (elt)))) \ 331 : (void) Fset_char_table_range (fontset, range, make_vector (1, elt))) \
332 : ((void) \
333 Fset_char_table_range (fontset, range, \
334 Fmake_vector (make_fixnum (1), elt)))) \
335 : fontset_add ((fontset), (range), (elt), (add))) 332 : fontset_add ((fontset), (range), (elt), (add)))
336 333
337static void 334static void
@@ -340,7 +337,7 @@ fontset_add (Lisp_Object fontset, Lisp_Object range, Lisp_Object elt, Lisp_Objec
340 Lisp_Object args[2]; 337 Lisp_Object args[2];
341 int idx = (EQ (add, Qappend) ? 0 : 1); 338 int idx = (EQ (add, Qappend) ? 0 : 1);
342 339
343 args[1 - idx] = Fmake_vector (make_fixnum (1), elt); 340 args[1 - idx] = make_vector (1, elt);
344 341
345 if (CONSP (range)) 342 if (CONSP (range))
346 { 343 {
@@ -701,7 +698,6 @@ fontset_find_font (Lisp_Object fontset, int c, struct face *face,
701 { 698 {
702 /* We found a font. Open it and insert a new element for 699 /* We found a font. Open it and insert a new element for
703 that font in VEC. */ 700 that font in VEC. */
704 Lisp_Object new_vec;
705 int j; 701 int j;
706 702
707 font_object = font_open_for_lface (f, font_entity, face->lface, 703 font_object = font_open_for_lface (f, font_entity, face->lface,
@@ -711,7 +707,7 @@ fontset_find_font (Lisp_Object fontset, int c, struct face *face,
711 RFONT_DEF_NEW (rfont_def, font_def); 707 RFONT_DEF_NEW (rfont_def, font_def);
712 RFONT_DEF_SET_OBJECT (rfont_def, font_object); 708 RFONT_DEF_SET_OBJECT (rfont_def, font_object);
713 RFONT_DEF_SET_SCORE (rfont_def, RFONT_DEF_SCORE (rfont_def)); 709 RFONT_DEF_SET_SCORE (rfont_def, RFONT_DEF_SCORE (rfont_def));
714 new_vec = Fmake_vector (make_fixnum (ASIZE (vec) + 1), Qnil); 710 Lisp_Object new_vec = make_nil_vector (ASIZE (vec) + 1);
715 found_index++; 711 found_index++;
716 for (j = 0; j < found_index; j++) 712 for (j = 0; j < found_index; j++)
717 ASET (new_vec, j, AREF (vec, j)); 713 ASET (new_vec, j, AREF (vec, j));
@@ -2062,9 +2058,7 @@ Lisp_Object dump_fontset (Lisp_Object) EXTERNALLY_VISIBLE;
2062Lisp_Object 2058Lisp_Object
2063dump_fontset (Lisp_Object fontset) 2059dump_fontset (Lisp_Object fontset)
2064{ 2060{
2065 Lisp_Object vec; 2061 Lisp_Object vec = make_nil_vector (3);
2066
2067 vec = Fmake_vector (make_fixnum (3), Qnil);
2068 ASET (vec, 0, FONTSET_ID (fontset)); 2062 ASET (vec, 0, FONTSET_ID (fontset));
2069 2063
2070 if (BASE_FONTSET_P (fontset)) 2064 if (BASE_FONTSET_P (fontset))
@@ -2122,7 +2116,7 @@ syms_of_fontset (void)
2122 Vcached_fontset_data = Qnil; 2116 Vcached_fontset_data = Qnil;
2123 staticpro (&Vcached_fontset_data); 2117 staticpro (&Vcached_fontset_data);
2124 2118
2125 Vfontset_table = Fmake_vector (make_fixnum (32), Qnil); 2119 Vfontset_table = make_nil_vector (32);
2126 staticpro (&Vfontset_table); 2120 staticpro (&Vfontset_table);
2127 2121
2128 Vdefault_fontset = Fmake_char_table (Qfontset, Qnil); 2122 Vdefault_fontset = Fmake_char_table (Qfontset, Qnil);
diff --git a/src/image.c b/src/image.c
index 633d66e7a70..b54cd763272 100644
--- a/src/image.c
+++ b/src/image.c
@@ -4028,7 +4028,7 @@ xpm_make_color_table_v (void (**put_func) (Lisp_Object, const char *, int,
4028{ 4028{
4029 *put_func = xpm_put_color_table_v; 4029 *put_func = xpm_put_color_table_v;
4030 *get_func = xpm_get_color_table_v; 4030 *get_func = xpm_get_color_table_v;
4031 return Fmake_vector (make_fixnum (256), Qnil); 4031 return make_nil_vector (256);
4032} 4032}
4033 4033
4034static void 4034static void
diff --git a/src/json.c b/src/json.c
index e5c0dc22179..770b63c1da2 100644
--- a/src/json.c
+++ b/src/json.c
@@ -817,7 +817,7 @@ json_to_lisp (json_t *json, struct json_configuration *conf)
817 size_t size = json_array_size (json); 817 size_t size = json_array_size (json);
818 if (FIXNUM_OVERFLOW_P (size)) 818 if (FIXNUM_OVERFLOW_P (size))
819 overflow_error (); 819 overflow_error ();
820 Lisp_Object result = Fmake_vector (make_fixed_natnum (size), Qunbound); 820 Lisp_Object result = make_vector (size, Qunbound);
821 for (ptrdiff_t i = 0; i < size; ++i) 821 for (ptrdiff_t i = 0; i < size; ++i)
822 ASET (result, i, 822 ASET (result, i,
823 json_to_lisp (json_array_get (json, i), conf)); 823 json_to_lisp (json_array_get (json, i), conf));
diff --git a/src/keyboard.c b/src/keyboard.c
index 59acb2dd083..baf2f514409 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -6448,12 +6448,7 @@ modify_event_symbol (ptrdiff_t symbol_num, int modifiers, Lisp_Object symbol_kin
6448 { 6448 {
6449 if (! VECTORP (*symbol_table) 6449 if (! VECTORP (*symbol_table)
6450 || ASIZE (*symbol_table) != table_size) 6450 || ASIZE (*symbol_table) != table_size)
6451 { 6451 *symbol_table = make_nil_vector (table_size);
6452 Lisp_Object size;
6453
6454 XSETFASTINT (size, table_size);
6455 *symbol_table = Fmake_vector (size, Qnil);
6456 }
6457 6452
6458 value = AREF (*symbol_table, symbol_num); 6453 value = AREF (*symbol_table, symbol_num);
6459 } 6454 }
@@ -7362,7 +7357,7 @@ menu_bar_items (Lisp_Object old)
7362 if (!NILP (old)) 7357 if (!NILP (old))
7363 menu_bar_items_vector = old; 7358 menu_bar_items_vector = old;
7364 else 7359 else
7365 menu_bar_items_vector = Fmake_vector (make_fixnum (24), Qnil); 7360 menu_bar_items_vector = make_nil_vector (24);
7366 menu_bar_items_index = 0; 7361 menu_bar_items_index = 0;
7367 7362
7368 /* Build our list of keymaps. 7363 /* Build our list of keymaps.
@@ -7605,8 +7600,7 @@ parse_menu_item (Lisp_Object item, int inmenubar)
7605 7600
7606 /* Create item_properties vector if necessary. */ 7601 /* Create item_properties vector if necessary. */
7607 if (NILP (item_properties)) 7602 if (NILP (item_properties))
7608 item_properties 7603 item_properties = make_nil_vector (ITEM_PROPERTY_ENABLE + 1);
7609 = Fmake_vector (make_fixnum (ITEM_PROPERTY_ENABLE + 1), Qnil);
7610 7604
7611 /* Initialize optional entries. */ 7605 /* Initialize optional entries. */
7612 for (i = ITEM_PROPERTY_DEF; i < ITEM_PROPERTY_ENABLE; i++) 7606 for (i = ITEM_PROPERTY_DEF; i < ITEM_PROPERTY_ENABLE; i++)
@@ -8100,8 +8094,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8100 set_prop (i, Qnil); 8094 set_prop (i, Qnil);
8101 } 8095 }
8102 else 8096 else
8103 tool_bar_item_properties 8097 tool_bar_item_properties = make_nil_vector (TOOL_BAR_ITEM_NSLOTS);
8104 = Fmake_vector (make_fixnum (TOOL_BAR_ITEM_NSLOTS), Qnil);
8105 8098
8106 /* Set defaults. */ 8099 /* Set defaults. */
8107 set_prop (TOOL_BAR_ITEM_KEY, key); 8100 set_prop (TOOL_BAR_ITEM_KEY, key);
@@ -8296,7 +8289,7 @@ init_tool_bar_items (Lisp_Object reuse)
8296 if (VECTORP (reuse)) 8289 if (VECTORP (reuse))
8297 tool_bar_items_vector = reuse; 8290 tool_bar_items_vector = reuse;
8298 else 8291 else
8299 tool_bar_items_vector = Fmake_vector (make_fixnum (64), Qnil); 8292 tool_bar_items_vector = make_nil_vector (64);
8300 ntool_bar_items = 0; 8293 ntool_bar_items = 0;
8301} 8294}
8302 8295
@@ -11184,32 +11177,31 @@ syms_of_keyboard (void)
11184 } 11177 }
11185 } 11178 }
11186 11179
11187 button_down_location = Fmake_vector (make_fixnum (5), Qnil); 11180 button_down_location = make_nil_vector (5);
11188 staticpro (&button_down_location); 11181 staticpro (&button_down_location);
11189 mouse_syms = Fmake_vector (make_fixnum (5), Qnil); 11182 mouse_syms = make_nil_vector (5);
11190 staticpro (&mouse_syms); 11183 staticpro (&mouse_syms);
11191 wheel_syms = Fmake_vector (make_fixnum (ARRAYELTS (lispy_wheel_names)), 11184 wheel_syms = make_nil_vector (ARRAYELTS (lispy_wheel_names));
11192 Qnil);
11193 staticpro (&wheel_syms); 11185 staticpro (&wheel_syms);
11194 11186
11195 { 11187 {
11196 int i; 11188 int i;
11197 int len = ARRAYELTS (modifier_names); 11189 int len = ARRAYELTS (modifier_names);
11198 11190
11199 modifier_symbols = Fmake_vector (make_fixnum (len), Qnil); 11191 modifier_symbols = make_nil_vector (len);
11200 for (i = 0; i < len; i++) 11192 for (i = 0; i < len; i++)
11201 if (modifier_names[i]) 11193 if (modifier_names[i])
11202 ASET (modifier_symbols, i, intern_c_string (modifier_names[i])); 11194 ASET (modifier_symbols, i, intern_c_string (modifier_names[i]));
11203 staticpro (&modifier_symbols); 11195 staticpro (&modifier_symbols);
11204 } 11196 }
11205 11197
11206 recent_keys = Fmake_vector (make_fixnum (NUM_RECENT_KEYS), Qnil); 11198 recent_keys = make_nil_vector (NUM_RECENT_KEYS);
11207 staticpro (&recent_keys); 11199 staticpro (&recent_keys);
11208 11200
11209 this_command_keys = Fmake_vector (make_fixnum (40), Qnil); 11201 this_command_keys = make_nil_vector (40);
11210 staticpro (&this_command_keys); 11202 staticpro (&this_command_keys);
11211 11203
11212 raw_keybuf = Fmake_vector (make_fixnum (30), Qnil); 11204 raw_keybuf = make_nil_vector (30);
11213 staticpro (&raw_keybuf); 11205 staticpro (&raw_keybuf);
11214 11206
11215 DEFSYM (Qcommand_execute, "command-execute"); 11207 DEFSYM (Qcommand_execute, "command-execute");
diff --git a/src/keymap.c b/src/keymap.c
index 3a79bf4c5aa..a1c9eb6c10e 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1093,7 +1093,7 @@ binding KEY to DEF is added at the front of KEYMAP. */)
1093 1093
1094 if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, 0))) 1094 if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, 0)))
1095 { /* DEF is apparently an XEmacs-style keyboard macro. */ 1095 { /* DEF is apparently an XEmacs-style keyboard macro. */
1096 Lisp_Object tmp = Fmake_vector (make_fixnum (ASIZE (def)), Qnil); 1096 Lisp_Object tmp = make_nil_vector (ASIZE (def));
1097 ptrdiff_t i = ASIZE (def); 1097 ptrdiff_t i = ASIZE (def);
1098 while (--i >= 0) 1098 while (--i >= 0)
1099 { 1099 {
@@ -1931,14 +1931,12 @@ then the value includes only maps for prefixes that start with PREFIX. */)
1931 we don't have to deal with the possibility of a string. */ 1931 we don't have to deal with the possibility of a string. */
1932 if (STRINGP (prefix)) 1932 if (STRINGP (prefix))
1933 { 1933 {
1934 int i, i_byte, c; 1934 ptrdiff_t i_byte = 0;
1935 Lisp_Object copy; 1935 Lisp_Object copy = make_nil_vector (SCHARS (prefix));
1936 1936 for (ptrdiff_t i = 0; i < SCHARS (prefix); )
1937 copy = Fmake_vector (make_fixnum (SCHARS (prefix)), Qnil);
1938 for (i = 0, i_byte = 0; i < SCHARS (prefix);)
1939 { 1937 {
1940 int i_before = i; 1938 ptrdiff_t i_before = i;
1941 1939 int c;
1942 FETCH_STRING_CHAR_ADVANCE (c, prefix, i, i_byte); 1940 FETCH_STRING_CHAR_ADVANCE (c, prefix, i, i_byte);
1943 if (SINGLE_BYTE_CHAR_P (c) && (c & 0200)) 1941 if (SINGLE_BYTE_CHAR_P (c) && (c & 0200))
1944 c ^= 0200 | meta_modifier; 1942 c ^= 0200 | meta_modifier;
@@ -3141,7 +3139,7 @@ describe_map (Lisp_Object map, Lisp_Object prefix,
3141 /* This vector gets used to present single keys to Flookup_key. Since 3139 /* This vector gets used to present single keys to Flookup_key. Since
3142 that is done once per keymap element, we don't want to cons up a 3140 that is done once per keymap element, we don't want to cons up a
3143 fresh vector every time. */ 3141 fresh vector every time. */
3144 kludge = Fmake_vector (make_fixnum (1), Qnil); 3142 kludge = make_nil_vector (1);
3145 definition = Qnil; 3143 definition = Qnil;
3146 3144
3147 map = call1 (Qkeymap_canonicalize, map); 3145 map = call1 (Qkeymap_canonicalize, map);
@@ -3390,7 +3388,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3390 /* This vector gets used to present single keys to Flookup_key. Since 3388 /* This vector gets used to present single keys to Flookup_key. Since
3391 that is done once per vector element, we don't want to cons up a 3389 that is done once per vector element, we don't want to cons up a
3392 fresh vector every time. */ 3390 fresh vector every time. */
3393 kludge = Fmake_vector (make_fixnum (1), Qnil); 3391 kludge = make_nil_vector (1);
3394 3392
3395 if (partial) 3393 if (partial)
3396 suppress = intern ("suppress-keymap"); 3394 suppress = intern ("suppress-keymap");
@@ -3690,7 +3688,7 @@ be preferred. */);
3690 DEFSYM (Qremap, "remap"); 3688 DEFSYM (Qremap, "remap");
3691 DEFSYM (QCadvertised_binding, ":advertised-binding"); 3689 DEFSYM (QCadvertised_binding, ":advertised-binding");
3692 3690
3693 command_remapping_vector = Fmake_vector (make_fixnum (2), Qremap); 3691 command_remapping_vector = make_vector (2, Qremap);
3694 staticpro (&command_remapping_vector); 3692 staticpro (&command_remapping_vector);
3695 3693
3696 where_is_cache_keymaps = Qt; 3694 where_is_cache_keymaps = Qt;
diff --git a/src/lisp.h b/src/lisp.h
index 77b8b63e196..3943bf63ee7 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3694,6 +3694,7 @@ build_string (const char *str)
3694} 3694}
3695 3695
3696extern Lisp_Object pure_cons (Lisp_Object, Lisp_Object); 3696extern Lisp_Object pure_cons (Lisp_Object, Lisp_Object);
3697extern Lisp_Object make_vector (ptrdiff_t, Lisp_Object);
3697extern void make_byte_code (struct Lisp_Vector *); 3698extern void make_byte_code (struct Lisp_Vector *);
3698extern struct Lisp_Vector *allocate_vector (ptrdiff_t); 3699extern struct Lisp_Vector *allocate_vector (ptrdiff_t);
3699 3700
@@ -3726,6 +3727,16 @@ make_uninit_sub_char_table (int depth, int min_char)
3726 return v; 3727 return v;
3727} 3728}
3728 3729
3730/* Make a vector of SIZE nils. */
3731
3732INLINE Lisp_Object
3733make_nil_vector (ptrdiff_t size)
3734{
3735 Lisp_Object vec = make_uninit_vector (size);
3736 memclear (XVECTOR (vec)->contents, size * word_size);
3737 return vec;
3738}
3739
3729extern struct Lisp_Vector *allocate_pseudovector (int, int, int, 3740extern struct Lisp_Vector *allocate_pseudovector (int, int, int,
3730 enum pvec_type); 3741 enum pvec_type);
3731 3742
diff --git a/src/lread.c b/src/lread.c
index 5f3871436df..4c6b7673228 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3846,23 +3846,17 @@ string_to_number (char const *string, int base, ptrdiff_t *plen)
3846static Lisp_Object 3846static Lisp_Object
3847read_vector (Lisp_Object readcharfun, bool bytecodeflag) 3847read_vector (Lisp_Object readcharfun, bool bytecodeflag)
3848{ 3848{
3849 ptrdiff_t i, size; 3849 Lisp_Object tem = read_list (1, readcharfun);
3850 Lisp_Object *ptr; 3850 Lisp_Object len = Flength (tem);
3851 Lisp_Object tem, item, vector; 3851 ptrdiff_t size = XFIXNAT (len);
3852 struct Lisp_Cons *otem; 3852 if (bytecodeflag && size <= COMPILED_STACK_DEPTH)
3853 Lisp_Object len;
3854
3855 tem = read_list (1, readcharfun);
3856 len = Flength (tem);
3857 if (bytecodeflag && XFIXNAT (len) <= COMPILED_STACK_DEPTH)
3858 error ("Invalid byte code"); 3853 error ("Invalid byte code");
3859 vector = Fmake_vector (len, Qnil); 3854 Lisp_Object vector = make_nil_vector (size);
3860 3855
3861 size = XFIXNAT (len); 3856 Lisp_Object *ptr = XVECTOR (vector)->contents;
3862 ptr = XVECTOR (vector)->contents; 3857 for (ptrdiff_t i = 0; i < size; i++)
3863 for (i = 0; i < size; i++)
3864 { 3858 {
3865 item = Fcar (tem); 3859 Lisp_Object item = Fcar (tem);
3866 /* If `load-force-doc-strings' is t when reading a lazily-loaded 3860 /* If `load-force-doc-strings' is t when reading a lazily-loaded
3867 bytecode object, the docstring containing the bytecode and 3861 bytecode object, the docstring containing the bytecode and
3868 constants values must be treated as unibyte and passed to 3862 constants values must be treated as unibyte and passed to
@@ -3896,7 +3890,7 @@ read_vector (Lisp_Object readcharfun, bool bytecodeflag)
3896 if (!CONSP (item)) 3890 if (!CONSP (item))
3897 error ("Invalid byte code"); 3891 error ("Invalid byte code");
3898 3892
3899 otem = XCONS (item); 3893 struct Lisp_Cons *otem = XCONS (item);
3900 bytestr = XCAR (item); 3894 bytestr = XCAR (item);
3901 item = XCDR (item); 3895 item = XCDR (item);
3902 free_cons (otem); 3896 free_cons (otem);
@@ -3916,7 +3910,7 @@ read_vector (Lisp_Object readcharfun, bool bytecodeflag)
3916 } 3910 }
3917 } 3911 }
3918 ASET (vector, i, item); 3912 ASET (vector, i, item);
3919 otem = XCONS (tem); 3913 struct Lisp_Cons *otem = XCONS (tem);
3920 tem = Fcdr (tem); 3914 tem = Fcdr (tem);
3921 free_cons (otem); 3915 free_cons (otem);
3922 } 3916 }
@@ -4383,7 +4377,7 @@ OBARRAY defaults to the value of `obarray'. */)
4383void 4377void
4384init_obarray (void) 4378init_obarray (void)
4385{ 4379{
4386 Vobarray = Fmake_vector (make_fixnum (OBARRAY_SIZE), make_fixnum (0)); 4380 Vobarray = make_vector (OBARRAY_SIZE, make_fixnum (0));
4387 initial_obarray = Vobarray; 4381 initial_obarray = Vobarray;
4388 staticpro (&initial_obarray); 4382 staticpro (&initial_obarray);
4389 4383
diff --git a/src/macfont.m b/src/macfont.m
index c9a1edaec8b..d137648937c 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -2992,7 +2992,7 @@ macfont_shape (Lisp_Object lgstring)
2992 2992
2993 if (NILP (lglyph)) 2993 if (NILP (lglyph))
2994 { 2994 {
2995 lglyph = Fmake_vector (make_fixnum (LGLYPH_SIZE), Qnil); 2995 lglyph = make_nil_vector (LGLYPH_SIZE);
2996 LGSTRING_SET_GLYPH (lgstring, i, lglyph); 2996 LGSTRING_SET_GLYPH (lgstring, i, lglyph);
2997 } 2997 }
2998 2998
@@ -3044,9 +3044,7 @@ macfont_shape (Lisp_Object lgstring)
3044 wadjust = lround (gl->advance); 3044 wadjust = lround (gl->advance);
3045 if (xoff != 0 || yoff != 0 || wadjust != metrics.width) 3045 if (xoff != 0 || yoff != 0 || wadjust != metrics.width)
3046 { 3046 {
3047 Lisp_Object vec; 3047 Lisp_Object vec = make_uninit_vector (3);
3048
3049 vec = Fmake_vector (make_fixnum (3), Qnil);
3050 ASET (vec, 0, make_fixnum (xoff)); 3048 ASET (vec, 0, make_fixnum (xoff));
3051 ASET (vec, 1, make_fixnum (yoff)); 3049 ASET (vec, 1, make_fixnum (yoff));
3052 ASET (vec, 2, make_fixnum (wadjust)); 3050 ASET (vec, 2, make_fixnum (wadjust));
diff --git a/src/menu.c b/src/menu.c
index d75a8424a56..53272f91757 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -86,7 +86,7 @@ init_menu_items (void)
86 if (NILP (menu_items)) 86 if (NILP (menu_items))
87 { 87 {
88 menu_items_allocated = 60; 88 menu_items_allocated = 60;
89 menu_items = Fmake_vector (make_fixnum (menu_items_allocated), Qnil); 89 menu_items = make_nil_vector (menu_items_allocated);
90 } 90 }
91 91
92 menu_items_inuse = Qt; 92 menu_items_inuse = Qt;
diff --git a/src/nsfns.m b/src/nsfns.m
index 659bce8fc57..0ca97431eae 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2476,7 +2476,7 @@ ns_make_monitor_attribute_list (struct MonitorInfo *monitors,
2476 int primary_monitor, 2476 int primary_monitor,
2477 const char *source) 2477 const char *source)
2478{ 2478{
2479 Lisp_Object monitor_frames = Fmake_vector (make_fixnum (n_monitors), Qnil); 2479 Lisp_Object monitor_frames = make_nil_vector (n_monitors);
2480 Lisp_Object frame, rest; 2480 Lisp_Object frame, rest;
2481 NSArray *screens = [NSScreen screens]; 2481 NSArray *screens = [NSScreen screens];
2482 int i; 2482 int i;
diff --git a/src/process.c b/src/process.c
index 7e78e172d36..8e0b2349f9d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2492,7 +2492,6 @@ Lisp_Object
2492conv_sockaddr_to_lisp (struct sockaddr *sa, ptrdiff_t len) 2492conv_sockaddr_to_lisp (struct sockaddr *sa, ptrdiff_t len)
2493{ 2493{
2494 Lisp_Object address; 2494 Lisp_Object address;
2495 ptrdiff_t i;
2496 unsigned char *cp; 2495 unsigned char *cp;
2497 struct Lisp_Vector *p; 2496 struct Lisp_Vector *p;
2498 2497
@@ -2508,7 +2507,7 @@ conv_sockaddr_to_lisp (struct sockaddr *sa, ptrdiff_t len)
2508 { 2507 {
2509 DECLARE_POINTER_ALIAS (sin, struct sockaddr_in, sa); 2508 DECLARE_POINTER_ALIAS (sin, struct sockaddr_in, sa);
2510 len = sizeof (sin->sin_addr) + 1; 2509 len = sizeof (sin->sin_addr) + 1;
2511 address = Fmake_vector (make_fixnum (len), Qnil); 2510 address = make_uninit_vector (len);
2512 p = XVECTOR (address); 2511 p = XVECTOR (address);
2513 p->contents[--len] = make_fixnum (ntohs (sin->sin_port)); 2512 p->contents[--len] = make_fixnum (ntohs (sin->sin_port));
2514 cp = (unsigned char *) &sin->sin_addr; 2513 cp = (unsigned char *) &sin->sin_addr;
@@ -2520,10 +2519,10 @@ conv_sockaddr_to_lisp (struct sockaddr *sa, ptrdiff_t len)
2520 DECLARE_POINTER_ALIAS (sin6, struct sockaddr_in6, sa); 2519 DECLARE_POINTER_ALIAS (sin6, struct sockaddr_in6, sa);
2521 DECLARE_POINTER_ALIAS (ip6, uint16_t, &sin6->sin6_addr); 2520 DECLARE_POINTER_ALIAS (ip6, uint16_t, &sin6->sin6_addr);
2522 len = sizeof (sin6->sin6_addr) / 2 + 1; 2521 len = sizeof (sin6->sin6_addr) / 2 + 1;
2523 address = Fmake_vector (make_fixnum (len), Qnil); 2522 address = make_uninit_vector (len);
2524 p = XVECTOR (address); 2523 p = XVECTOR (address);
2525 p->contents[--len] = make_fixnum (ntohs (sin6->sin6_port)); 2524 p->contents[--len] = make_fixnum (ntohs (sin6->sin6_port));
2526 for (i = 0; i < len; i++) 2525 for (ptrdiff_t i = 0; i < len; i++)
2527 p->contents[i] = make_fixnum (ntohs (ip6[i])); 2526 p->contents[i] = make_fixnum (ntohs (ip6[i]));
2528 return address; 2527 return address;
2529 } 2528 }
@@ -2552,16 +2551,14 @@ conv_sockaddr_to_lisp (struct sockaddr *sa, ptrdiff_t len)
2552#endif 2551#endif
2553 default: 2552 default:
2554 len -= offsetof (struct sockaddr, sa_family) + sizeof (sa->sa_family); 2553 len -= offsetof (struct sockaddr, sa_family) + sizeof (sa->sa_family);
2555 address = Fcons (make_fixnum (sa->sa_family), 2554 address = Fcons (make_fixnum (sa->sa_family), make_nil_vector (len));
2556 Fmake_vector (make_fixnum (len), Qnil));
2557 p = XVECTOR (XCDR (address)); 2555 p = XVECTOR (XCDR (address));
2558 cp = (unsigned char *) &sa->sa_family + sizeof (sa->sa_family); 2556 cp = (unsigned char *) &sa->sa_family + sizeof (sa->sa_family);
2559 break; 2557 break;
2560 } 2558 }
2561 2559
2562 i = 0; 2560 for (ptrdiff_t i = 0; i < len; i++)
2563 while (i < len) 2561 p->contents[i] = make_fixnum (*cp++);
2564 p->contents[i++] = make_fixnum (*cp++);
2565 2562
2566 return address; 2563 return address;
2567} 2564}
@@ -4363,7 +4360,7 @@ network_interface_info (Lisp_Object ifname)
4363 Lisp_Object res = Qnil; 4360 Lisp_Object res = Qnil;
4364 Lisp_Object elt; 4361 Lisp_Object elt;
4365 int s; 4362 int s;
4366 bool any = 0; 4363 bool any = false;
4367 ptrdiff_t count; 4364 ptrdiff_t count;
4368#if (! (defined SIOCGIFHWADDR && defined HAVE_STRUCT_IFREQ_IFR_HWADDR) \ 4365#if (! (defined SIOCGIFHWADDR && defined HAVE_STRUCT_IFREQ_IFR_HWADDR) \
4369 && defined HAVE_GETIFADDRS && defined LLADDR) 4366 && defined HAVE_GETIFADDRS && defined LLADDR)
@@ -4396,7 +4393,7 @@ network_interface_info (Lisp_Object ifname)
4396 if (flags < 0 && sizeof (rq.ifr_flags) < sizeof (flags)) 4393 if (flags < 0 && sizeof (rq.ifr_flags) < sizeof (flags))
4397 flags = (unsigned short) rq.ifr_flags; 4394 flags = (unsigned short) rq.ifr_flags;
4398 4395
4399 any = 1; 4396 any = true;
4400 for (fp = ifflag_table; flags != 0 && fp->flag_sym; fp++) 4397 for (fp = ifflag_table; flags != 0 && fp->flag_sym; fp++)
4401 { 4398 {
4402 if (flags & fp->flag_bit) 4399 if (flags & fp->flag_bit)
@@ -4420,12 +4417,11 @@ network_interface_info (Lisp_Object ifname)
4420#if defined (SIOCGIFHWADDR) && defined (HAVE_STRUCT_IFREQ_IFR_HWADDR) 4417#if defined (SIOCGIFHWADDR) && defined (HAVE_STRUCT_IFREQ_IFR_HWADDR)
4421 if (ioctl (s, SIOCGIFHWADDR, &rq) == 0) 4418 if (ioctl (s, SIOCGIFHWADDR, &rq) == 0)
4422 { 4419 {
4423 Lisp_Object hwaddr = Fmake_vector (make_fixnum (6), Qnil); 4420 Lisp_Object hwaddr = make_uninit_vector (6);
4424 register struct Lisp_Vector *p = XVECTOR (hwaddr); 4421 struct Lisp_Vector *p = XVECTOR (hwaddr);
4425 int n;
4426 4422
4427 any = 1; 4423 any = true;
4428 for (n = 0; n < 6; n++) 4424 for (int n = 0; n < 6; n++)
4429 p->contents[n] = make_fixnum (((unsigned char *) 4425 p->contents[n] = make_fixnum (((unsigned char *)
4430 &rq.ifr_hwaddr.sa_data[0]) 4426 &rq.ifr_hwaddr.sa_data[0])
4431 [n]); 4427 [n]);
@@ -4434,11 +4430,10 @@ network_interface_info (Lisp_Object ifname)
4434#elif defined (HAVE_GETIFADDRS) && defined (LLADDR) 4430#elif defined (HAVE_GETIFADDRS) && defined (LLADDR)
4435 if (getifaddrs (&ifap) != -1) 4431 if (getifaddrs (&ifap) != -1)
4436 { 4432 {
4437 Lisp_Object hwaddr = Fmake_vector (make_fixnum (6), Qnil); 4433 Lisp_Object hwaddr = make_nil_vector (6);
4438 register struct Lisp_Vector *p = XVECTOR (hwaddr); 4434 struct Lisp_Vector *p = XVECTOR (hwaddr);
4439 struct ifaddrs *it;
4440 4435
4441 for (it = ifap; it != NULL; it = it->ifa_next) 4436 for (struct ifaddrs *it = ifap; it != NULL; it = it->ifa_next)
4442 { 4437 {
4443 DECLARE_POINTER_ALIAS (sdl, struct sockaddr_dl, it->ifa_addr); 4438 DECLARE_POINTER_ALIAS (sdl, struct sockaddr_dl, it->ifa_addr);
4444 unsigned char linkaddr[6]; 4439 unsigned char linkaddr[6];
@@ -4466,10 +4461,12 @@ network_interface_info (Lisp_Object ifname)
4466 res = Fcons (elt, res); 4461 res = Fcons (elt, res);
4467 4462
4468 elt = Qnil; 4463 elt = Qnil;
4469#if defined (SIOCGIFNETMASK) && (defined (HAVE_STRUCT_IFREQ_IFR_NETMASK) || defined (HAVE_STRUCT_IFREQ_IFR_ADDR)) 4464#if (defined SIOCGIFNETMASK \
4465 && (defined HAVE_STRUCT_IFREQ_IFR_NETMASK \
4466 || defined HAVE_STRUCT_IFREQ_IFR_ADDR))
4470 if (ioctl (s, SIOCGIFNETMASK, &rq) == 0) 4467 if (ioctl (s, SIOCGIFNETMASK, &rq) == 0)
4471 { 4468 {
4472 any = 1; 4469 any = true;
4473#ifdef HAVE_STRUCT_IFREQ_IFR_NETMASK 4470#ifdef HAVE_STRUCT_IFREQ_IFR_NETMASK
4474 elt = conv_sockaddr_to_lisp (&rq.ifr_netmask, sizeof (rq.ifr_netmask)); 4471 elt = conv_sockaddr_to_lisp (&rq.ifr_netmask, sizeof (rq.ifr_netmask));
4475#else 4472#else
@@ -4483,8 +4480,8 @@ network_interface_info (Lisp_Object ifname)
4483#if defined (SIOCGIFBRDADDR) && defined (HAVE_STRUCT_IFREQ_IFR_BROADADDR) 4480#if defined (SIOCGIFBRDADDR) && defined (HAVE_STRUCT_IFREQ_IFR_BROADADDR)
4484 if (ioctl (s, SIOCGIFBRDADDR, &rq) == 0) 4481 if (ioctl (s, SIOCGIFBRDADDR, &rq) == 0)
4485 { 4482 {
4486 any = 1; 4483 any = true;
4487 elt = conv_sockaddr_to_lisp (&rq.ifr_broadaddr, sizeof (rq.ifr_broadaddr)); 4484 elt = conv_sockaddr_to_lisp (&rq.ifr_broadaddr, sizeof rq.ifr_broadaddr);
4488 } 4485 }
4489#endif 4486#endif
4490 res = Fcons (elt, res); 4487 res = Fcons (elt, res);
@@ -4493,7 +4490,7 @@ network_interface_info (Lisp_Object ifname)
4493#if defined (SIOCGIFADDR) && defined (HAVE_STRUCT_IFREQ_IFR_ADDR) 4490#if defined (SIOCGIFADDR) && defined (HAVE_STRUCT_IFREQ_IFR_ADDR)
4494 if (ioctl (s, SIOCGIFADDR, &rq) == 0) 4491 if (ioctl (s, SIOCGIFADDR, &rq) == 0)
4495 { 4492 {
4496 any = 1; 4493 any = true;
4497 elt = conv_sockaddr_to_lisp (&rq.ifr_addr, sizeof (rq.ifr_addr)); 4494 elt = conv_sockaddr_to_lisp (&rq.ifr_addr, sizeof (rq.ifr_addr));
4498 } 4495 }
4499#endif 4496#endif
diff --git a/src/profiler.c b/src/profiler.c
index 7330f8861fc..6d97107c9f5 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -54,8 +54,7 @@ make_log (EMACS_INT heap_size, EMACS_INT max_stack_depth)
54 with the vectors we'll put in them. */ 54 with the vectors we'll put in them. */
55 ptrdiff_t i = ASIZE (h->key_and_value) >> 1; 55 ptrdiff_t i = ASIZE (h->key_and_value) >> 1;
56 while (i > 0) 56 while (i > 0)
57 set_hash_key_slot (h, --i, 57 set_hash_key_slot (h, --i, make_nil_vector (max_stack_depth));
58 Fmake_vector (make_fixnum (max_stack_depth), Qnil));
59 return log; 58 return log;
60} 59}
61 60
@@ -422,7 +421,7 @@ Before returning, a new log is allocated for future samples. */)
422 cpu_log = (profiler_cpu_running 421 cpu_log = (profiler_cpu_running
423 ? make_log (profiler_log_size, profiler_max_stack_depth) 422 ? make_log (profiler_log_size, profiler_max_stack_depth)
424 : Qnil); 423 : Qnil);
425 Fputhash (Fmake_vector (make_fixnum (1), QAutomatic_GC), 424 Fputhash (make_vector (1, QAutomatic_GC),
426 make_fixnum (cpu_gc_count), 425 make_fixnum (cpu_gc_count),
427 result); 426 result);
428 cpu_gc_count = 0; 427 cpu_gc_count = 0;
diff --git a/src/term.c b/src/term.c
index 852dc23bd60..34659083ac3 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1359,8 +1359,7 @@ term_get_fkeys_1 (void)
1359 char *sequence = tgetstr (keys[i].cap, address); 1359 char *sequence = tgetstr (keys[i].cap, address);
1360 if (sequence) 1360 if (sequence)
1361 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence), 1361 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence),
1362 Fmake_vector (make_fixnum (1), 1362 make_vector (1, intern (keys[i].name)));
1363 intern (keys[i].name)));
1364 } 1363 }
1365 1364
1366 /* The uses of the "k0" capability are inconsistent; sometimes it 1365 /* The uses of the "k0" capability are inconsistent; sometimes it
@@ -1379,13 +1378,13 @@ term_get_fkeys_1 (void)
1379 /* Define f0 first, so that f10 takes precedence in case the 1378 /* Define f0 first, so that f10 takes precedence in case the
1380 key sequences happens to be the same. */ 1379 key sequences happens to be the same. */
1381 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0), 1380 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0),
1382 Fmake_vector (make_fixnum (1), intern ("f0"))); 1381 make_vector (1, intern ("f0")));
1383 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k_semi), 1382 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k_semi),
1384 Fmake_vector (make_fixnum (1), intern ("f10"))); 1383 make_vector (1, intern ("f10")));
1385 } 1384 }
1386 else if (k0) 1385 else if (k0)
1387 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0), 1386 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (k0),
1388 Fmake_vector (make_fixnum (1), intern (k0_name))); 1387 make_vector (1, intern (k0_name)));
1389 } 1388 }
1390 1389
1391 /* Set up cookies for numbered function keys above f10. */ 1390 /* Set up cookies for numbered function keys above f10. */
@@ -1408,8 +1407,7 @@ term_get_fkeys_1 (void)
1408 { 1407 {
1409 sprintf (fkey, "f%d", i); 1408 sprintf (fkey, "f%d", i);
1410 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence), 1409 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence),
1411 Fmake_vector (make_fixnum (1), 1410 make_vector (1, intern (fkey)));
1412 intern (fkey)));
1413 } 1411 }
1414 } 1412 }
1415 } 1413 }
@@ -1425,8 +1423,7 @@ term_get_fkeys_1 (void)
1425 char *sequence = tgetstr (cap2, address); \ 1423 char *sequence = tgetstr (cap2, address); \
1426 if (sequence) \ 1424 if (sequence) \
1427 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence), \ 1425 Fdefine_key (KVAR (kboard, Vinput_decode_map), build_string (sequence), \
1428 Fmake_vector (make_fixnum (1), \ 1426 make_vector (1, intern (sym))); \
1429 intern (sym))); \
1430 } 1427 }
1431 1428
1432 /* if there's no key_next keycap, map key_npage to `next' keysym */ 1429 /* if there's no key_next keycap, map key_npage to `next' keysym */
diff --git a/src/window.c b/src/window.c
index 31e9782b4a8..9da77ffc972 100644
--- a/src/window.c
+++ b/src/window.c
@@ -7044,8 +7044,7 @@ saved by this function. */)
7044 tem = make_uninit_vector (n_windows); 7044 tem = make_uninit_vector (n_windows);
7045 data->saved_windows = tem; 7045 data->saved_windows = tem;
7046 for (i = 0; i < n_windows; i++) 7046 for (i = 0; i < n_windows; i++)
7047 ASET (tem, i, 7047 ASET (tem, i, make_nil_vector (VECSIZE (struct saved_window)));
7048 Fmake_vector (make_fixnum (VECSIZE (struct saved_window)), Qnil));
7049 save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0); 7048 save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0);
7050 XSETWINDOW_CONFIGURATION (tem, data); 7049 XSETWINDOW_CONFIGURATION (tem, data);
7051 return (tem); 7050 return (tem);
diff --git a/src/xdisp.c b/src/xdisp.c
index 9a0752f2671..4d9990cf46c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10977,7 +10977,7 @@ with_echo_area_buffer_unwind_data (struct window *w)
10977 Vwith_echo_area_save_vector = Qnil; 10977 Vwith_echo_area_save_vector = Qnil;
10978 10978
10979 if (NILP (vector)) 10979 if (NILP (vector))
10980 vector = Fmake_vector (make_fixnum (11), Qnil); 10980 vector = make_nil_vector (11);
10981 10981
10982 XSETBUFFER (tmp, current_buffer); ASET (vector, i, tmp); ++i; 10982 XSETBUFFER (tmp, current_buffer); ASET (vector, i, tmp); ++i;
10983 ASET (vector, i, Vdeactivate_mark); ++i; 10983 ASET (vector, i, Vdeactivate_mark); ++i;
@@ -11850,7 +11850,7 @@ format_mode_line_unwind_data (struct frame *target_frame,
11850 Vmode_line_unwind_vector = Qnil; 11850 Vmode_line_unwind_vector = Qnil;
11851 11851
11852 if (NILP (vector)) 11852 if (NILP (vector))
11853 vector = Fmake_vector (make_fixnum (10), Qnil); 11853 vector = make_nil_vector (10);
11854 11854
11855 ASET (vector, 0, make_fixnum (mode_line_target)); 11855 ASET (vector, 0, make_fixnum (mode_line_target));
11856 ASET (vector, 1, make_fixnum (MODE_LINE_NOPROP_LEN (0))); 11856 ASET (vector, 1, make_fixnum (MODE_LINE_NOPROP_LEN (0)));
diff --git a/src/xfaces.c b/src/xfaces.c
index 76b23a31278..11feaecd1c3 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -2615,8 +2615,7 @@ Value is a vector of face attributes. */)
2615 /* Add a global definition if there is none. */ 2615 /* Add a global definition if there is none. */
2616 if (NILP (global_lface)) 2616 if (NILP (global_lface))
2617 { 2617 {
2618 global_lface = Fmake_vector (make_fixnum (LFACE_VECTOR_SIZE), 2618 global_lface = make_vector (LFACE_VECTOR_SIZE, Qunspecified);
2619 Qunspecified);
2620 ASET (global_lface, 0, Qface); 2619 ASET (global_lface, 0, Qface);
2621 Vface_new_frame_defaults = Fcons (Fcons (face, global_lface), 2620 Vface_new_frame_defaults = Fcons (Fcons (face, global_lface),
2622 Vface_new_frame_defaults); 2621 Vface_new_frame_defaults);
@@ -2643,8 +2642,7 @@ Value is a vector of face attributes. */)
2643 { 2642 {
2644 if (NILP (lface)) 2643 if (NILP (lface))
2645 { 2644 {
2646 lface = Fmake_vector (make_fixnum (LFACE_VECTOR_SIZE), 2645 lface = make_vector (LFACE_VECTOR_SIZE, Qunspecified);
2647 Qunspecified);
2648 ASET (lface, 0, Qface); 2646 ASET (lface, 0, Qface);
2649 fset_face_alist (f, Fcons (Fcons (face, lface), f->face_alist)); 2647 fset_face_alist (f, Fcons (Fcons (face, lface), f->face_alist));
2650 } 2648 }
@@ -4775,9 +4773,7 @@ DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector,
4775 doc: /* Return a vector of face attributes corresponding to PLIST. */) 4773 doc: /* Return a vector of face attributes corresponding to PLIST. */)
4776 (Lisp_Object plist) 4774 (Lisp_Object plist)
4777{ 4775{
4778 Lisp_Object lface; 4776 Lisp_Object lface = make_vector (LFACE_VECTOR_SIZE, Qunspecified);
4779 lface = Fmake_vector (make_fixnum (LFACE_VECTOR_SIZE),
4780 Qunspecified);
4781 merge_face_ref (NULL, XFRAME (selected_frame), 4777 merge_face_ref (NULL, XFRAME (selected_frame),
4782 plist, XVECTOR (lface)->contents, 4778 plist, XVECTOR (lface)->contents,
4783 true, 0); 4779 true, 0);
diff --git a/src/xfns.c b/src/xfns.c
index c4cf59d9b27..de177bf4ad4 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4628,7 +4628,7 @@ x_make_monitor_attribute_list (struct MonitorInfo *monitors,
4628 struct x_display_info *dpyinfo, 4628 struct x_display_info *dpyinfo,
4629 const char *source) 4629 const char *source)
4630{ 4630{
4631 Lisp_Object monitor_frames = Fmake_vector (make_fixnum (n_monitors), Qnil); 4631 Lisp_Object monitor_frames = make_nil_vector (n_monitors);
4632 Lisp_Object frame, rest; 4632 Lisp_Object frame, rest;
4633 4633
4634 FOR_EACH_FRAME (rest, frame) 4634 FOR_EACH_FRAME (rest, frame)
@@ -4931,7 +4931,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
4931#endif 4931#endif
4932 n_monitors = gdk_screen_get_n_monitors (gscreen); 4932 n_monitors = gdk_screen_get_n_monitors (gscreen);
4933#endif 4933#endif
4934 monitor_frames = Fmake_vector (make_fixnum (n_monitors), Qnil); 4934 monitor_frames = make_nil_vector (n_monitors);
4935 monitors = xzalloc (n_monitors * sizeof *monitors); 4935 monitors = xzalloc (n_monitors * sizeof *monitors);
4936 4936
4937 FOR_EACH_FRAME (rest, frame) 4937 FOR_EACH_FRAME (rest, frame)
diff --git a/src/xfont.c b/src/xfont.c
index 73caa705890..02976f6c898 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -1101,6 +1101,6 @@ syms_of_xfont (void)
1101 staticpro (&xfont_scripts_cache); 1101 staticpro (&xfont_scripts_cache);
1102 xfont_scripts_cache = CALLN (Fmake_hash_table, QCtest, Qequal); 1102 xfont_scripts_cache = CALLN (Fmake_hash_table, QCtest, Qequal);
1103 staticpro (&xfont_scratch_props); 1103 staticpro (&xfont_scratch_props);
1104 xfont_scratch_props = Fmake_vector (make_fixnum (8), Qnil); 1104 xfont_scratch_props = make_nil_vector (8);
1105 register_font_driver (&xfont_driver, NULL); 1105 register_font_driver (&xfont_driver, NULL);
1106} 1106}
diff --git a/src/xselect.c b/src/xselect.c
index a87784fb4b1..e1f353b1b8a 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2474,7 +2474,7 @@ x_handle_dnd_message (struct frame *f, const XClientMessageEvent *event,
2474 data = (unsigned char *) idata; 2474 data = (unsigned char *) idata;
2475 } 2475 }
2476 2476
2477 vec = Fmake_vector (make_fixnum (4), Qnil); 2477 vec = make_nil_vector (4);
2478 ASET (vec, 0, SYMBOL_NAME (x_atom_to_symbol (FRAME_DISPLAY_INFO (f), 2478 ASET (vec, 0, SYMBOL_NAME (x_atom_to_symbol (FRAME_DISPLAY_INFO (f),
2479 event->message_type))); 2479 event->message_type)));
2480 ASET (vec, 1, frame); 2480 ASET (vec, 1, frame);
diff --git a/src/xwidget.c b/src/xwidget.c
index 791dad43c76..9229a821363 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -733,7 +733,7 @@ save_script_callback (struct xwidget *xw, Lisp_Object script, Lisp_Object fun)
733{ 733{
734 Lisp_Object cbs = xw->script_callbacks; 734 Lisp_Object cbs = xw->script_callbacks;
735 if (NILP (cbs)) 735 if (NILP (cbs))
736 xw->script_callbacks = cbs = Fmake_vector (make_fixnum (32), Qnil); 736 xw->script_callbacks = cbs = make_nil_vector (32);
737 737
738 /* Find first free index. */ 738 /* Find first free index. */
739 ptrdiff_t idx; 739 ptrdiff_t idx;