[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Diffs for Pure-C



Below are diffs to make Pure-C happy again. They are relative to 1.12h3.

One important things:

I reformatted cookie.c. Sorry, but this really was needed :-). Furthermore
I would say that this function should only be kept if it really works
(resizing the cookie jar) and has it's manual page.

diff --unified --rec /origmint/biosfs.c ./biosfs.c
--- /origmint/biosfs.c	Sun Apr 23 12:06:34 1995
+++ ./biosfs.c	Sun Apr 23 12:25:50 1995
@@ -172,7 +172,7 @@
 
 INLINE static void scc_set5 P_((volatile char *control, int setp,
 	unsigned bits, IOREC_T *iorec));
-static void ARGS_ON_STACK wakewrite P_ ((PROC *p));
+static void wakewrite P_ ((PROC *p));
 INLINE static long iocsflagsb P_ ((int bdev, unsigned long flags, 
 				   unsigned long mask, 
 				   struct tty *tty, 
diff --unified --rec /origmint/cookie.c ./cookie.c
--- /origmint/cookie.c	Sun Apr 23 12:06:44 1995
+++ ./cookie.c	Sun Apr 23 12:57:50 1995
@@ -63,175 +63,178 @@
  ***                                                                    ***
  **************************************************************************/
 
-long ARGS_ON_STACK s_cookie (short Action, COOKIE * Yummy)
+long ARGS_ON_STACK s_cookie (short Action, COOKIE *Yummy)
 {
-  COOKIE * choc_chip;     /* choc_chip cookies are temporary @ my house! */
-  register int r;
+	COOKIE *choc_chip;	/* choc_chip cookies are temporary @ my house! */
+	long r;
 
-  switch (Action) {
+	switch (Action)
+	{
+		/* "Bakes" a new cookie.  Yummy is a pointer to the cookie to 
+		make. Only mom can bake cookies (EACCDN) and the cookie must not 
+		already exist (ELOCKED).  Can't bake the "special" tag. */
 
-    case C_BAKE:
+	    case C_BAKE:
 
-      /* "Bakes" a new cookie.  Yummy is a pointer to the cookie to make.
-         Only mom can bake cookies (EACCDN) and the cookie must not
-         already exist (ELOCKED).  Can't bake the "special" tag.   */
+			/* Sanity check - BUG: should make sure block is in process'
+			mem map */
 
-      /* Sanity check - BUG : should make sure block is in process' mem map */
-      if ((long) Yummy < (long) CJAR)
-        return EIMBA;
+			if ((long) Yummy < (long) CJAR)
+				return EIMBA;
 
-      else if ((curproc -> euid) || (Yummy->tag == C_FIRST))
-        return EACCDN;
-      else if (!(r = search_jar (Yummy->tag, &choc_chip)))
-        return ELOCKED;
-      else return (insert_cookie (Yummy, choc_chip));
+			if ((curproc -> euid) || (Yummy->tag == C_FIRST))
+				return EACCDN;
 
+			if (0 == (r = search_jar (Yummy->tag, &choc_chip)))
+				return ELOCKED;
 
-    case C_GRAB:  case C_MORE:
+			return (insert_cookie (Yummy, choc_chip));
 
-      /* Search for a cookie.  Yummy is a pointer to a cookie to search
-         for (search is by tag field, if not found EFILNF).  If C_MORE
-         instead of C_READ we copy the NEXT cookie into the user's cookie
-         instead of the one we found.                                  */
+		/* Search for a cookie.  Yummy is a pointer to a cookie to search  
+		for (search is by tag field, if not found EFILNF).  If C_MORE 
+		instead of C_READ we copy the NEXT cookie into the user's cookie 
+		instead of the one we found. */
 
-      if (((long) Yummy == -1L) && (curproc->euid == 0)) {
-	r = search_jar (-1L, &choc_chip);
-        return (long)choc_chip;
-      }  /* Pass -1L, instead of pointer to get direct access to jar */
+		case C_GRAB:
+		case C_MORE:
+			if ((long) Yummy == -1L && curproc->euid == 0) {
+				r = search_jar (-1L, &choc_chip);
+		        return (long)choc_chip;
+      		}
 
-      else if ((long) Yummy < (long) CJAR)
-        return EIMBA;     /* Sanity Check! - see comment above */
+			/* Pass -1L, instead of pointer to get direct access to jar */
 
-      else if ((r = search_jar (Yummy->tag, &choc_chip)))
-        return r;
-      else {
-        if ((Action == C_MORE) && (choc_chip->tag != 0))
-          choc_chip++;
-        *Yummy = *choc_chip;
-        return 0;
-      }
+			if ((long) Yummy < (long) CJAR)
+				return EIMBA;     /* Sanity Check! - see comment above */
 
+			if (0 != (r = search_jar (Yummy->tag, &choc_chip)))
+				return r;
 
-    case C_READ:
+			if (Action == C_MORE && choc_chip->tag != 0)
+				choc_chip++;
+			*Yummy = *choc_chip;
+			return E_OK;
 
-      /* Special: C_READ passes and returns value, not cookies!     */
-      /* The system 200Hz tick is provided by reading cookie "*200" 
-         for now.                                                   */
+		/* Special: C_READ passes and returns value, not cookies! The 
+		system 200Hz tick is provided by reading cookie "*200" for now. */
 
-      if ((long)Yummy == COOKIE_V200)
-        return ((long)*((long *)0x04ba));
-      else if ((r = search_jar ((long)Yummy, &choc_chip))) 
-        if ((long)Yummy)
-          return r; 
-      return (choc_chip->value); 
+		case C_READ:
+			if ((long)Yummy == COOKIE_V200)
+				return ((long)*((long *)0x04ba));
 
+			if (0 != (r = search_jar ((long)Yummy, &choc_chip)))
+				if (Yummy) return r;
 
-    case C_SIZE:
+			return (choc_chip->value); 
 
-       /* Returns the number of cookies actually in the jar.  To find
-          how many cookie slots exist, C_READ the NULL cookie.      */
+		/* Returns the number of cookies actually in the jar. To find how 
+		many cookie slots exist, C_READ the NULL cookie. */
 
-       r = 1;
-       search_jar (C_FIRST, &choc_chip);
-       while (choc_chip->tag) {
-         choc_chip++;
-         r++;
-       }
-       return r;
+		case C_SIZE:
+			r = 1;
+			search_jar (C_FIRST, &choc_chip);
+			while (choc_chip->tag) {
+				choc_chip++;
+				r++;
+			}
+			return r;
 
+		/* We don't just let anyone eat our cookies (EACCDN) and the 
+		cookie may not exist anyways (EFILNF) */
 
-    case C_EAT:
+		case C_EAT:
+			if ((long) Yummy < (long) CJAR)
+				return EIMBA; /* Sanity Check - see above */
 
-       /* We don't just let anyone eat our cookies (EACCDN) and the
-          cookie may not exist anyways (EFILNF)                     */
+			if (curproc->euid || Yummy->tag == 0)
+				return EACCDN;
 
-       if ((long) Yummy < (long) CJAR)
-         return EIMBA;                  /* Sanity Check - see above */
-       else if ((curproc->euid) || (Yummy->tag == 0))
-         return EACCDN;
-       else if ((r = search_jar (Yummy->tag, &choc_chip)))
-         return r;
-       else return delete_cookie (choc_chip); 
+			if (0 != (r = search_jar (Yummy->tag, &choc_chip)))
+				return r;
 
+			return delete_cookie (choc_chip); 
 
-    default:
-
-       return EINVFN;
-  }
+		default:
+			return EINVFN;
+	}
 }
 
 
-static long search_jar (long tag, COOKIE ** jar)
+static long search_jar (long tag, COOKIE **jar)
 {
-  /* Search the cookie jar for a cookie with a specific tag.  C_FIRST 
-     returns the first cookie, and NULL (0) is the last cookie.       */
+	/* Search the cookie jar for a cookie with a specific tag. C_FIRST 
+	returns the first cookie, and NULL (0) is the last cookie. */
+
+	(*jar) = *CJAR;
+	if (tag == C_FIRST) return 0;
+
+	while ((*jar)->tag)
+		if (tag == (*jar)->tag)
+			return 0;
+		else
+			(*jar)++;
 
-  (*jar) = *CJAR;
-  if (tag == C_FIRST)
-    return 0;
-  while ((*jar)->tag)
-    if (tag == (*jar)->tag)
-      return 0;
-    else (*jar)++;
-  return EFILNF;
+	return EFILNF;
 }
 
 
 static long delete_cookie (COOKIE * choc_chip)
 {
-  int i;
-  for (i = 0; (choc_chip[i].tag); i++)      /* Copy everything down */
-    choc_chip[i] = choc_chip[i+1];
-  return 0;
+	int i;
+
+	for (i = 0; (choc_chip[i].tag); i++)	/* Copy everything down */
+		choc_chip[i] = choc_chip[i+1];
+
+	return E_OK;
 }
 
 
 static long insert_cookie (COOKIE * Yummy, COOKIE * choc_chip)
 {
-  COOKIE * Jar = * CJAR; 
-  MEMREGION *temp;
-
-  /* Shall we install a whole new cookie jar? */
+	COOKIE * Jar = * CJAR;
+	MEMREGION *temp;
 
-  if ((( (long) choc_chip - (long) Jar) >> 3) >= ((choc_chip->value) - 1)) {
+	/* Shall we install a whole new cookie jar? */
 
-    COOKIE * NewJar;
-    long jarsize = ROUND(((choc_chip->value) + 8) << 3);
-
-    TRACE(("Allocating new Jar of %ld bytes", jarsize));
-
-    temp = get_region (core, jarsize, PROT_G);
-    choc_chip = NewJar = attach_region (rootproc, temp);
-
-    if (!(virtaddr)choc_chip) {
-      temp->links = 0;
-      free_region (temp);
-      return ENSMEM;
-    }
-
-    do 
-      *choc_chip++ = *Jar++;
-    while (choc_chip -> tag);         /* Copy old cookies */
-
-    *choc_chip++ = *Yummy;            /* Insert Cookie! */
-    choc_chip->tag = 0;
-    choc_chip->value = jarsize/sizeof(COOKIE);
-    TRACE(("Free'ing old jar"));
-    newjar_region->links = 0;
-    free_region (newjar_region);    /* Free old jar */
-    *CJAR = NewJar;                 /* Set the new jar */
-    newjar_region = temp;
-    return 0;                       /* We're Done! */
-
-  } else {
-
-    long value = choc_chip->value;    /* How many? */
-
-    *choc_chip++ = *Yummy;            /* Insert Cookie */
-    choc_chip->tag = 0;
-    choc_chip->value = value;         /* jar hasn't changed */ 
-    return 0;
-  } 
+	if ((( (long)choc_chip - (long)Jar) >> 3) >= (choc_chip->value -  1))
+	{
+		COOKIE * NewJar;
+		long jarsize = ROUND(((choc_chip->value) + 8) << 3);
+
+		TRACE(("Allocating new Jar of %ld bytes", jarsize));
+
+		temp = get_region (core, jarsize, PROT_G);
+		choc_chip = NewJar = (COOKIE *)attach_region (rootproc, temp);
+
+		if (!choc_chip) {
+			temp->links = 0;
+			free_region (temp);
+			return ENSMEM;
+		}
+
+		do
+			*choc_chip++ = *Jar++;
+		while (choc_chip->tag);	/* Copy old cookies */
+
+		*choc_chip++ = *Yummy;            /* Insert Cookie! */
+		choc_chip->tag = 0;
+		choc_chip->value = jarsize/sizeof(COOKIE);
+		TRACE(("Free'ing old jar"));
+		newjar_region->links = 0;
+		free_region (newjar_region);    /* Free old jar */
+		*CJAR = NewJar;                 /* Set the new jar */
+		newjar_region = temp;
+		return E_OK;                       /* We're Done! */
+	}
+	else
+	{
+		long value = choc_chip->value;	/* How many? */
+
+		*choc_chip++ = *Yummy;			/* Insert Cookie */
+		choc_chip->tag = 0;
+		choc_chip->value = value;	/* jar hasn't changed */
+		return E_OK;
+	}
 }
 
 
diff --unified --rec /origmint/dos.c ./dos.c
--- /origmint/dos.c	Sun Apr 23 12:06:54 1995
+++ ./dos.c	Sun Apr 23 12:14:40 1995
@@ -230,14 +230,14 @@
 	int old_ruid = curproc->ruid;
 
 	if (ruid != -1) {
-		if ((curproc->euid == ruid) || (old_ruid == ruid) || (curproc->euid == 0))
+		if (curproc->euid == ruid || old_ruid == ruid || curproc->euid == 0)
 			curproc->ruid = ruid;
 		else
 			return(EACCDN);
 	}
 
 	if (euid != -1) {
-		if ((curproc->euid == euid) || (old_ruid == euid) || (curproc->suid = euid) || (curproc->euid == 0))
+		if (curproc->euid == euid || old_ruid == euid || curproc->suid == euid || curproc->euid == 0)
 			curproc->euid = euid;
 		else {
 			curproc->ruid = old_ruid;
diff --unified --rec /origmint/dosfile.c ./dosfile.c
--- /origmint/dosfile.c	Sun Apr 23 12:07:08 1995
+++ ./dosfile.c	Sun Apr 23 12:22:02 1995
@@ -1193,7 +1193,7 @@
 	mask = 1L;
 	wait_cond = (long)wakeselect;
 	count = 0;
-	
+
 	for (i = 0; i < MAX_OPEN; i++) {
 		if (col_rfd & mask) {
 			f = p->handle[i];
@@ -1271,12 +1271,13 @@
  */
 	if (!strcmp (curproc->name, "AESSYS")) {
 	/* pointer to gems etv_timer handler */
-		char *foo = *(char **)(lineA0()-0x42), *memchr();
+        extern void *memchr (const void *, int val, size_t len);
+		char *foo = *(char **)(lineA0()-0x42);
 		long *bar;
 	/* find that counter by looking for the first subql #1,xxxxxx
 	 * instruction (0x53b9), save address and old value
 	 */
-		if (foo && (foo = memchr (foo, 0x53, 0x40)) &&
+		if (foo && NULL != (foo = memchr (foo, 0x53, 0x40)) &&
 		    !(1 & (long)foo) && foo[1] == (char)0xb9 &&
 		    foo < (char *)(bar = *(long **)(foo+2))) {
 			gemtimer = (long)bar;
diff --unified --rec /origmint/filesys.c ./filesys.c
--- /origmint/filesys.c	Sun Apr 23 12:07:28 1995
+++ ./filesys.c	Sun Apr 23 12:22:48 1995
@@ -133,8 +133,8 @@
 /* uk: go through the list of file systems and call their sync() function
  *     if they wish to.
  */
-long
-s_ync()
+long ARGS_ON_STACK
+s_ync(void)
 {
 	FILESYS *fs;
 
@@ -801,7 +801,7 @@
 	}
 
 	/* here's where we come when we've gone across a mount point */
-	
+
 restart_mount:
 
 	if (!*path) {		/* nothing more to do */
diff --unified --rec /origmint/mem.c ./mem.c
--- /origmint/mem.c	Sun Apr 23 12:07:56 1995
+++ ./mem.c	Sun Apr 23 12:23:54 1995
@@ -1197,7 +1197,7 @@
 				ismax = -1;
 				goto again1;
 			}
-			if ((s->text = addr2mem(alloc_region(map, fh->ftext, PROT_P)))) {
+			if (NULL != (s->text = addr2mem(alloc_region(map, fh->ftext, PROT_P)))) {
 				goto again2;
 			}
 		}
diff --unified --rec /origmint/memprot.c ./memprot.c
--- /origmint/memprot.c	Tue Aug 30 07:55:50 1994
+++ ./memprot.c	Sun Apr 23 13:54:24 1995
@@ -1094,7 +1094,7 @@
     *linebuf = '\0';
     for (mp = *map; mp; mp = mp->next) {
 	for (loc = mp->loc; loc < (mp->loc + mp->len); loc += EIGHT_K) {
-	    if (first || ((loc & 0x1ffff) == 0)) {
+	    if (first || ((loc & 0x1ffffL) == 0)) {
 		if (*linebuf) FORCE(linebuf);
 		ksprintf(linebuf,"\r%08lx: ",loc);
 		lp = &linebuf[11];
diff --unified --rec /origmint/proto.h ./proto.h
--- /origmint/proto.h	Sun Apr 23 12:08:26 1995
+++ ./proto.h	Sun Apr 23 12:15:08 1995
@@ -209,7 +209,7 @@
 void load_filesys P_((void));
 void load_devdriver P_((void));
 void close_filesys P_((void));
-long s_ync P_((void));
+long ARGS_ON_STACK s_ync P_((void));
 void ARGS_ON_STACK changedrv P_((unsigned drv));
 int disk_changed P_((int drv));
 long relpath2cookie
diff --unified --rec /origmint/purec/makefile ./purec/makefile
--- /origmint/purec/makefile	Thu Jun 30 20:59:06 1994
+++ ./purec/makefile	Sun Apr 23 19:41:26 1995
@@ -48,18 +48,21 @@
 
 COBJS = bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o dossig.o \
 	filesys.o main.o mem.o proc.o signal.o timeout.o tty.o util.o \
-	biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
-	unifs.o shmfs.o fasttext.o welcome.o nalloc2.o memprot.o realloc.o
+	biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o cookie.o \
+	unifs.o shmfs.o fasttext.o welcome.o nalloc2.o memprot.o realloc.o \
+	update.o
 
 COBJS030 = bios.o0 xbios.o0 console.o0 dos.o0 dosdir.o0 dosfile.o0 dosmem.o0 dossig.o0 \
 	filesys.o0 main.o0 mem.o0 proc.o0 signal.o0 timeout.o0 tty.o0 util.o0 \
-	biosfs.o0 pipefs.o0 procfs.o0 tosfs.o0 debug.o0 rendez.o0 \
-	unifs.o0 shmfs.o0 fasttext.o0 welcome.o0 nalloc2.o0 memprot.o realloc.o0
+	biosfs.o0 pipefs.o0 procfs.o0 tosfs.o0 debug.o0 rendez.o0 cookie.o0 \
+	unifs.o0 shmfs.o0 fasttext.o0 welcome.o0 nalloc2.o0 memprot.o realloc.o0 \
+	update.o0
 
 CSRCS = bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c dossig.c \
 	filesys.c main.c mem.c proc.c signal.c timeout.c tty.c util.c \
-	biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
-	unifs.c shmfs.c fasttext.c welcome.c nalloc2.c memprot.c realloc.c
+	biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c cookie.c \
+	unifs.c shmfs.c fasttext.c welcome.c nalloc2.c memprot.c realloc.c \
+	update.c
 
 SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
 SOBJS030 = context.o0 intr.o0 syscall.o0 quickzer.o0 quickmov.o0 cpu.o0
diff --unified --rec /origmint/purec/mintpure.prj ./purec/mintpure.prj
--- /origmint/purec/mintpure.prj	Thu Jun 30 20:59:24 1994
+++ ./purec/mintpure.prj	Sun Apr 23 19:39:34 1995
@@ -32,6 +32,8 @@
 welcome (mint.h, proc.h, file.h)
 realloc (mint.h, proc.h, file.h)
 memprot (mint.h, proc.h, file.h)
+cookie (cookie.h, mint.h)
+update (mint.h)
 context.s (proc.h)
 intr.s (proc.h)
 syscall.s (proc.h)
diff --unified --rec /origmint/purec/osbind.h ./purec/osbind.h
--- /origmint/purec/osbind.h	Sun Apr 23 12:09:14 1995
+++ ./purec/osbind.h	Sun Apr 23 13:23:16 1995
@@ -248,8 +248,9 @@
 int     Frename( int zero, const char *oldname, const char *newname );
 int     Fdatime( short *timeptr, int handle, int wflag );
 int     Fcntl( int f, long arg, int cmd );
+void    *Psignal( int sig, void *handler );
+int     Fselect(unsigned int timeout, long *rfds, long *wfds, long *xfds );
 
-
 /****** TOS 030 Gemdos Extension ****************************************/
 
 long    Mxalloc( long number, int mode );
diff --unified --rec /origmint/purec/puremint.txt ./purec/puremint.txt
--- /origmint/purec/puremint.txt	Tue Nov 15 18:46:24 1994
+++ ./purec/puremint.txt	Sun Apr 23 12:31:04 1995
@@ -1,7 +1,7 @@
-How to compile MiNT 1.12 with PureC
------------------------------------
+How to compile MH-MiNT 1.12h3 with PureC
+----------------------------------------
 
-Julian F. Reschke, 5. Juni 1994
+Julian F. Reschke, 23. April 1995
 email: reschke@math.uni-muenster.de
 
 
diff --unified --rec /origmint/tosfs.c ./tosfs.c
--- /origmint/tosfs.c	Sun Apr 23 12:08:52 1995
+++ ./tosfs.c	Sun Apr 23 12:27:38 1995
@@ -233,10 +233,10 @@
 {
 	unsigned long s = 0;
 	unsigned int n = 0;
-	
+
 	/* skip x: */
 	filename += 2;
-	
+
 	while (*filename) {
 		s = UPDC32 (*filename++, s);
 		n++;
@@ -246,7 +246,7 @@
 		s = UPDC32 (n & 0377, s);
 		n >>= 8;
 	}
-	
+
 	return s;
 }
 
@@ -628,7 +628,7 @@
 #endif
 #ifdef ROOTPERMS
 	struct tosrootperm *tp = NULL;
-	
+
 	if (fc->dev < ROOTPERMS) tp = &root_perms[fc->dev];
 #endif
 
@@ -665,7 +665,7 @@
 			ti->date = ti->time = 0;
 			goto around;
 		}
-	
+
 		r = Fsfirst(ti->name, FILEORDIR);
 		if (r) {
 			DEBUG(("tosfs: search error %ld on [%s]", r, ti->name));
@@ -689,7 +689,7 @@
 	xattr->blksize = 1024;
 	if (fc->dev < 32 && clsizb[fc->dev])
 		xattr->blksize = clsizb[fc->dev];
-	
+
 	xattr->nblocks = (xattr->size + xattr->blksize - 1) / xattr->blksize;
 	if (!xattr->nblocks && (ti->attr & FA_DIR))
 		xattr->nblocks = 1;	/* no dir takes 0 blocks... */
@@ -756,11 +756,11 @@
 		{
 			root_perms[dir->dev].uid = uid;
 			root_perms[dir->dev].gid = gid;
-			return 0;	
+			return 0;
 		}
-	
+
 	return EINVFN;
-	
+
 #else
 	UNUSED(dir); UNUSED(uid); UNUSED(gid);
 	return EINVFN;
@@ -1188,7 +1188,7 @@
 #endif
 	return 0;
 }
-	
+
 /*
  * TOS device driver
  */
@@ -1560,9 +1560,8 @@
 /* release/copy file cookies; these functions exist to keep
  * track of whether or not the kernel is still using a file
  */
-long
-tos_release(fc)
-	fcookie *fc;
+long ARGS_ON_STACK
+tos_release(fcookie *fc)
 {
 	struct tindex *ti = (struct tindex *)fc->index;
 
@@ -1574,9 +1573,8 @@
 	return 0;
 }
 
-long
-tos_dupcookie(dest, src)
-	fcookie *dest, *src;
+long ARGS_ON_STACK
+tos_dupcookie(fcookie *dest, fcookie *src)
 {
 	struct tindex *ti = (struct tindex *)src->index;
 
@@ -1692,7 +1690,7 @@
 MEDIA_DB(("calling GEMDOS"));
 #ifdef FSFIRST_MEDIACH
 	(void)Fsfirst(fname, 8);
-#else	
+#else
 	r = Fopen(fname, 0);
 	if (r >= 0) Fclose((int)r);
 #endif
diff --unified --rec /origmint/update.c ./update.c
--- /origmint/update.c	Sun Apr 23 12:08:58 1995
+++ ./update.c	Sun Apr 23 13:35:10 1995
@@ -8,14 +8,19 @@
  *     function called.
  */
 
-#include <mintbind.h>
+#ifndef __TURBOC__
+#	include <mintbind.h>
+#endif
 
 #include "mint.h"
 
-#ifndef Sync    /* temporary hack for gnu c */
-#ifdef __GNUC__
-#define Sync() (void)(trap_1_w(0x150))
-#endif
+#ifndef Sync    /* temporary hack */
+#	ifdef __GNUC__
+#		define Sync() (void)(trap_1_w(0x150))
+#	endif
+#	ifdef __TURBOC__
+#		define Sync()	gemdos(0x150)
+#	endif
 #endif
 
 long update_stksize = 1024;
@@ -29,6 +34,8 @@
 void
 do_sync(long sig)
 {
+	UNUSED (sig);
+
 	Sync();
 }
 
@@ -48,16 +55,16 @@
 
 	for (;;)
 	{
-		int tsync;
-		tsync = sync_time;
+		long tsync = sync_time;
+
 		while (tsync > 32)
 		{
-			(void)Fselect(32000, 0L, 0L, 0L);
+			Fselect(32000, 0L, 0L, 0L);
 			tsync -= 32;
 		}
-		if (tsync > 0)
-			(void)Fselect(tsync*1000L, 0L, 0L, 0L);
-			do_sync(0);
+		if (tsync > 0) Fselect ((int)tsync*1000, 0L, 0L, 0L);
+
+		do_sync(0);
 	}
 }
 
@@ -67,11 +74,10 @@
 start_sysupdate()
 {
 	BASEPAGE *b;
-	int pid;
 
 	b = (BASEPAGE*)p_exec(5, 0L, "", 0L);  /* create basepage */
-	(void)m_shrink(0, (virtaddr)b, 256+update_stksize);
+	m_shrink(0, (virtaddr)b, 256+update_stksize);
 	b->p_tbase = (long)update;
 	b->p_hitpa = (long)b +256+update_stksize;
-	pid = (short)p_exec(104, "sysupdate", b, 0L);
+	p_exec(104, "sysupdate", b, 0L);
 }

-- 
---------------------------------------------------
Julian F. Reschke, Hensenstr. 142, D-48161 Muenster
 eMail: reschke@math.uni-muenster.de jr@ms.maus.de
___________________________________________________