]> git.eshelyaron.com Git - emacs.git/commitdiff
* process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Mar 2011 05:15:08 +0000 (22:15 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Mar 2011 05:15:08 +0000 (22:15 -0700)
That way, the code declares only the vars that it needs.
* s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
* s/cygwin.h (PTY_ITERATION): Likewise.
* s/darwin.h (PTY_ITERATION): Likewise.
* s/gnu-linux.h (PTY_ITERATION): Likewise.

src/ChangeLog
src/process.c
src/s/aix4-2.h
src/s/cygwin.h
src/s/darwin.h
src/s/gnu-linux.h

index 45cb41024ae69697d3a56eb9eaca9a5b8ceca612..7e7556f0e8548c1e1e0cf2e7c35a87abad7ec671 100644 (file)
@@ -1,5 +1,12 @@
 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
+       That way, the code declares only the vars that it needs.
+       * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
+       * s/cygwin.h (PTY_ITERATION): Likewise.
+       * s/darwin.h (PTY_ITERATION): Likewise.
+       * s/gnu-linux.h (PTY_ITERATION): Likewise.
+
        * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
        * process.c (allocate_pty): Don't declare stb unless it's needed.
 
index a026174bd23dbc513d4f1b9900e7404c7a1624d6..ab340867150cf043f39f4bd485513d50b973f39b 100644 (file)
@@ -535,12 +535,12 @@ static char pty_name[24];
 static int
 allocate_pty (void)
 {
-  register int c, i;
   int fd;
 
 #ifdef PTY_ITERATION
   PTY_ITERATION
 #else
+  register int c, i;
   for (c = FIRST_PTY_LETTER; c <= 'z'; c++)
     for (i = 0; i < 16; i++)
 #endif
index 443fc034570121d0c9e97df6123557ef7d5ecd57..c2715fffe013e3750f495178fa75ce854b5c65d9 100644 (file)
@@ -32,7 +32,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* In AIX, you allocate a pty by opening /dev/ptc to get the master side.
    To get the name of the slave side, you just ttyname() the master side.  */
-#define PTY_ITERATION for (c = 0; !c ; c++)
+#define PTY_ITERATION int c; for (c = 0; !c ; c++)
 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc");
 #define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd));
 
index ceebe23f1e7d301fc1447c53d1959db3d81b9c54..af5308ff7bbbb3185804ea938c5c47ec09d49741 100644 (file)
@@ -46,7 +46,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Define HAVE_PTYS if the system supports pty devices.  */
 #define HAVE_PTYS
-#define PTY_ITERATION          for (i = 0; i < 1; i++) /* ick */
+#define PTY_ITERATION          int i; for (i = 0; i < 1; i++) /* ick */
 #define PTY_NAME_SPRINTF       /* none */
 #define PTY_TTY_NAME_SPRINTF   /* none */
 #define PTY_OPEN                                       \
@@ -102,4 +102,3 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Send signals to subprocesses by "typing" special chars at them.  */
 #define SIGNALS_VIA_CHARACTERS
-
index 4fc2f4d103121992cd152442a05a4572f0750085..dd0d0c34021b9114866542a5d5390b7381b144d5 100644 (file)
@@ -68,7 +68,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    Note: PTYs are broken on darwin <6.  Use at your own risk.  */
 #define HAVE_PTYS
 /* Run only once.  We need a `for'-loop because the code uses `continue'.  */
-#define PTY_ITERATION  for (i = 0; i < 1; i++)
+#define PTY_ITERATION  int i; for (i = 0; i < 1; i++)
 #define PTY_NAME_SPRINTF       /* none */
 #define PTY_TTY_NAME_SPRINTF   /* none */
 /* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
@@ -148,4 +148,3 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack.  */
 #define GC_MARK_STACK   GC_MAKE_GCPROS_NOOPS
-
index 84fe5b92da976d341938365ebe401719b6f29267..178d7082f72830c4a540e8afc34b76f6329aa09f 100644 (file)
@@ -44,7 +44,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define UNIX98_PTYS
 
 /* Run only once.  We need a `for'-loop because the code uses `continue'.  */
-#define PTY_ITERATION  for (i = 0; i < 1; i++)
+#define PTY_ITERATION  int i; for (i = 0; i < 1; i++)
 
 #ifdef HAVE_GETPT
 #define PTY_NAME_SPRINTF