Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/ksh ksh: Replace homegrown int_least32_t with the C99 ve...
details: https://anonhg.NetBSD.org/src/rev/5befd344f4fa
branches: trunk
changeset: 354634:5befd344f4fa
user: kamil <kamil%NetBSD.org@localhost>
date: Fri Jun 23 00:29:42 2017 +0000
description:
ksh: Replace homegrown int_least32_t with the C99 version
diffstat:
bin/ksh/config.h | 8 +-------
bin/ksh/jobs.c | 8 ++++----
bin/ksh/sh.h | 23 +++++------------------
3 files changed, 10 insertions(+), 29 deletions(-)
diffs (121 lines):
diff -r 75f4b31d2ca7 -r 5befd344f4fa bin/ksh/config.h
--- a/bin/ksh/config.h Fri Jun 23 00:20:22 2017 +0000
+++ b/bin/ksh/config.h Fri Jun 23 00:29:42 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: config.h,v 1.36 2017/06/23 00:20:22 kamil Exp $ */
+/* $NetBSD: config.h,v 1.37 2017/06/23 00:29:42 kamil Exp $ */
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
@@ -172,12 +172,6 @@
/* Include game-of-life? */
/* #undef SILLY */
-/* The number of bytes in a int. */
-#define SIZEOF_INT 4
-
-/* The number of bytes in a long. */
-#define SIZEOF_LONG 4
-
/* Define if you have the _setjmp function. */
#define HAVE__SETJMP
diff -r 75f4b31d2ca7 -r 5befd344f4fa bin/ksh/jobs.c
--- a/bin/ksh/jobs.c Fri Jun 23 00:20:22 2017 +0000
+++ b/bin/ksh/jobs.c Fri Jun 23 00:29:42 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: jobs.c,v 1.13 2017/06/22 14:20:46 kamil Exp $ */
+/* $NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $ */
/*
* Process and job control
@@ -26,7 +26,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: jobs.c,v 1.13 2017/06/22 14:20:46 kamil Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.14 2017/06/23 00:29:42 kamil Exp $");
#endif
@@ -142,7 +142,7 @@
int status; /* exit status of last process */
pid_t pgrp; /* process group of job */
pid_t ppid; /* pid of process that forked job */
- INT32 age; /* number of jobs started */
+ int_least32_t age; /* number of jobs started */
clock_t systime; /* system time used by job */
clock_t usrtime; /* user time used by job */
Proc *proc_list; /* process list */
@@ -183,7 +183,7 @@
static pid_t async_pid;
static int nzombie; /* # of zombies owned by this process */
-static INT32 njobs; /* # of jobs started */
+static int_least32_t njobs; /* # of jobs started */
static int child_max; /* CHILD_MAX */
diff -r 75f4b31d2ca7 -r 5befd344f4fa bin/ksh/sh.h
--- a/bin/ksh/sh.h Fri Jun 23 00:20:22 2017 +0000
+++ b/bin/ksh/sh.h Fri Jun 23 00:29:42 2017 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */
+/* $NetBSD: sh.h,v 1.29 2017/06/23 00:29:42 kamil Exp $ */
/*
* Public Domain Bourne/Korn shell
*/
-/* $Id: sh.h,v 1.28 2017/06/23 00:18:01 kamil Exp $ */
+/* $Id: sh.h,v 1.29 2017/06/23 00:29:42 kamil Exp $ */
#include "config.h" /* system and option configuration info */
@@ -26,6 +26,7 @@
#include <stdarg.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdint.h>
#ifndef O_ACCMODE
# define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
@@ -118,20 +119,6 @@
# define ksh_jmp_buf jmp_buf
#endif /* HAVE_SIGSETJMP */
-/* Find a integer type that is at least 32 bits (or die) - SIZEOF_* defined
- * by autoconf (assumes an 8 bit byte, but I'm not concerned).
- * NOTE: INT32 may end up being more than 32 bits.
- */
-#if SIZEOF_INT >= 4
-# define INT32 int
-#else /* SIZEOF_INT */
-# if SIZEOF_LONG >= 4
-# define INT32 long
-# else /* SIZEOF_LONG */
- #error cannot find 32 bit type...
-# endif /* SIZEOF_LONG */
-#endif /* SIZEOF_INT */
-
/* end of common headers */
/* Stop gcc and lint from complaining about possibly uninitialized variables */
@@ -187,7 +174,7 @@
#define BIT(i) (1<<(i)) /* define bit in flag */
/* Table flag type - needs > 16 and < 32 bits */
-typedef INT32 Tflag;
+typedef int_least32_t Tflag;
#define NUFILE 32 /* Number of user-accessible files */
#define FDBASE 10 /* First file usable by Shell */
@@ -495,7 +482,7 @@
#ifdef KSH
/* This for co-processes */
-typedef INT32 Coproc_id; /* something that won't (realisticly) wrap */
+typedef int_least32_t Coproc_id; /* something that won't (realisticly) wrap */
struct coproc {
int read; /* pipe from co-process's stdout */
int readw; /* other side of read (saved temporarily) */
Home |
Main Index |
Thread Index |
Old Index