changed trap messages somewhat, corrected bug in InOut, undone changes
to confarray.c
This commit is contained in:
		
							parent
							
								
									c41fae1f8a
								
							
						
					
					
						commit
						b24e6763c3
					
				
					 3 changed files with 12 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -256,6 +256,8 @@ IMPLEMENTATION MODULE InOut ;
 | 
			
		|||
		integ := int
 | 
			
		||||
	END;
 | 
			
		||||
	IF buf[index] > " " THEN
 | 
			
		||||
		Write(buf[index]);
 | 
			
		||||
		Write(termCH);
 | 
			
		||||
		Traps.Message("illegal integer");
 | 
			
		||||
		HALT;
 | 
			
		||||
	END;
 | 
			
		||||
| 
						 | 
				
			
			@ -419,6 +421,7 @@ IMPLEMENTATION MODULE InOut ;
 | 
			
		|||
  END WriteString;
 | 
			
		||||
 | 
			
		||||
BEGIN	(* InOut initialization *)
 | 
			
		||||
	unread := FALSE;
 | 
			
		||||
	WITH ibuf DO
 | 
			
		||||
		fildes := 0;
 | 
			
		||||
		bufferedcount := BUFSIZ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,12 +9,12 @@ static struct errm {
 | 
			
		|||
	{ ERANGE,	"range bound error"},
 | 
			
		||||
	{ ESET,		"set bound error"},
 | 
			
		||||
	{ EIOVFL,	"integer overflow"},
 | 
			
		||||
	{ EFOVFL,	"floating overflow"},
 | 
			
		||||
	{ EFUNFL,	"floating underflow"},
 | 
			
		||||
	{ EFOVFL,	"real overflow"},
 | 
			
		||||
	{ EFUNFL,	"real underflow"},
 | 
			
		||||
	{ EIDIVZ,	"divide by 0"},
 | 
			
		||||
	{ EFDIVZ,	"divide by 0.0"},
 | 
			
		||||
	{ EIUND,	"undefined integer"},
 | 
			
		||||
	{ EFUND,	"undefined float"},
 | 
			
		||||
	{ EFUND,	"undefined real"},
 | 
			
		||||
	{ ECONV,	"conversion error"},
 | 
			
		||||
 | 
			
		||||
	{ ESTACK,	"stack overflow"},
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,13 +1,5 @@
 | 
			
		|||
#include <m2_traps.h>
 | 
			
		||||
 | 
			
		||||
/*	Runtime handling of "value" conformant arrays.
 | 
			
		||||
	The routine that accepts the conformant array parameter first calls
 | 
			
		||||
	the routine new_stackptr. This routine computes a new stack pointer
 | 
			
		||||
	for the calling routine and returns it. The new space on the stack is
 | 
			
		||||
	large enough to store the array.
 | 
			
		||||
	Then, it calls copy_array to do the copying.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
struct descr {
 | 
			
		||||
	char *addr;
 | 
			
		||||
	int low;
 | 
			
		||||
| 
						 | 
				
			
			@ -22,9 +14,6 @@ char *
 | 
			
		|||
_new_stackptr(pdescr, a)
 | 
			
		||||
	register struct descr *pdescr;
 | 
			
		||||
{
 | 
			
		||||
	/*	The parameter "a" is not used and not supplied.
 | 
			
		||||
		It's address is the old stack-pointer.
 | 
			
		||||
	*/
 | 
			
		||||
	unsigned int size = (((pdescr->highminlow + 1) * pdescr->size +
 | 
			
		||||
				(EM_WSIZE - 1)) & ~(EM_WSIZE - 1));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -41,19 +30,20 @@ _new_stackptr(pdescr, a)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
_copy_array(p, a)
 | 
			
		||||
	register int *p;
 | 
			
		||||
	register char *p;
 | 
			
		||||
{
 | 
			
		||||
	register int *q;
 | 
			
		||||
	register char *q;
 | 
			
		||||
	register unsigned int sz;
 | 
			
		||||
	char dummy;
 | 
			
		||||
 | 
			
		||||
	ppdescr--;
 | 
			
		||||
	sz = (((*ppdescr)->highminlow + 1) * (*ppdescr)->size) / EM_WSIZE;
 | 
			
		||||
	sz = (((*ppdescr)->highminlow + 1) * (*ppdescr)->size +
 | 
			
		||||
		(EM_WSIZE -1)) & ~ (EM_WSIZE - 1);
 | 
			
		||||
	
 | 
			
		||||
	if ((char *) &a - (char *) &dummy > 0) {
 | 
			
		||||
		(*ppdescr)->addr = (char *) (q = &a);
 | 
			
		||||
		(*ppdescr)->addr = q = (char *) &a;
 | 
			
		||||
	}
 | 
			
		||||
	else	(*ppdescr)->addr = (char *) (q = &a - sz);
 | 
			
		||||
	else	(*ppdescr)->addr = q = (char *) &a - sz;
 | 
			
		||||
 | 
			
		||||
	while (sz--) *q++ = *p++;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue