summaryrefslogtreecommitdiffstats
path: root/bin/sh/nodes.c.pat
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-09-01 10:22:36 +0000
committerpeter <peter@FreeBSD.org>1996-09-01 10:22:36 +0000
commit5195be912eb257c05a0c97e561e72f01af2583ff (patch)
treee47ab3981b495c675a987dd1e943d1f4c823f314 /bin/sh/nodes.c.pat
parent2fc7d7d1fa299368ccdddede67b31695266698bd (diff)
downloadFreeBSD-src-5195be912eb257c05a0c97e561e72f01af2583ff.zip
FreeBSD-src-5195be912eb257c05a0c97e561e72f01af2583ff.tar.gz
Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is a
merge of parallel duplicate work by Steve Price and myself. :-] There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes. This closes a pile of /bin/sh PR's, but not all of them.. Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
Diffstat (limited to 'bin/sh/nodes.c.pat')
-rw-r--r--bin/sh/nodes.c.pat140
1 files changed, 65 insertions, 75 deletions
diff --git a/bin/sh/nodes.c.pat b/bin/sh/nodes.c.pat
index e0602ed..739616d 100644
--- a/bin/sh/nodes.c.pat
+++ b/bin/sh/nodes.c.pat
@@ -33,10 +33,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)nodes.c.pat 8.1 (Berkeley) 5/31/93
- * $Id$
+ * @(#)nodes.c.pat 8.2 (Berkeley) 5/4/95
+ * $Id: nodes.c.pat,v 1.2 1994/09/24 02:58:02 davidg Exp $
*/
+#include <stdlib.h>
/*
* Routine for dealing with parsed shell commands.
*/
@@ -48,31 +49,19 @@
#include "mystring.h"
-int funcblocksize; /* size of structures in function */
-int funcstringsize; /* size of strings in node */
-#ifdef __STDC__
+int funcblocksize; /* size of structures in function */
+int funcstringsize; /* size of strings in node */
pointer funcblock; /* block to allocate function from */
-#else
-char *funcblock; /* block to allocate function from */
-#endif
-char *funcstring; /* block to allocate strings from */
+char *funcstring; /* block to allocate strings from */
%SIZES
-#ifdef __STDC__
-STATIC void calcsize(union node *);
-STATIC void sizenodelist(struct nodelist *);
-STATIC union node *copynode(union node *);
-STATIC struct nodelist *copynodelist(struct nodelist *);
-STATIC char *nodesavestr(char *);
-#else
-STATIC void calcsize();
-STATIC void sizenodelist();
-STATIC union node *copynode();
-STATIC struct nodelist *copynodelist();
-STATIC char *nodesavestr();
-#endif
+STATIC void calcsize __P((union node *));
+STATIC void sizenodelist __P((struct nodelist *));
+STATIC union node *copynode __P((union node *));
+STATIC struct nodelist *copynodelist __P((struct nodelist *));
+STATIC char *nodesavestr __P((char *));
@@ -82,85 +71,86 @@ STATIC char *nodesavestr();
union node *
copyfunc(n)
- union node *n;
- {
- if (n == NULL)
- return NULL;
- funcblocksize = 0;
- funcstringsize = 0;
- calcsize(n);
- funcblock = ckmalloc(funcblocksize + funcstringsize);
- funcstring = funcblock + funcblocksize;
- return copynode(n);
+ union node *n;
+{
+ if (n == NULL)
+ return NULL;
+ funcblocksize = 0;
+ funcstringsize = 0;
+ calcsize(n);
+ funcblock = ckmalloc(funcblocksize + funcstringsize);
+ funcstring = funcblock + funcblocksize;
+ return copynode(n);
}
STATIC void
calcsize(n)
- union node *n;
- {
- %CALCSIZE
+ union node *n;
+{
+ %CALCSIZE
}
STATIC void
sizenodelist(lp)
- struct nodelist *lp;
- {
- while (lp) {
- funcblocksize += ALIGN(sizeof (struct nodelist));
- calcsize(lp->n);
- lp = lp->next;
- }
+ struct nodelist *lp;
+{
+ while (lp) {
+ funcblocksize += ALIGN(sizeof(struct nodelist));
+ calcsize(lp->n);
+ lp = lp->next;
+ }
}
STATIC union node *
copynode(n)
- union node *n;
- {
- union node *new;
+ union node *n;
+{
+ union node *new;
- %COPY
- return new;
+ %COPY
+ return new;
}
STATIC struct nodelist *
copynodelist(lp)
- struct nodelist *lp;
- {
- struct nodelist *start;
- struct nodelist **lpp;
-
- lpp = &start;
- while (lp) {
- *lpp = funcblock;
- funcblock += ALIGN(sizeof (struct nodelist));
- (*lpp)->n = copynode(lp->n);
- lp = lp->next;
- lpp = &(*lpp)->next;
- }
- *lpp = NULL;
- return start;
+ struct nodelist *lp;
+{
+ struct nodelist *start;
+ struct nodelist **lpp;
+
+ lpp = &start;
+ while (lp) {
+ *lpp = funcblock;
+ funcblock += ALIGN(sizeof(struct nodelist));
+ (*lpp)->n = copynode(lp->n);
+ lp = lp->next;
+ lpp = &(*lpp)->next;
+ }
+ *lpp = NULL;
+ return start;
}
STATIC char *
nodesavestr(s)
- char *s;
- {
- register char *p = s;
- register char *q = funcstring;
- char *rtn = funcstring;
-
- while (*q++ = *p++);
- funcstring = q;
- return rtn;
+ char *s;
+{
+ register char *p = s;
+ register char *q = funcstring;
+ char *rtn = funcstring;
+
+ while ((*q++ = *p++) != '\0')
+ continue;
+ funcstring = q;
+ return rtn;
}
@@ -171,8 +161,8 @@ nodesavestr(s)
void
freefunc(n)
- union node *n;
- {
- if (n)
- ckfree(n);
+ union node *n;
+{
+ if (n)
+ ckfree(n);
}
OpenPOWER on IntegriCloud