emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109764: * bytecode.c, callint.c, cal


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109764: * bytecode.c, callint.c, callproc.c: Use bool for boolean.
Date: Fri, 24 Aug 2012 20:11:12 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109764
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Fri 2012-08-24 20:11:12 -0700
message:
  * 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'.
modified:
  src/ChangeLog
  src/bytecode.c
  src/callint.c
  src/callproc.c
  src/lisp.h
  src/process.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-24 04:37:57 +0000
+++ b/src/ChangeLog     2012-08-25 03:11:12 +0000
@@ -1,3 +1,16 @@
+2012-08-25  Paul Eggert  <address@hidden>
+
+       * 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  <address@hidden>
 
        * buffer.c, buffer.h: Use bool for boolean.

=== modified file 'src/bytecode.c'
--- a/src/bytecode.c    2012-08-07 13:37:21 +0000
+++ b/src/bytecode.c    2012-08-25 03:11:12 +0000
@@ -553,7 +553,7 @@
   if (INTEGERP (args_template))
     {
       ptrdiff_t at = XINT (args_template);
-      int rest = at & 128;
+      bool rest = (at & 128) != 0;
       int mandatory = at & 127;
       ptrdiff_t nonrest = at >> 8;
       eassert (mandatory <= nonrest);

=== modified file 'src/callint.c'
--- a/src/callint.c     2012-08-17 23:38:43 +0000
+++ b/src/callint.c     2012-08-25 03:11:12 +0000
@@ -150,7 +150,7 @@
     = {"", "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));
@@ -273,11 +273,11 @@
   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;
@@ -685,7 +685,7 @@
            goto have_prefix_arg;
        case 'n':               /* Read number from minibuffer.  */
          {
-           int first = 1;
+           bool first = 1;
            do
              {
                Lisp_Object str;
@@ -726,11 +726,11 @@
          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;
 

=== modified file 'src/callproc.c'
--- a/src/callproc.c    2012-08-19 21:00:09 +0000
+++ b/src/callproc.c    2012-08-25 03:11:12 +0000
@@ -77,7 +77,7 @@
 
 /* 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;
@@ -94,8 +94,8 @@
    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)
@@ -190,7 +190,7 @@
   (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)
@@ -217,7 +217,7 @@
   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;
@@ -241,7 +241,7 @@
     /* 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++)
@@ -610,12 +610,12 @@
       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;
 
@@ -766,11 +766,11 @@
 
   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;
@@ -1086,7 +1086,7 @@
 add_env (char **env, char **new_env, char *string)
 {
   char **ep;
-  int ok = 1;
+  bool ok = 1;
   if (string == NULL)
     return new_env;
 
@@ -1126,8 +1126,7 @@
    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
@@ -1135,7 +1134,8 @@
    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;
@@ -1394,7 +1394,7 @@
 }
 #endif /* not WINDOWSNT */
 
-static int
+static bool
 getenv_internal_1 (const char *var, ptrdiff_t varlen, char **value,
                   ptrdiff_t *valuelen, Lisp_Object env)
 {
@@ -1429,7 +1429,7 @@
   return 0;
 }
 
-static int
+static bool
 getenv_internal (const char *var, ptrdiff_t varlen, char **value,
                 ptrdiff_t *valuelen, Lisp_Object frame)
 {

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2012-08-24 04:37:57 +0000
+++ b/src/lisp.h        2012-08-25 03:11:12 +0000
@@ -3330,7 +3330,7 @@
 #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);
@@ -3586,7 +3586,7 @@
 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.  */
 

=== modified file 'src/process.h'
--- a/src/process.h     2012-08-18 02:49:24 +0000
+++ b/src/process.h     2012-08-25 03:11:12 +0000
@@ -184,7 +184,7 @@
 
 /* True if we are about to fork off a synchronous process or if we
    are waiting for it.  */
-extern int synch_process_alive;
+extern bool synch_process_alive;
 
 /* Communicate exit status of sync process to from sigchld_handler
    to Fcall_process.  */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]