diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-03-16 22:15:08 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-03-16 22:15:08 -0700 |
commit | be02381c5db4236f51f474726003d5a97bbc61f7 (patch) | |
tree | 3a1af8d00f502c46997d0709b830233114566978 /src | |
parent | 57048744037204ae0cef40cdca9d8a967a4e1407 (diff) | |
download | emacs-be02381c5db4236f51f474726003d5a97bbc61f7.tar.gz |
* 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.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/process.c | 2 | ||||
-rw-r--r-- | src/s/aix4-2.h | 2 | ||||
-rw-r--r-- | src/s/cygwin.h | 3 | ||||
-rw-r--r-- | src/s/darwin.h | 3 | ||||
-rw-r--r-- | src/s/gnu-linux.h | 2 |
6 files changed, 12 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 45cb41024ae..7e7556f0e85 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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. diff --git a/src/process.c b/src/process.c index a026174bd23..ab340867150 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 443fc034570..c2715fffe01 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 ceebe23f1e7..af5308ff7bb 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 4fc2f4d1031..dd0d0c34021 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 84fe5b92da9..178d7082f72 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 |