From cbe81f1d96ca482c15d583cfd4a196d38af87972 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 18 Feb 2011 12:37:30 -0500 Subject: [PATCH] * alloc.c (make_unibyte_string): Don't SET_UNIBYTE redundantly. * process.c (Fstart_process, Fmake_serial_process) (Fmake_network_process, server_accept_connection): Use empty_unibyte_string. --- src/ChangeLog | 6 ++++++ src/alloc.c | 1 - src/process.c | 16 ++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9839c7fcc98..dea7b2547fd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2011-02-18 Stefan Monnier + * process.c (Fstart_process, Fmake_serial_process) + (Fmake_network_process, server_accept_connection): + Use empty_unibyte_string. + + * alloc.c (make_unibyte_string): Don't SET_UNIBYTE redundantly. + * lread.c (Qdir_ok): New constant. (syms_of_lread): Initialize it. (openp): Don't ignore directories if the predicate returns dir-ok. diff --git a/src/alloc.c b/src/alloc.c index e8b8f45e9b1..d7006ca6bfd 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2301,7 +2301,6 @@ make_unibyte_string (const char *contents, EMACS_INT length) register Lisp_Object val; val = make_uninit_string (length); memcpy (SDATA (val), contents, length); - STRING_SET_UNIBYTE (val); return val; } diff --git a/src/process.c b/src/process.c index 4a145f7376a..210287a85f1 100644 --- a/src/process.c +++ b/src/process.c @@ -1660,9 +1660,9 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) } - XPROCESS (proc)->decoding_buf = make_uninit_string (0); + XPROCESS (proc)->decoding_buf = empty_unibyte_string; XPROCESS (proc)->decoding_carryover = 0; - XPROCESS (proc)->encoding_buf = make_uninit_string (0); + XPROCESS (proc)->encoding_buf = empty_unibyte_string; XPROCESS (proc)->inherit_coding_system_flag = !(NILP (buffer) || !inherit_process_coding_system); @@ -2918,9 +2918,9 @@ usage: (make-serial-process &rest ARGS) */) p->encode_coding_system = val; setup_process_coding_systems (proc); - p->decoding_buf = make_uninit_string (0); + p->decoding_buf = empty_unibyte_string; p->decoding_carryover = 0; - p->encoding_buf = make_uninit_string (0); + p->encoding_buf = empty_unibyte_string; p->inherit_coding_system_flag = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); @@ -3787,9 +3787,9 @@ usage: (make-network-process &rest ARGS) */) } setup_process_coding_systems (proc); - p->decoding_buf = make_uninit_string (0); + p->decoding_buf = empty_unibyte_string; p->decoding_carryover = 0; - p->encoding_buf = make_uninit_string (0); + p->encoding_buf = empty_unibyte_string; p->inherit_coding_system_flag = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); @@ -4364,9 +4364,9 @@ server_accept_connection (Lisp_Object server, int channel) p->encode_coding_system = ps->encode_coding_system; setup_process_coding_systems (proc); - p->decoding_buf = make_uninit_string (0); + p->decoding_buf = empty_unibyte_string; p->decoding_carryover = 0; - p->encoding_buf = make_uninit_string (0); + p->encoding_buf = empty_unibyte_string; p->inherit_coding_system_flag = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); -- 2.39.5