aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert <[email protected]>2011-03-16 22:15:08 -0700
committerPaul Eggert <[email protected]>2011-03-16 22:15:08 -0700
commitbe02381c5db4236f51f474726003d5a97bbc61f7 (patch)
tree3a1af8d00f502c46997d0709b830233114566978
parent57048744037204ae0cef40cdca9d8a967a4e1407 (diff)
* 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.
-rw-r--r--src/ChangeLog7
-rw-r--r--src/process.c2
-rw-r--r--src/s/aix4-2.h2
-rw-r--r--src/s/cygwin.h3
-rw-r--r--src/s/darwin.h3
-rw-r--r--src/s/gnu-linux.h2
6 files changed, 12 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 45cb41024a..7e7556f0e8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
2011-03-17 Paul Eggert <[email protected]>
+ * 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.
diff --git a/src/process.c b/src/process.c
index a026174bd2..ab34086715 100644
--- a/src/process.c
+++ b/src/process.c
@@ -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
diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h
index 443fc03457..c2715fffe0 100644
--- a/src/s/aix4-2.h
+++ b/src/s/aix4-2.h
@@ -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));
diff --git a/src/s/cygwin.h b/src/s/cygwin.h
index ceebe23f1e..af5308ff7b 100644
--- a/src/s/cygwin.h
+++ b/src/s/cygwin.h
@@ -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
-
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 4fc2f4d103..dd0d0c3402 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -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
-
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h
index 84fe5b92da..178d7082f7 100644
--- a/src/s/gnu-linux.h
+++ b/src/s/gnu-linux.h
@@ -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