aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2016-12-06 15:25:54 -0800
committerPaul Eggert2016-12-06 15:26:11 -0800
commitc95270ad4b48204880ae10ec730eb121ffa14abe (patch)
tree1f14c9708a157112ed4cc2c176d7fe5233c4819b /src
parent38d0276ad122d1a7663ecca965506f85b4e29b7f (diff)
downloademacs-c95270ad4b48204880ae10ec730eb121ffa14abe.tar.gz
emacs-c95270ad4b48204880ae10ec730eb121ffa14abe.zip
Change two _Noreturn functions to return void
This is a bit clearer than _Noreturn functions that (do not) return a non-void type. * src/callproc.c (call_process) [MSDOS]: Use 'status' local to record status. (child_setup): Return CHILD_SETUP_TYPE. * src/data.c, src/lisp.h (wrong_type_argument): Return void. All callers changed. * src/lisp.h (CHILD_SETUP_TYPE): New macro.
Diffstat (limited to 'src')
-rw-r--r--src/callproc.c16
-rw-r--r--src/data.c4
-rw-r--r--src/lisp.h26
3 files changed, 26 insertions, 20 deletions
diff --git a/src/callproc.c b/src/callproc.c
index dc3ca4ac102..02db3483ff2 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -293,7 +293,6 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
293 Lisp_Object output_file = Qnil; 293 Lisp_Object output_file = Qnil;
294#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ 294#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
295 char *tempfile = NULL; 295 char *tempfile = NULL;
296 int pid;
297#else 296#else
298 sigset_t oldset; 297 sigset_t oldset;
299 pid_t pid; 298 pid_t pid;
@@ -538,11 +537,9 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
538 } 537 }
539 538
540#ifdef MSDOS /* MW, July 1993 */ 539#ifdef MSDOS /* MW, July 1993 */
541 /* Note that on MSDOS `child_setup' actually returns the child process 540 status = child_setup (filefd, fd_output, fd_error, new_argv, 0, current_dir);
542 exit status, not its PID, so assign it to status below. */
543 pid = child_setup (filefd, fd_output, fd_error, new_argv, 0, current_dir);
544 541
545 if (pid < 0) 542 if (status < 0)
546 { 543 {
547 child_errno = errno; 544 child_errno = errno;
548 unbind_to (count, Qnil); 545 unbind_to (count, Qnil);
@@ -551,7 +548,6 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
551 code_convert_string_norecord (build_string (strerror (child_errno)), 548 code_convert_string_norecord (build_string (strerror (child_errno)),
552 Vlocale_coding_system, 0); 549 Vlocale_coding_system, 0);
553 } 550 }
554 status = pid;
555 551
556 for (i = 0; i < CALLPROC_FDS; i++) 552 for (i = 0; i < CALLPROC_FDS; i++)
557 if (0 <= callproc_fd[i]) 553 if (0 <= callproc_fd[i])
@@ -1163,9 +1159,13 @@ exec_failed (char const *name, int err)
1163 CURRENT_DIR is an elisp string giving the path of the current 1159 CURRENT_DIR is an elisp string giving the path of the current
1164 directory the subprocess should have. Since we can't really signal 1160 directory the subprocess should have. Since we can't really signal
1165 a decent error from within the child, this should be verified as an 1161 a decent error from within the child, this should be verified as an
1166 executable directory by the parent. */ 1162 executable directory by the parent.
1163
1164 On GNUish hosts, either exec or return an error number.
1165 On MS-Windows, either return a pid or signal an error.
1166 On MS-DOS, either return an exit status or signal an error. */
1167 1167
1168int 1168CHILD_SETUP_TYPE
1169child_setup (int in, int out, int err, char **new_argv, bool set_pgrp, 1169child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
1170 Lisp_Object current_dir) 1170 Lisp_Object current_dir)
1171{ 1171{
diff --git a/src/data.c b/src/data.c
index eee2a52a37a..64cd8b23b46 100644
--- a/src/data.c
+++ b/src/data.c
@@ -138,7 +138,7 @@ wrong_length_argument (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3)
138 make_number (bool_vector_size (a3))); 138 make_number (bool_vector_size (a3)));
139} 139}
140 140
141Lisp_Object 141_Noreturn void
142wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value) 142wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value)
143{ 143{
144 /* If VALUE is not even a valid Lisp object, we'd want to abort here 144 /* If VALUE is not even a valid Lisp object, we'd want to abort here
@@ -2924,7 +2924,7 @@ float_arith_driver (double accum, ptrdiff_t argnum, enum arithop code,
2924 case Alogand: 2924 case Alogand:
2925 case Alogior: 2925 case Alogior:
2926 case Alogxor: 2926 case Alogxor:
2927 return wrong_type_argument (Qinteger_or_marker_p, val); 2927 wrong_type_argument (Qinteger_or_marker_p, val);
2928 case Amax: 2928 case Amax:
2929 if (!argnum || isnan (next) || next > accum) 2929 if (!argnum || isnan (next) || next > accum)
2930 accum = next; 2930 accum = next;
diff --git a/src/lisp.h b/src/lisp.h
index 7dd914542ed..3d39dc40dc2 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -309,7 +309,7 @@ error !;
309#define lisp_h_CHECK_NUMBER(x) CHECK_TYPE (INTEGERP (x), Qintegerp, x) 309#define lisp_h_CHECK_NUMBER(x) CHECK_TYPE (INTEGERP (x), Qintegerp, x)
310#define lisp_h_CHECK_SYMBOL(x) CHECK_TYPE (SYMBOLP (x), Qsymbolp, x) 310#define lisp_h_CHECK_SYMBOL(x) CHECK_TYPE (SYMBOLP (x), Qsymbolp, x)
311#define lisp_h_CHECK_TYPE(ok, predicate, x) \ 311#define lisp_h_CHECK_TYPE(ok, predicate, x) \
312 ((ok) ? (void) 0 : (void) wrong_type_argument (predicate, x)) 312 ((ok) ? (void) 0 : wrong_type_argument (predicate, x))
313#define lisp_h_CONSP(x) (XTYPE (x) == Lisp_Cons) 313#define lisp_h_CONSP(x) (XTYPE (x) == Lisp_Cons)
314#define lisp_h_EQ(x, y) (XLI (x) == XLI (y)) 314#define lisp_h_EQ(x, y) (XLI (x) == XLI (y))
315#define lisp_h_FLOATP(x) (XTYPE (x) == Lisp_Float) 315#define lisp_h_FLOATP(x) (XTYPE (x) == Lisp_Float)
@@ -599,7 +599,7 @@ extern Lisp_Object char_table_ref (Lisp_Object, int);
599extern void char_table_set (Lisp_Object, int, Lisp_Object); 599extern void char_table_set (Lisp_Object, int, Lisp_Object);
600 600
601/* Defined in data.c. */ 601/* Defined in data.c. */
602extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object); 602extern _Noreturn void wrong_type_argument (Lisp_Object, Lisp_Object);
603extern _Noreturn void wrong_choice (Lisp_Object, Lisp_Object); 603extern _Noreturn void wrong_choice (Lisp_Object, Lisp_Object);
604extern void notify_variable_watchers (Lisp_Object symbol, Lisp_Object newval, 604extern void notify_variable_watchers (Lisp_Object symbol, Lisp_Object newval,
605 Lisp_Object operation, Lisp_Object where); 605 Lisp_Object operation, Lisp_Object where);
@@ -1270,16 +1270,20 @@ XSETCDR (Lisp_Object c, Lisp_Object n)
1270INLINE Lisp_Object 1270INLINE Lisp_Object
1271CAR (Lisp_Object c) 1271CAR (Lisp_Object c)
1272{ 1272{
1273 return (CONSP (c) ? XCAR (c) 1273 if (CONSP (c))
1274 : NILP (c) ? Qnil 1274 return XCAR (c);
1275 : wrong_type_argument (Qlistp, c)); 1275 if (!NILP (c))
1276 wrong_type_argument (Qlistp, c);
1277 return Qnil;
1276} 1278}
1277INLINE Lisp_Object 1279INLINE Lisp_Object
1278CDR (Lisp_Object c) 1280CDR (Lisp_Object c)
1279{ 1281{
1280 return (CONSP (c) ? XCDR (c) 1282 if (CONSP (c))
1281 : NILP (c) ? Qnil 1283 return XCDR (c);
1282 : wrong_type_argument (Qlistp, c)); 1284 if (!NILP (c))
1285 wrong_type_argument (Qlistp, c);
1286 return Qnil;
1283} 1287}
1284 1288
1285/* Take the car or cdr of something whose type is not known. */ 1289/* Take the car or cdr of something whose type is not known. */
@@ -4223,9 +4227,11 @@ extern void setup_process_coding_systems (Lisp_Object);
4223 4227
4224/* Defined in callproc.c. */ 4228/* Defined in callproc.c. */
4225#ifndef DOS_NT 4229#ifndef DOS_NT
4226 _Noreturn 4230# define CHILD_SETUP_TYPE _Noreturn void
4231#else
4232# define CHILD_SETUP_TYPE int
4227#endif 4233#endif
4228extern int child_setup (int, int, int, char **, bool, Lisp_Object); 4234extern CHILD_SETUP_TYPE child_setup (int, int, int, char **, bool, Lisp_Object);
4229extern void init_callproc_1 (void); 4235extern void init_callproc_1 (void);
4230extern void init_callproc (void); 4236extern void init_callproc (void);
4231extern void set_initial_environment (void); 4237extern void set_initial_environment (void);