aboutsummaryrefslogtreecommitdiff
path: root/shells/v7sh/files/patch-stak.c
blob: 3f83371c4a79612a39786cd8d1bf037a8b4a9fb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff -u -x CVS -x work -x core -x *.core -x #* -x *~ -x *.orig -x *.rej -I $Id.*$ -I $.+BSD.*$ stak.c.orig stak.c
--- stak.c.orig	Fri Jun  4 02:51:02 2004
+++ stak.c	Sat Jun 19 18:42:24 2004
@@ -9,17 +9,19 @@
 
 #include	"defs.h"
 
-STKPTR		stakbot=nullstr;
-
-
+BLKPTR		stakbsy;
+STKPTR		stakbas;
+STKPTR		brkend;
+STKPTR		stakbot=(STKPTR) nullstr;
+STKPTR		staktop;
 
 /* ========	storage allocation	======== */
 
 STKPTR	getstak(asize)
-	INT		asize;
+	POS		asize;
 {	/* allocate requested stack */
 	REG STKPTR	oldstak;
-	REG INT		size;
+	REG POS		size;
 
 	size=round(asize,BYTESPERWORD);
 	oldstak=stakbot;
@@ -51,7 +53,7 @@
 {	/* tidy up after `locstak' */
 	REG STKPTR	oldstak;
 	*argp++=0;
-	oldstak=stakbot; stakbot=staktop=round(argp,BYTESPERWORD);
+	oldstak=stakbot; stakbot=staktop=(STKPTR) round(argp,BYTESPERWORD);
 	return(oldstak);
 }
 
@@ -59,15 +61,15 @@
 	REG STKPTR 	x;
 {
 	/* try to bring stack back to x */
-	WHILE ADR(stakbsy)>ADR(x)
+	WHILE ADR((STKPTR) stakbsy)>ADR(x)
 	DO free(stakbsy);
 	   stakbsy = stakbsy->word;
 	OD
 	staktop=stakbot=max(ADR(x),ADR(stakbas));
-	rmtemp(x);
+	rmtemp((IOPTR) x);
 }
 
-stakchk()
+VOID	stakchk()
 {
 	IF (brkend-stakbas)>BRKINCR+BRKINCR
 	THEN	setbrk(-BRKINCR);
@@ -75,7 +77,7 @@
 }
 
 STKPTR	cpystak(x)
-	STKPTR		x;
+	CSTKPTR		x;
 {
 	return(endstak(movstr(x,locstak())));
 }