+2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ * bytecode.c, callint.c, callproc.c: Use bool for boolean.
+ * bytecode.c (exec_byte_code):
+ * callint.c (check_mark, Fcall_interactively):
+ * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
+ (getenv_internal, sync_process_alive, call_process_exited):
+ * lisp.h (USE_SAFE_ALLOCA):
+ Use bool for booleans, instead of int.
+ * lisp.h, process.h: Adjust prototypes to match above changes.
+ * callint.c (Fcall_interactively): Don't assume the mark's
+ offset fits in 'int'.
+
2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
* buffer.c, buffer.h: Use bool for boolean.
= {"", "point", "mark", "region-beginning", "region-end"};
static void
-check_mark (int for_region)
+check_mark (bool for_region)
{
Lisp_Object tem;
tem = Fmarker_buffer (BVAR (current_buffer, mark));
signed char *varies;
ptrdiff_t i, nargs;
- int foo;
- int arg_from_tty = 0;
+ ptrdiff_t mark;
+ bool arg_from_tty = 0;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
ptrdiff_t key_count;
- int record_then_fail = 0;
+ bool record_then_fail = 0;
Lisp_Object save_this_command, save_last_command;
Lisp_Object save_this_original_command, save_real_this_command;
goto have_prefix_arg;
case 'n': /* Read number from minibuffer. */
{
- int first = 1;
+ bool first = 1;
do
{
Lisp_Object str;
check_mark (1);
set_marker_both (point_marker, Qnil, PT, PT_BYTE);
/* visargs[i+1] = Qnil; */
- foo = marker_position (BVAR (current_buffer, mark));
+ mark = marker_position (BVAR (current_buffer, mark));
/* visargs[i] = Qnil; */
- args[i] = PT < foo ? point_marker : BVAR (current_buffer, mark);
+ args[i] = PT < mark ? point_marker : BVAR (current_buffer, mark);
varies[i] = 3;
- args[++i] = PT > foo ? point_marker : BVAR (current_buffer, mark);
+ args[++i] = PT > mark ? point_marker : BVAR (current_buffer, mark);
varies[i] = 4;
break;
/* True if we are about to fork off a synchronous process or if we
are waiting for it. */
-int synch_process_alive;
+bool synch_process_alive;
/* Nonzero => this is a string explaining death of synchronous subprocess. */
const char *synch_process_death;
On MSDOS, delete the temporary file on any kind of termination.
On Unix, kill the process and any children on termination by signal. */
-/* Nonzero if this is termination due to exit. */
-static int call_process_exited;
+/* True if this is termination due to exit. */
+static bool call_process_exited;
static Lisp_Object
call_process_kill (Lisp_Object fdpid)
(ptrdiff_t nargs, Lisp_Object *args)
{
Lisp_Object infile, buffer, current_dir, path, cleanup_info_tail;
- int display_p;
+ bool display_p;
int fd[2];
int filefd;
#define CALLPROC_BUFFER_SIZE_MIN (16 * 1024)
struct coding_system argument_coding; /* coding-system of arguments */
/* Set to the return value of Ffind_operation_coding_system. */
Lisp_Object coding_systems;
- int output_to_buffer = 1;
+ bool output_to_buffer = 1;
/* Qt denotes that Ffind_operation_coding_system is not yet called. */
coding_systems = Qt;
/* If arguments are supplied, we may have to encode them. */
if (nargs >= 5)
{
- int must_encode = 0;
+ bool must_encode = 0;
Lisp_Object coding_attrs;
for (i = 4; i < nargs; i++)
Lisp_Object volatile buffer_volatile = buffer;
Lisp_Object volatile coding_systems_volatile = coding_systems;
Lisp_Object volatile current_dir_volatile = current_dir;
- int volatile display_p_volatile = display_p;
+ bool volatile display_p_volatile = display_p;
+ bool volatile output_to_buffer_volatile = output_to_buffer;
+ bool volatile sa_must_free_volatile = sa_must_free;
int volatile fd1_volatile = fd1;
int volatile fd_error_volatile = fd_error;
int volatile fd_output_volatile = fd_output;
- int volatile output_to_buffer_volatile = output_to_buffer;
- int volatile sa_must_free_volatile = sa_must_free;
ptrdiff_t volatile sa_count_volatile = sa_count;
unsigned char const **volatile new_argv_volatile = new_argv;
if (output_to_buffer)
{
- register int nread;
- int first = 1;
+ int nread;
+ bool first = 1;
EMACS_INT total_read = 0;
int carryover = 0;
- int display_on_the_fly = display_p;
+ bool display_on_the_fly = display_p;
struct coding_system saved_coding;
saved_coding = process_coding;
add_env (char **env, char **new_env, char *string)
{
char **ep;
- int ok = 1;
+ bool ok = 1;
if (string == NULL)
return new_env;
Therefore, the superior process must save and restore the value
of environ around the vfork and the call to this function.
- SET_PGRP is nonzero if we should put the subprocess into a separate
- process group.
+ If SET_PGRP, put the subprocess into a separate process group.
CURRENT_DIR is an elisp string giving the path of the current
directory the subprocess should have. Since we can't really signal
executable directory by the parent. */
int
-child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, Lisp_Object current_dir)
+child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
+ Lisp_Object current_dir)
{
char **env;
char *pwd_var;
}
#endif /* not WINDOWSNT */
-static int
+static bool
getenv_internal_1 (const char *var, ptrdiff_t varlen, char **value,
ptrdiff_t *valuelen, Lisp_Object env)
{
return 0;
}
-static int
+static bool
getenv_internal (const char *var, ptrdiff_t varlen, char **value,
ptrdiff_t *valuelen, Lisp_Object frame)
{
#ifndef DOS_NT
_Noreturn
#endif
-extern int child_setup (int, int, int, char **, int, Lisp_Object);
+extern int child_setup (int, int, int, char **, bool, Lisp_Object);
extern void init_callproc_1 (void);
extern void init_callproc (void);
extern void set_initial_environment (void);
extern void *record_xmalloc (size_t);
#define USE_SAFE_ALLOCA \
- ptrdiff_t sa_count = SPECPDL_INDEX (); int sa_must_free = 0
+ ptrdiff_t sa_count = SPECPDL_INDEX (); bool sa_must_free = 0
/* SAFE_ALLOCA allocates a simple buffer. */