Browse Source

Libs ready to compile with gcc

Elbing Miss 9 years ago
parent
commit
863aa22a35
73 changed files with 363 additions and 342 deletions
  1. 1 1
      sys/include/String.h
  2. 1 1
      sys/include/disk.h
  3. 1 1
      sys/include/draw.h
  4. 1 1
      sys/include/html.h
  5. 42 42
      sys/include/libc.h
  6. 28 28
      sys/src/cmd/lex/ldefs.h
  7. 3 3
      sys/src/lib9p/srv.c
  8. 1 1
      sys/src/libauth/newns.c
  9. 4 4
      sys/src/libc/9sys/mkfile
  10. 3 4
      sys/src/libc/9syscall/mkfile
  11. 1 1
      sys/src/libc/amd64/cycles.c
  12. 32 31
      sys/src/libc/amd64/setjmp.s
  13. 0 2
      sys/src/libc/mkfile
  14. 1 1
      sys/src/libc/port/pool.c
  15. 1 1
      sys/src/libc/port/strcpy.c
  16. 2 2
      sys/src/libc/port/strlen.c
  17. 1 1
      sys/src/libc/port/strncpy.c
  18. 1 1
      sys/src/libc/port/strrchr.c
  19. 1 1
      sys/src/libcontrol/text.c
  20. 4 4
      sys/src/libdraw/stringbg.c
  21. 1 1
      sys/src/libflate/deflate.c
  22. 3 3
      sys/src/libhtml/build.c
  23. 2 2
      sys/src/libhtml/impl.h
  24. 19 19
      sys/src/libhttpd/parse.c
  25. 1 1
      sys/src/libhttpd/urlunesc.c
  26. 1 1
      sys/src/libip/eipfmt.c
  27. 1 1
      sys/src/libmach/0.c
  28. 2 1
      sys/src/libmach/5.c
  29. 1 1
      sys/src/libmach/5db.c
  30. 2 1
      sys/src/libmach/68020.c
  31. 2 1
      sys/src/libmach/8.c
  32. 2 1
      sys/src/libmach/9.c
  33. 2 1
      sys/src/libmach/alpha.c
  34. 3 3
      sys/src/libmach/alphadb.c
  35. 43 41
      sys/src/libmach/elf.h
  36. 33 12
      sys/src/libmach/executable.c
  37. 2 1
      sys/src/libmach/k.c
  38. 1 1
      sys/src/libmach/obj.h
  39. 2 1
      sys/src/libmach/q.c
  40. 1 1
      sys/src/libmach/qdb.c
  41. 1 1
      sys/src/libmach/sparc64.c
  42. 2 0
      sys/src/libmach/v.c
  43. 1 1
      sys/src/libmemdraw/defont.c
  44. 24 24
      sys/src/libmemdraw/draw.c
  45. 3 3
      sys/src/libmemdraw/ellipse.c
  46. 1 1
      sys/src/libmemdraw/hwdraw.c
  47. 1 1
      sys/src/libmemdraw/iprint.c
  48. 5 5
      sys/src/libmemdraw/load.c
  49. 1 1
      sys/src/libmemdraw/unload.c
  50. 3 19
      sys/src/libmp/amd64/mkfile
  51. 1 0
      sys/src/libmp/mkfile
  52. 1 1
      sys/src/libmp/port/mptouv.c
  53. 1 0
      sys/src/libndb/mkfile
  54. 1 1
      sys/src/libndb/ndbhf.h
  55. 1 1
      sys/src/liboventi/pack.c
  56. 6 6
      sys/src/liboventi/packet.h
  57. 3 3
      sys/src/liboventi/server.c
  58. 2 2
      sys/src/liboventi/session.h
  59. 1 1
      sys/src/libscribble/hre_api.c
  60. 17 17
      sys/src/libscribble/li_recognizer.c
  61. 1 1
      sys/src/libscribble/scribbleimpl.h
  62. 1 0
      sys/src/libsec/mkfile
  63. 5 5
      sys/src/libstdio/Stdio.h
  64. 1 1
      sys/src/libstdio/mkfile
  65. 7 6
      sys/src/libstdio/setvbuf.c
  66. 1 1
      sys/src/libsunrpc/nfs3.c
  67. 1 1
      sys/src/libthread/amd64.c
  68. 4 4
      sys/src/libthread/threadimpl.h
  69. 3 3
      sys/src/libventi/cvt.h
  70. 1 1
      sys/src/libventi/version.c
  71. 3 2
      sys/src/mkfile
  72. 5 3
      sys/src/mkfile.proto
  73. 1 1
      util/mksys.go

+ 1 - 1
sys/include/String.h

@@ -17,7 +17,7 @@ typedef struct String {
 	char	*end;	/* end of allocated space+1 */
 	char	*ptr;	/* ptr into String */
 	short	ref;
-	uchar	fixed;
+	unsigned char	fixed;
 } String;
 
 #define s_clone(s) s_copy((s)->base)

+ 1 - 1
sys/include/disk.h

@@ -17,7 +17,7 @@ struct Scsi {
 	char*	inquire;
 	int	rawfd;
 	int	nchange;
-	ulong	changetime;
+	unsigned long	changetime;
 };
 
 enum {

+ 1 - 1
sys/include/draw.h

@@ -293,7 +293,7 @@ struct Cacheinfo
 {
 	uint16_t		x;		/* left edge of bits */
 	uint8_t		width;		/* width of baseline */
-	schar		left;		/* offset of baseline */
+	int8_t		left;		/* offset of baseline */
 	Rune		value;	/* value of character at this slot in cache */
 	uint16_t		age;
 };

+ 1 - 1
sys/include/html.h

@@ -640,5 +640,5 @@ extern int	dbgbuild;
  * emalloc and erealloc should not return if can't get memory.
  * emalloc should zero its memory.
  */
-extern void*	emalloc(ulong);
+extern void*	emalloc(unsigned long);
 extern void*	erealloc(void* p, uint32_t size);

+ 42 - 42
sys/include/libc.h

@@ -11,7 +11,7 @@
 #pragma	src	"/sys/src/libc"
 
 #define	nelem(x)	(sizeof(x)/sizeof((x)[0]))
-#define	offsetof(s, m)	(ulong)(&(((s*)0)->m))
+#define	offsetof(s, m)	(unsigned long)(&(((s*)0)->m))
 #define	assert(x)	if(x){}else _assert("x")
 
 /*
@@ -19,33 +19,33 @@
  */
 extern	void*	memccpy(void*, void*, int, uint32_t);
 void*	memset(void*, int, unsigned long);
-//extern	int	memcmp(void*, void*, uint32_t);
-//extern	void*	memcpy(void*, void*, uint32_t);
+extern	int	memcmp(void*, void*, uint32_t);
+extern	void*	memcpy(void*, const void*, size_t);
 void*	memmove(void*, const void*, size_t);
-//extern	void*	memchr(void*, int, uint32_t);
+extern	void*	memchr(void*, int, uint32_t);
 
 /*
  * string routines
  */
-//extern	char*	strcat(char*, char*);
-//extern	char*	strchr(char*, int);
-//extern	int	strcmp(char*, char*);
+extern	char*	strcat(char*, char*);
+extern	char*	strchr(char*, int);
+extern	int	strcmp(char*, char*);
 char*	strcpy(char*, const char*);
 extern	char*	strecpy(char*, char*, char*);
-//extern	char*	strdup(char*);
-//extern	char*	strncat(char*, char*, int32_t);
+extern	char*	strdup(char*);
+extern	char*	strncat(char*, char*, int32_t);
 char*	strncpy(char*, const char*, unsigned long);
-//extern	int	strncmp(char*, char*, int32_t);
-//extern	char*	strpbrk(char*, char*);
+extern	int	strncmp(char*, char*, int32_t);
+extern	char*	strpbrk(char*, char*);
 char*	strrchr(const char*, int);
-//extern	char*	strtok(char*, char*);
+extern	char*	strtok(char*, char*);
 unsigned long	strlen(const char*);
-//extern	int32_t	strspn(char*, char*);
-//extern	int32_t	strcspn(char*, char*);
-//extern	char*	strstr(char*, char*);
-//extern	int	cistrncmp(char*, char*, int);
-//extern	int	cistrcmp(char*, char*);
-//extern	char*	cistrstr(char*, char*);
+extern	int32_t	strspn(char*, char*);
+extern	int32_t	strcspn(char*, char*);
+extern	char*	strstr(char*, char*);
+extern	int	cistrncmp(char*, char*, int);
+extern	int	cistrcmp(char*, char*);
+extern	char*	cistrstr(char*, char*);
 extern	int	tokenize(char*, char**, int);
 
 enum
@@ -73,18 +73,18 @@ extern	char*	utfrrune(char*, int32_t);
 extern	char*	utfutf(char*, char*);
 extern	char*	utfecpy(char*, char*, char*);
 
-//extern	Rune*	runestrcat(Rune*, Rune*);
-//extern	Rune*	runestrchr(Rune*, Rune);
-//extern	int	runestrcmp(Rune*, Rune*);
-//extern	Rune*	runestrcpy(Rune*, Rune*);
-//extern	Rune*	runestrncpy(Rune*, Rune*, int32_t);
+extern	Rune*	runestrcat(Rune*, Rune*);
+extern	Rune*	runestrchr(Rune*, Rune);
+extern	int	runestrcmp(Rune*, Rune*);
+extern	Rune*	runestrcpy(Rune*, Rune*);
+extern	Rune*	runestrncpy(Rune*, Rune*, int32_t);
 extern	Rune*	runestrecpy(Rune*, Rune*, Rune*);
-//extern	Rune*	runestrdup(Rune*);
-//extern	Rune*	runestrncat(Rune*, Rune*, int32_t);
-//extern	int	runestrncmp(Rune*, Rune*, int32_t);
-//extern	Rune*	runestrrchr(Rune*, Rune);
-//extern	int32_t	runestrlen(Rune*);
-//extern	Rune*	runestrstr(Rune*, Rune*);
+extern	Rune*	runestrdup(Rune*);
+extern	Rune*	runestrncat(Rune*, Rune*, int32_t);
+extern	int	runestrncmp(Rune*, Rune*, int32_t);
+extern	Rune*	runestrrchr(Rune*, Rune);
+extern	int32_t	runestrlen(Rune*);
+extern	Rune*	runestrstr(Rune*, Rune*);
 
 extern	Rune	tolowerrune(Rune);
 extern	Rune	totitlerune(Rune);
@@ -99,15 +99,15 @@ extern	int	istitlerune(Rune);
 extern	int	isupperrune(Rune);
 
 /*
-// * malloc
+ * malloc
  */
-//extern	void*	malloc(uint32_t);
-//extern	void*	mallocz(uint32_t, int);
+extern	void*	malloc(size_t);
+extern	void*	mallocz(uint32_t, int);
 extern	void	free(void*);
 extern	uint32_t	msize(void*);
-//extern	void*	mallocalign(uint32_t, uint32_t, int32_t, uint32_t);
-//extern	void*	calloc(uint32_t, uint32_t);
-//extern	void*	realloc(void*, uint32_t);
+extern	void*	mallocalign(uint32_t, uint32_t, int32_t, uint32_t);
+extern	void*	calloc(uint32_t, size_t);
+extern	void*	realloc(void*, size_t);
 void	setmalloctag(void*, uint32_t);
 void	setrealloctag(void*, uint32_t);
 uint32_t	getmalloctag(void*);
@@ -242,8 +242,8 @@ extern	int	dorfmt(Fmt*, Rune*);
 extern	int	fmtprint(Fmt*, char*, ...);
 extern	int	fmtvprint(Fmt*, char*, va_list);
 extern	int	fmtrune(Fmt*, int);
-//extern	int	fmtstrcpy(Fmt*, char*);
-//extern	int	fmtrunestrcpy(Fmt*, Rune*);
+extern	int	fmtstrcpy(Fmt*, char*);
+extern	int	fmtrunestrcpy(Fmt*, Rune*);
 /*
  * error string for %r
  * supplied on per os basis, not part of fmt library
@@ -253,10 +253,10 @@ extern	int	errfmt(Fmt *f);
 /*
  * quoted strings
  */
-//extern	char	*unquotestrdup(char*);
-//extern	Rune	*unquoterunestrdup(Rune*);
-//extern	char	*quotestrdup(char*);
-//extern	Rune	*quoterunestrdup(Rune*);
+extern	char	*unquotestrdup(char*);
+extern	Rune	*unquoterunestrdup(Rune*);
+extern	char	*quotestrdup(char*);
+extern	Rune	*quoterunestrdup(Rune*);
 extern	int	quotestrfmt(Fmt*);
 extern	int	quoterunestrfmt(Fmt*);
 extern	void	quotefmtinstall(void);
@@ -382,7 +382,7 @@ extern	int	gettokens(char *, char **, int, char *);
 extern	char*	getuser(void);
 extern	char*	getwd(char*, int);
 extern	int	iounit(int);
-//extern	int32_t	labs(int32_t);
+extern	int32_t	labs(int32_t);
 extern	double	ldexp(double, int);
 extern	void	longjmp(jmp_buf, int);
 extern	char*	mktemp(char*);

+ 28 - 28
sys/src/cmd/lex/ldefs.h

@@ -75,7 +75,7 @@ extern int	freturn(int);
 
 extern int sargc;
 extern char **sargv;
-extern uchar buf[520];
+extern unsigned char buf[520];
 extern int yyline;		/* line number of file */
 extern char *yyfile;		/* file name of file */
 extern int sect;
@@ -98,41 +98,41 @@ extern int *name;
 extern int *left;
 extern int *right;
 extern int *parent;
-extern uchar **ptr;
-extern uchar *nullstr;
+extern unsigned char **ptr;
+extern unsigned char *nullstr;
 extern int tptr;
-extern uchar pushc[TOKENSIZE];
-extern uchar *pushptr;
-extern uchar slist[STARTSIZE];
-extern uchar *slptr;
-extern uchar **def, **subs, *dchar;
-extern uchar **sname, *stchar;
-extern uchar *ccl;
-extern uchar *ccptr;
-extern uchar *dp, *sp;
+extern unsigned char pushc[TOKENSIZE];
+extern unsigned char *pushptr;
+extern unsigned char slist[STARTSIZE];
+extern unsigned char *slptr;
+extern unsigned char **def, **subs, *dchar;
+extern unsigned char **sname, *stchar;
+extern unsigned char *ccl;
+extern unsigned char *ccptr;
+extern unsigned char *dp, *sp;
 extern int dptr, sptr;
-extern uchar *bptr;		/* store input position */
-extern uchar *tmpstat;
+extern unsigned char *bptr;		/* store input position */
+extern unsigned char *tmpstat;
 extern int count;
 extern int **foll;
 extern int *nxtpos;
 extern int *positions;
 extern int *gotof;
 extern int *nexts;
-extern uchar *nchar;
+extern unsigned char *nchar;
 extern int **state;
 extern int *sfall;		/* fallback state num */
-extern uchar *cpackflg;		/* true if state has been character packed */
+extern unsigned char *cpackflg;		/* true if state has been character packed */
 extern int *atable, aptr;
 extern int nptr;
-extern uchar symbol[NCH];
-extern uchar cindex[NCH];
+extern unsigned char symbol[NCH];
+extern unsigned char cindex[NCH];
 extern int xstate;
 extern int stnum;
 extern int ccount;
-extern uchar match[NCH];
-extern uchar extra[NACTIONS];
-extern uchar *pcptr, *pchar;
+extern unsigned char match[NCH];
+extern unsigned char extra[NACTIONS];
+extern unsigned char *pcptr, *pchar;
 extern int pchlen;
 extern int nstates, maxpos;
 extern int yytop;
@@ -141,7 +141,7 @@ extern int ntrans, treesize, outsize;
 extern long rcount;
 extern int *verify, *advance, *stoff;
 extern int scon;
-extern uchar *psave;
+extern unsigned char *psave;
 
 extern void	acompute(int);
 extern void	add(int **, int);
@@ -155,22 +155,22 @@ extern void	error(char *,...);
 extern void	first(int);
 extern void	follow(int);
 extern int	gch(void);
-extern uchar	*getl(uchar *);
+extern unsigned char	*getl(unsigned char *);
 extern void	layout(void);
 extern void	lgate(void);
-extern int	lookup(uchar *, uchar **);
-extern int	member(int, uchar *);
+extern int	lookup(unsigned char *, unsigned char **);
+extern int	member(int, unsigned char *);
 extern void	mkmatch(void);
 extern int	mn0(int);
 extern int	mn1(int, int);
 extern int	mnp(int, void*);
 extern int	mn2(int, int, uintptr);
 extern void	munputc(int);
-extern void	munputs(uchar *);
+extern void	munputs(unsigned char *);
 extern void	*myalloc(int, int);
 extern void	nextstate(int, int);
 extern int	notin(int);
-extern void	packtrans(int, uchar *, int *, int, int);
+extern void	packtrans(int, unsigned char *, int *, int, int);
 extern void	padd(int **, int);
 extern void	pccl(void);
 extern void	pfoll(void);
@@ -182,7 +182,7 @@ extern void	sect1dump(void);
 extern void	sect2dump(void);
 extern void	statistics(void);
 extern void	stprt(int);
-extern void	strpt(uchar *);
+extern void	strpt(unsigned char *);
 extern void	treedump(void);
 extern int	usescape(int);
 extern void	warning(char *,...);

+ 3 - 3
sys/src/lib9p/srv.c

@@ -173,7 +173,7 @@ walkandclone(Req *r, char *(*walk1)(Fid*, char*, void*),
 }
 
 static void
-sversion(Srv*, Req *r)
+sversion(Srv* s, Req *r)
 {
 	if(strncmp(r->ifcall.version, "9P", 2) != 0){
 		r->ofcall.version = "unknown";
@@ -560,7 +560,7 @@ sclunk(Srv *srv, Req *r)
 		respond(r, nil);
 }
 static void
-rclunk(Req*, char*)
+rclunk(Req* r, char* c)
 {
 }
 
@@ -688,7 +688,7 @@ swstat(Srv *srv, Req *r)
 	srv->wstat(r);
 }
 static void
-rwstat(Req*, char*)
+rwstat(Req* r, char* c)
 {
 }
 

+ 1 - 1
sys/src/libauth/newns.c

@@ -154,7 +154,7 @@ static int
 nsop(char *fn, int argc, char *argv[], AuthRpc *rpc)
 {
 	char *argv0;
-	ulong flags;
+	unsigned long flags;
 	int fd, i;
 	Biobuf *b;
 	int cdroot;

+ 4 - 4
sys/src/libc/9sys/mkfile

@@ -1,6 +1,6 @@
-<$ROOT/$objtype/mkfile
+</$objtype/mkfile
 
-LIB=$ROOT/$objtype/lib/libc.a
+LIB=/$objtype/lib/libc.a
 OFILES=\
 	abort.$O\
 	access.$O\
@@ -52,12 +52,12 @@ OFILES=\
 	write.$O\
 	writev.$O\
 
-HFILES=$ROOT/sys/include/libc.h
+HFILES=/sys/include/libc.h
 
 UPDATE=\
 	mkfile\
 	$HFILES\
 	${OFILES:%.$O=%.c}\
 
-<$ROOT/sys/src/cmd/mksyslib
+</sys/src/cmd/mksyslib
 

+ 3 - 4
sys/src/libc/9syscall/mkfile

@@ -1,12 +1,11 @@
-MKSHELL=$PLAN9/bin/rc
 NPROC=1
-<$ROOT/$objtype/mkfile
+</$objtype/mkfile
 
 # Note that mksys needs to be in your path, somewhere.
 install:V:
 	mksys $objtype
-	$(AS) -c *.s
-	ar rvu $ROOT/$objtype/lib/libc.a *.$O
+	$CC -c *.s
+	$AR rv /$objtype/lib/libc.a *.$O
 	rm -f *.o *.[$OS] *.s
 
 nuke clean:V:

+ 1 - 1
sys/src/libc/amd64/cycles.c

@@ -1,7 +1,7 @@
 #include <u.h>
 #include <libc.h>
 
-void _cycles(uvlong *x)
+void _cycles(uint64_t *x)
 {
         uint32_t a, d;
 

+ 32 - 31
sys/src/libc/amd64/setjmp.s

@@ -1,31 +1,32 @@
-.text
-
-.globl longjmp
-longjmp:
-        movl    16(%esp), %eax   /* r */
-        cmpl    $0, %eax
-        jne     ok              /* ansi: "longjmp(0) => longjmp(1)" */
-        movl    $1, %eax                /* bless their pointed heads */
-ok:
-        movq    8(%rsp), %rdx           /* l */
-        movq    0(%rdx), %rsp           /* restore sp */
-        movq    8(%rdx), %rbx           /* put return pc on the stack */
-        movq    %rbx, 0(%rsp)
-        movq    16(%rdx), %rbx           /* restore bx */
-        movq    20(%rdx), %rsi          /* restore si */
-        movq    24(%rdx), %rdi          /* restore di */
-        movq    28(%rdx), %rbp  /* restore bp */
-        ret
-
-.globl setjmp
-setjmp:
-        movq    8(%rsp), %rdx           /* l */
-        movq    %rsp, 0(%rdx)           /* store sp */
-        movq    0(%rsp), %rax           /* store return pc */
-        movq    %rax, 8(%rdx)
-        movq    %rbx, 16(%rdx)           /* store bx */
-        movq    %rsi, 20(%rdx)          /* store si */
-        movq    %rdi, 24(%rdx)          /* store di */
-        movq    %rbp, 28(%rdx)  /* store bp */
-        movq    $0, %rax                        /* return 0 */
-        ret
+.text
+
+.globl longjmp
+longjmp:
+        movq    0(%rdi), %rbx
+        movq    8(%rdi), %r12
+        movq    16(%rdi), %r13
+        movq    24(%rdi), %r14
+        movq    32(%rdi), %r15
+        movq    40(%rdi), %rbp
+        movq    48(%rdi), %rsp
+        movl    %esi, %eax
+        test    %eax, %eax      /* if val != 0          */
+        jnz     1f              /*      return val      */
+        incl    %eax            /* else return 1        */
+1:
+        movq    56(%rdi), %rdx  /* return to caller of setjmp */
+        jmp     *%rdx
+
+.globl setjmp
+setjmp:
+        movq    %rbx, 0(%rdi)
+        movq    %r12, 8(%rdi)
+        movq    %r13, 16(%rdi)
+        movq    %r14, 24(%rdi)
+        movq    %r15, 32(%rdi)
+        movq    %rbp, 40(%rdi)
+        popq    %rdx            /* return address */
+        movq    %rsp, 48(%rdi)
+        movq    %rdx, 56(%rdi)
+        xorl    %eax, %eax      /* return 0 */
+        jmp     *%rdx

+ 0 - 2
sys/src/libc/mkfile

@@ -1,6 +1,4 @@
-# You need to setup this environment variable pointing to your plan9port path
 MKSHELL=$PLAN9/bin/rc
-
 </$objtype/mkfile
 
 PORTDIRS=9sys 9syscall fmt port

+ 1 - 1
sys/src/libc/port/pool.c

@@ -1251,7 +1251,7 @@ poolalloc(Pool *p, uint32_t n)
 }
 
 void*
-poolallocalign(Pool *p, uint32_t n, uint32_t align, long offset,
+poolallocalign(Pool *p, uint32_t n, uint32_t align, int32_t offset,
 	       uint32_t span)
 {
 	void *v;

+ 1 - 1
sys/src/libc/port/strcpy.c

@@ -12,7 +12,7 @@
 #define	N	10000
 
 char*
-strcpy(char *s1, char *s2)
+strcpy(char *s1, const char *s2)
 {
 	char *os1;
 

+ 2 - 2
sys/src/libc/port/strlen.c

@@ -10,8 +10,8 @@
 #include <u.h>
 #include <libc.h>
 
-int32_t
-strlen(char *s)
+unsigned long
+strlen(const char *s)
 {
 
 	return strchr(s, 0) - s;

+ 1 - 1
sys/src/libc/port/strncpy.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 
 char*
-strncpy(char *s1, char *s2, int32_t n)
+strncpy(char *s1, const char *s2, unsigned long n)
 {
 	int i;
 	char *os1;

+ 1 - 1
sys/src/libc/port/strrchr.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 
 char*
-strrchr(char *s, int c)
+strrchr(const char *s, int c)
 {
 	char *r;
 

+ 1 - 1
sys/src/libcontrol/text.c

@@ -36,7 +36,7 @@ struct Text
 	Rune		**line;
 	int		selectmode;	// Selsingle, Selmulti
 	int		selectstyle;	// Seldown, Selup (use Selup only with Selsingle)
-	uchar	*selected;
+	uint8_t	*selected;
 	int		nline;
 	int		warp;
 	int		align;

+ 4 - 4
sys/src/libdraw/stringbg.c

@@ -20,7 +20,7 @@ stringbg(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s,
 
 Point
 stringbgop(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s,
-	   Image *bg, Point bgp, int op)
+	   Image *bg, Point bgp, Drawop op)
 {
 	return _string(dst, pt, src, sp, f, s, nil, 1<<24, dst->clipr, bg, bgp, op);
 }
@@ -34,7 +34,7 @@ stringnbg(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s,
 
 Point
 stringnbgop(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s,
-	    int len, Image *bg, Point bgp, int op)
+	    int len, Image *bg, Point bgp, Drawop op)
 {
 	return _string(dst, pt, src, sp, f, s, nil, len, dst->clipr, bg, bgp, op);
 }
@@ -46,7 +46,7 @@ runestringbg(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r, Image
 }
 
 Point
-runestringbgop(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r, Image *bg, Point bgp, int op)
+runestringbgop(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r, Image *bg, Point bgp, Drawop op)
 {
 	return _string(dst, pt, src, sp, f, nil, r, 1<<24, dst->clipr, bg, bgp, op);
 }
@@ -58,7 +58,7 @@ runestringnbg(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r, int
 }
 
 Point
-runestringnbgop(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r, int len, Image *bg, Point bgp, int op)
+runestringnbgop(Image *dst, Point pt, Image *src, Point sp, Font *f, Rune *r, int len, Image *bg, Point bgp, Drawop op)
 {
 	return _string(dst, pt, src, sp, f, nil, r, len, dst->clipr, bg, bgp, op);
 }

+ 1 - 1
sys/src/libflate/deflate.c

@@ -91,7 +91,7 @@ enum
 /*
 #define hashit(c)	(((ulong)(c) * 0x6b43a9) >> (24 - HashLog))
 */
-#define hashit(c)	((((ulong)(c) & 0xffffff) * 0x6b43a9b5) >> (32 - HashLog))
+#define hashit(c)	((((unsigned long)(c) & 0xffffff) * 0x6b43a9b5) >> (32 - HashLog))
 
 /*
  * lempel-ziv style compression state

+ 3 - 3
sys/src/libhtml/build.c

@@ -167,7 +167,7 @@ enum {
 // If we want a line of space before the given element, SPBefore is OR'd in.
 // If we want a line of space after the given element, SPAfter is OR'd in.
 
-static uchar blockbrk[Numtags]= {
+static unsigned char blockbrk[Numtags]= {
 	[Taddress] BLBA, [Tblockquote] BLBA, [Tcenter] BL,
 	[Tdir] BLBA, [Tdiv] BL, [Tdd] BL, [Tdl] BLBA,
 	[Tdt] BL, [Tform] BLBA,
@@ -185,7 +185,7 @@ enum {
 
 // attrinfo is information about attributes.
 // The AGEN value means that the attribute is generic (applies to almost all elements)
-static uchar attrinfo[Numattrs]= {
+static unsigned char attrinfo[Numattrs]= {
 	[Aid] AGEN, [Aclass] AGEN, [Astyle] AGEN, [Atitle] AGEN,
 	[Aonblur] AGEN, [Aonchange] AGEN, [Aonclick] AGEN,
 	[Aondblclick] AGEN, [Aonfocus] AGEN, [Aonkeypress] AGEN,
@@ -195,7 +195,7 @@ static uchar attrinfo[Numattrs]= {
 	[Aonsubmit] AGEN, [Aonunload] AGEN
 };
 
-static uchar scriptev[Numattrs]= {
+static unsigned char scriptev[Numattrs]= {
 	[Aonblur] SEonblur, [Aonchange] SEonchange, [Aonclick] SEonclick,
 	[Aondblclick] SEondblclick, [Aonfocus] SEonfocus, [Aonkeypress] SEonkeypress,
 	[Aonkeyup] SEonkeyup, [Aonload] SEonload, [Aonmousedown] SEonmousedown,

+ 2 - 2
sys/src/libhtml/impl.h

@@ -47,7 +47,7 @@ extern Rune*	_Strndup(Rune* s, int n);
 extern Rune*	_Strnrclass(Rune* s, Rune* cl, int n);
 extern Rune*	_Strrclass(Rune* s, Rune* cl);
 extern Rune*	_Strsubstr(Rune* s, int start, int stop);
-extern long	_Strtol(Rune* s, Rune** eptr, int base);
+extern int32_t	_Strtol(Rune* s, Rune** eptr, int base);
 extern void	_trimwhite(Rune* s, int n, Rune** pans, int* panslen);
 
 extern Rune*	notwhitespace;
@@ -163,7 +163,7 @@ extern Rune*	tagnames[];
 extern Rune*	attrnames[];
 
 extern void	_freetokens(Token* tarray, int n);
-extern Token*	_gettoks(uchar* data, int datalen, int chset, int mtype, int* plen);
+extern Token*	_gettoks(unsigned char* data, int datalen, int chset, int mtype, int* plen);
 extern int		_tokaval(Token* t, int attid, Rune** pans, int xfer);
 
 #pragma varargck	type "T"	Token*

+ 19 - 19
sys/src/libhttpd/parse.c

@@ -145,7 +145,7 @@ hreqcleanup(HConnect *c)
  * restarts parsing if necessary.
  */
 static void
-mimeconnection(Hlex *h, char *)
+mimeconnection(Hlex *h, char *c)
 {
 	char *u, *p;
 	int reparse, i;
@@ -515,27 +515,27 @@ mimeacceptlang(Hlex *h, char *name)
 }
 
 static void
-mimemodified(Hlex *h, char *)
+mimemodified(Hlex *h, char *name)
 {
 	lexhead(h);
 	h->c->head.ifmodsince = hdate2sec(h->wordval);
 }
 
 static void
-mimeunmodified(Hlex *h, char *)
+mimeunmodified(Hlex *h, char *name)
 {
 	lexhead(h);
 	h->c->head.ifunmodsince = hdate2sec(h->wordval);
 }
 
 static void
-mimematch(Hlex *h, char *)
+mimematch(Hlex *h, char *name)
 {
 	h->c->head.ifmatch = mimeetag(h, h->c->head.ifmatch);
 }
 
 static void
-mimenomatch(Hlex *h, char *)
+mimenomatch(Hlex *h, char *name)
 {
 	h->c->head.ifnomatch = mimeetag(h, h->c->head.ifnomatch);
 }
@@ -544,7 +544,7 @@ mimenomatch(Hlex *h, char *)
  * argument is either etag or date
  */
 static void
-mimeifrange(Hlex *h, char *)
+mimeifrange(Hlex *h, char *name)
 {
 	int c, d, et;
 
@@ -570,7 +570,7 @@ mimeifrange(Hlex *h, char *)
 }
 
 static void
-mimerange(Hlex *h, char *)
+mimerange(Hlex *h, char *name)
 {
 	h->c->head.range = mimeranges(h, h->c->head.range);
 }
@@ -579,7 +579,7 @@ mimerange(Hlex *h, char *)
  * parse it like cookies
  */
 static void
-authdigest(Hlex *h, char *)
+authdigest(Hlex *h, char *name)
 {
 	char *s;
 	HSPairs *p;
@@ -608,7 +608,7 @@ breakout:
  * username ":" password
  */
 static void
-authbasic(Hlex *h, char *)
+authbasic(Hlex *h, char *name)
 {
 	char *up, *p;
 	int n;
@@ -645,7 +645,7 @@ authbasic(Hlex *h, char *)
  * "Authorization" ":" "Basic" | "Digest" ...
  */
 static void
-mimeauthorization(Hlex *h, char *)
+mimeauthorization(Hlex *h, char *name)
 {
 	int i;
 	static MimeHead authparser[] = {
@@ -664,20 +664,20 @@ mimeauthorization(Hlex *h, char *)
 }
 
 static void
-mimeagent(Hlex *h, char *)
+mimeagent(Hlex *h, char *name)
 {
 	lexhead(h);
 	h->c->head.client = hstrdup(h->c, h->wordval);
 }
 
 static void
-mimefrom(Hlex *h, char *)
+mimefrom(Hlex *h, char *name)
 {
 	lexhead(h);
 }
 
 static void
-mimehost(Hlex *h, char *)
+mimehost(Hlex *h, char *name)
 {
 	char *hd;
 
@@ -692,7 +692,7 @@ mimehost(Hlex *h, char *)
  * "content-length" ":" digits
  */
 static void
-mimecontlen(Hlex *h, char *)
+mimecontlen(Hlex *h, char *name)
 {
 	char *e;
 	uint32_t v;
@@ -714,7 +714,7 @@ mimecontlen(Hlex *h, char *)
  * for now, we merely parse "100-continue" or anything else.
  */
 static void
-mimeexpect(Hlex *h, char *)
+mimeexpect(Hlex *h, char *name)
 {
 	if(lex(h) != Word || cistrcmp(h->wordval, "100-continue") != 0 || lex(h) != '\n')
 		h->c->head.expectother = 1;
@@ -722,13 +722,13 @@ mimeexpect(Hlex *h, char *)
 }
 
 static void
-mimetransenc(Hlex *h, char *)
+mimetransenc(Hlex *h, char *name)
 {
 	h->c->head.transenc = mimehfields(h);
 }
 
 static void
-mimecookie(Hlex *h, char *)
+mimecookie(Hlex *h, char *name)
 {
 	char *s;
 	HSPairs *p;
@@ -749,7 +749,7 @@ breakout:
 }
 
 static void
-mimefresh(Hlex *h, char *)
+mimefresh(Hlex *h, char *name)
 {
 	char *s;
 
@@ -763,7 +763,7 @@ mimefresh(Hlex *h, char *)
 }
 
 static void
-mimeignore(Hlex *h, char *)
+mimeignore(Hlex *h, char *name)
 {
 	lexhead(h);
 }

+ 1 - 1
sys/src/libhttpd/urlunesc.c

@@ -57,7 +57,7 @@ hurlunesc(HConnect *cc, char *s)
 	while(*s){
 		/* in decoding error, assume latin1 */
 		if((n=chartorune(&r, s)) == 1 && r == Runeerror)
-			r = (uchar)*s;
+			r = (unsigned char)*s;
 		s += n;
 		t += runetochar(t, &r);
 	}

+ 1 - 1
sys/src/libip/eipfmt.c

@@ -16,7 +16,7 @@ enum
 	Isprefix= 16,
 };
 
-uchar prefixvals[256] =
+unsigned char prefixvals[256] =
 {
 [0x00] 0 | Isprefix,
 [0x80] 1 | Isprefix,

+ 1 - 1
sys/src/libmach/0.c

@@ -19,7 +19,7 @@
 #include <mach.h>
 
 #define	FPREGBYTES	4
-#define	REGOFF(x)	(ulong)(&((struct Ureg *) 0)->x)
+#define	REGOFF(x)	(unsigned long)(&((struct Ureg *) 0)->x)
 
 #define SP		REGOFF(sp)
 #define PC		REGOFF(pc)

+ 2 - 1
sys/src/libmach/5.c

@@ -6,7 +6,7 @@
  * modified, propagated, or distributed except according to the terms contained
  * in the LICENSE file.
  */
-
+#ifdef HARVEYARM
 /*
  * arm definition
  */
@@ -71,3 +71,4 @@ Mach marm =
 	4,		/* szfloat */
 	8,		/* szdouble */
 };
+#endif

+ 1 - 1
sys/src/libmach/5db.c

@@ -16,7 +16,7 @@ static int debug = 0;
 
 #define	BITS(a, b)	((1<<(b+1))-(1<<a))
 
-#define LSR(v, s)	((ulong)(v) >> (s))
+#define LSR(v, s)	((unsigned long)(v) >> (s))
 #define ASR(v, s)	((int32_t)(v) >> (s))
 #define ROR(v, s)	(LSR((v), (s)) | (((v) & ((1 << (s))-1)) << (32 - (s))))
 

+ 2 - 1
sys/src/libmach/68020.c

@@ -6,7 +6,7 @@
  * modified, propagated, or distributed except according to the terms contained
  * in the LICENSE file.
  */
-
+#ifdef HARVEYNEXT
 /*
  * 68020 definition
  */
@@ -94,3 +94,4 @@ Mach m68020 =
 	4,		/* szfloat */
 	8,		/* szdouble */
 };
+#endif

+ 2 - 1
sys/src/libmach/8.c

@@ -6,7 +6,7 @@
  * modified, propagated, or distributed except according to the terms contained
  * in the LICENSE file.
  */
-
+#ifdef HARVEY32
 /*
  * 386 definition
  */
@@ -87,3 +87,4 @@ Mach mi386 =
 	4,		/* szfloat */
 	8,		/* szdouble */
 };
+#endif

+ 2 - 1
sys/src/libmach/9.c

@@ -6,7 +6,7 @@
  * modified, propagated, or distributed except according to the terms contained
  * in the LICENSE file.
  */
-
+#ifdef HARVEYPPC64
 /*
  * PowerPC 64 definition
  *	forsyth@vitanuova.com
@@ -128,3 +128,4 @@ Mach mpower64 =
 	4,			/* szfloat */
 	8,			/* szdouble */
 };
+#endif

+ 2 - 1
sys/src/libmach/alpha.c

@@ -6,7 +6,7 @@
  * modified, propagated, or distributed except according to the terms contained
  * in the LICENSE file.
  */
-
+#ifdef HARVEYALPHA
 /*
  * alpha definition
  */
@@ -122,3 +122,4 @@ Mach malpha =
 	4,		/* szfloat */
 	8,		/* szdouble */
 };
+#endif

+ 3 - 3
sys/src/libmach/alphadb.c

@@ -604,7 +604,7 @@ static Opcode ieeeopcodes[64] = {
 	"???",		0,	alphaxxx,
 };
 
-static uchar	amap[128] = {
+static unsigned char	amap[128] = {
 	[0x00]	1,
 	[0x40]	2,
 	[0x20]	3,
@@ -655,7 +655,7 @@ static Opcode arithopcodes[64] = {
 	"S8SUBQ",	0,	alphaint,
 };
 
-static uchar	lmap[128] = {
+static unsigned char	lmap[128] = {
 	[0x00]	1,
 	[0x20]	2,
 	[0x40]	3,
@@ -690,7 +690,7 @@ static Opcode logicalopcodes[64] = {
 	"CMOVLBC",	0,	alphaint,
 };
 
-static uchar	smap[128] = {
+static unsigned char	smap[128] = {
 	[0x39]	1,
 	[0x3C]	2,
 	[0x34]	3,

+ 43 - 41
sys/src/libmach/elf.h

@@ -10,38 +10,40 @@
 /*
  *	Definitions needed for accessing ELF headers
  */
+#ifdef HARVEY32
 typedef struct {
-	uchar	ident[16];	/* ident bytes */
-	ushort	type;		/* file type */
-	ushort	machine;	/* target machine */
+	unsigned char	ident[16];	/* ident bytes */
+	unsigned short	type;	/* file type */
+	unsigned short	machine;	/* target machine */
 	int	version;	/* file version */
 	uint32_t	elfentry;	/* start address */
 	uint32_t	phoff;		/* phdr file offset */
 	uint32_t	shoff;		/* shdr file offset */
 	int	flags;		/* file flags */
-	ushort	ehsize;		/* sizeof ehdr */
-	ushort	phentsize;	/* sizeof phdr */
-	ushort	phnum;		/* number phdrs */
-	ushort	shentsize;	/* sizeof shdr */
-	ushort	shnum;		/* number shdrs */
-	ushort	shstrndx;	/* shdr string index */
+	unsigned short	ehsize;		/* sizeof ehdr */
+	unsigned short	phentsize;	/* sizeof phdr */
+	unsigned short	phnum;		/* number phdrs */
+	unsigned short	shentsize;	/* sizeof shdr */
+	unsigned short	shnum;		/* number shdrs */
+	unsigned short	shstrndx;	/* shdr string index */
 } Ehdr;
+#endif
 
 typedef struct {
-	u8int	ident[16];	/* ident bytes */
-	u16int	type;		/* file type */
-	u16int	machine;	/* target machine */
-	u32int	version;	/* file version */
-	u64int	elfentry;	/* start address */
-	u64int	phoff;		/* phdr file offset */
-	u64int	shoff;		/* shdr file offset */
-	u32int	flags;		/* file flags */
-	u16int	ehsize;		/* sizeof ehdr */
-	u16int	phentsize;	/* sizeof phdr */
-	u16int	phnum;		/* number phdrs */
-	u16int	shentsize;	/* sizeof shdr */
-	u16int	shnum;		/* number shdrs */
-	u16int	shstrndx;	/* shdr string index */
+	uint8_t		ident[16];	/* ident bytes */
+	uint16_t	type;		/* file type */
+	uint16_t	machine;	/* target machine */
+	uint32_t	version;	/* file version */
+	uint64_t	elfentry;	/* start address */
+	uint64_t	phoff;		/* phdr file offset */
+	uint64_t	shoff;		/* shdr file offset */
+	uint32_t	flags;		/* file flags */
+	uint16_t	ehsize;		/* sizeof ehdr */
+	uint16_t	phentsize;	/* sizeof phdr */
+	uint16_t	phnum;		/* number phdrs */
+	uint16_t	shentsize;	/* sizeof shdr */
+	uint16_t	shnum;		/* number shdrs */
+	uint16_t	shstrndx;	/* shdr string index */
 } E64hdr;
 
 typedef struct {
@@ -56,14 +58,14 @@ typedef struct {
 } Phdr;
 
 typedef struct {
-	u32int	type;		/* entry type */
-	u32int	flags;		/* entry flags */
-	u64int	offset;		/* file offset */
-	u64int	vaddr;		/* virtual address */
-	u64int	paddr;		/* physical address */
-	u64int	filesz;		/* file size */
-	u64int	memsz;		/* memory size */
-	u64int	align;		/* memory/file alignment */
+	uint32_t	type;		/* entry type */
+	uint32_t	flags;		/* entry flags */
+	uint64_t	offset;		/* file offset */
+	uint64_t	vaddr;		/* virtual address */
+	uint64_t	paddr;		/* physical address */
+	uint64_t	filesz;		/* file size */
+	uint64_t	memsz;		/* memory size */
+	uint64_t	align;		/* memory/file alignment */
 } P64hdr;
 
 typedef struct {
@@ -80,16 +82,16 @@ typedef struct {
 } Shdr;
 
 typedef struct {
-	u32int	name;		/* section name */
-	u32int	type;		/* SHT_... */
-	u64int	flags;		/* SHF_... */
-	u64int	addr;		/* virtual address */
-	u64int	offset;		/* file offset */
-	u64int	size;		/* section size */
-	u32int	link;		/* misc info */
-	u32int	info;		/* misc info */
-	u64int	addralign;	/* memory alignment */
-	u64int	entsize;	/* entry size if table */
+	uint32_t	name;		/* section name */
+	uint32_t	type;		/* SHT_... */
+	uint64_t	flags;		/* SHF_... */
+	uint64_t	addr;		/* virtual address */
+	uint64_t	offset;		/* file offset */
+	uint64_t	size;		/* section size */
+	uint32_t	link;		/* misc info */
+	uint32_t	info;		/* misc info */
+	uint64_t	addralign;	/* memory alignment */
+	uint64_t	entsize;	/* entry size if table */
 } S64hdr;
 
 enum {

+ 33 - 12
sys/src/libmach/executable.c

@@ -23,9 +23,11 @@ typedef struct {
 	union{
 		struct {
 			Exec;		/* a.out.h */
-			uvlong hdr[1];
+			unsigned long long hdr[1];
 		};
+#ifdef HARVEY32
 		Ehdr;			/* elf.h */
+#endif
 		E64hdr;
 		struct mipsexec;	/* bootexec.h */
 		struct mips4kexec;	/* bootexec.h */
@@ -35,10 +37,14 @@ typedef struct {
 	long dummy;			/* padding to ensure extra long */
 } ExecHdr;
 
+#ifdef HARVEYNEXT
 static	int	nextboot(int, Fhdr*, ExecHdr*);
+#elif HARVEYSPARC
 static	int	sparcboot(int, Fhdr*, ExecHdr*);
+#elif HARVEYMIPS
 static	int	mipsboot(int, Fhdr*, ExecHdr*);
 static	int	mips4kboot(int, Fhdr*, ExecHdr*);
+#endif
 static	int	common(int, Fhdr*, ExecHdr*);
 static	int	commonllp64(int, Fhdr*, ExecHdr*);
 static	int	adotout(int, Fhdr*, ExecHdr*);
@@ -49,7 +55,7 @@ static	void	setdata(Fhdr*, uint64_t, int32_t, int64_t,
 				  int32_t);
 static	void	settext(Fhdr*, uint64_t, uint64_t, int32_t,
 				  int64_t);
-static	void	hswal(void*, int, ulong(*)(ulong));
+static	void	hswal(void*, int, uint32_t(*)(uint32_t));
 static	uint64_t	_round(uint64_t, uint32_t);
 
 /*
@@ -119,6 +125,7 @@ ExecTable exectab[] =
 		sizeof(Exec),
 		beswal,
 		adotout },
+#ifdef HARVEYMIPS
 	{ 0x160<<16,			/* Mips boot image */
 		"mips plan 9 boot image",
 		nil,
@@ -137,6 +144,7 @@ ExecTable exectab[] =
 		sizeof(struct mips4kexec),
 		beswal,
 		mips4kboot },
+#elif HARVEYSPARC
 	{ K_MAGIC,			/* Sparc k.out */
 		"sparc plan 9 executable",
 		"sparc plan 9 dlm",
@@ -173,6 +181,7 @@ ExecTable exectab[] =
 		sizeof(Exec),
 		beswal,
 		common },
+#elif HARVEYNEXT
 	{ 0xFEEDFACE,			/* Next boot image */
 		"next plan 9 boot image",
 		nil,
@@ -182,6 +191,7 @@ ExecTable exectab[] =
 		sizeof(struct nextexec),
 		beswal,
 		nextboot },
+#endif
 	{ I_MAGIC,			/* I386 8.out & boot image */
 		"386 plan 9 executable",
 		"386 plan 9 dlm",
@@ -223,8 +233,10 @@ ExecTable exectab[] =
 		nil,
 		FNONE,
 		0,
-		&mi386,
-		sizeof(Ehdr),
+/*		&mi386,
+		sizeof(Ehdr), */
+		&mamd64,
+		sizeof(E64hdr),
 		nil,
 		elfdotout },
 	{ E_MAGIC,			/* Arm 5.out and boot image */
@@ -454,7 +466,7 @@ common(int fd, Fhdr *fp, ExecHdr *hp)
 }
 
 static int
-commonllp64(int, Fhdr *fp, ExecHdr *hp)
+commonllp64(int i, Fhdr *fp, ExecHdr *hp)
 {
 	int32_t pgsize;
 	uint64_t entry;
@@ -488,6 +500,7 @@ commonllp64(int, Fhdr *fp, ExecHdr *hp)
 	return 1;
 }
 
+#ifdef HARVEYMIPS
 /*
  *	mips bootable image.
  */
@@ -547,7 +560,8 @@ mips4kboot(int fd, Fhdr *fp, ExecHdr *hp)
 	fp->hdrsz = 0;			/* header stripped */
 	return 1;
 }
-
+#endif
+#ifdef HARVEYSPARC
 /*
  *	sparc bootable image
  */
@@ -564,7 +578,8 @@ sparcboot(int fd, Fhdr *fp, ExecHdr *hp)
 	fp->hdrsz = 0;			/* header stripped */
 	return 1;
 }
-
+#endif
+#ifdef HARVEYNEXT
 /*
  *	next bootable image
  */
@@ -582,6 +597,7 @@ nextboot(int fd, Fhdr *fp, ExecHdr *hp)
 	fp->hdrsz = 0;			/* header stripped */
 	return 1;
 }
+#endif
 
 /*
  * ELF64 binaries.
@@ -696,6 +712,7 @@ elf64dotout(int fd, Fhdr *fp, ExecHdr *hp)
 	return 1;
 }
 
+#ifdef HARVEY32
 /*
  * ELF32 binaries.
  */
@@ -844,22 +861,26 @@ elf32dotout(int fd, Fhdr *fp, ExecHdr *hp)
 	return 1;
 }
 
+#endif
 /*
  * Elf binaries.
  */
 static int
 elfdotout(int fd, Fhdr *fp, ExecHdr *hp)
 {
-	Ehdr *ep;
+//	Ehdr *ep;
+	E64hdr *ep;
 
 	/* bitswap the header according to the DATA format */
 	ep = &hp->e;
-	if(ep->ident[CLASS] == ELFCLASS32)
-		return elf32dotout(fd, fp, hp);
-	else if(ep->ident[CLASS] == ELFCLASS64)
+//	if(ep->ident[CLASS] == ELFCLASS32)
+//		return elf32dotout(fd, fp, hp);
+//	else if(ep->ident[CLASS] == ELFCLASS64)
+	if(ep->ident[CLASS] == ELFCLASS64)
 		return elf64dotout(fd, fp, hp);
 
-	werrstr("bad ELF class - not 32- nor 64-bit");
+//	werrstr("bad ELF class - not 32- nor 64-bit");
+	werrstr("bad ELF class - not 64-bit");
 	return 0;
 }
 

+ 2 - 1
sys/src/libmach/k.c

@@ -6,7 +6,7 @@
  * modified, propagated, or distributed except according to the terms contained
  * in the LICENSE file.
  */
-
+#ifdef HARVEYSPARC
 /*
  * sparc definition
  */
@@ -126,3 +126,4 @@ Mach msparc =
 	4,		/* szfloat */
 	8,		/* szdouble */
 };
+#endif

+ 1 - 1
sys/src/libmach/obj.h

@@ -31,4 +31,4 @@ struct Prog		/* info from .$O files */
 };
 
 #define UNKNOWN	'?'
-void		_offset(int, vlong);
+void		_offset(int, int64_t);

+ 2 - 1
sys/src/libmach/q.c

@@ -6,7 +6,7 @@
  * modified, propagated, or distributed except according to the terms contained
  * in the LICENSE file.
  */
-
+#ifdef HARVEYNEXT
 /*
  * PowerPC definition
  *	forsyth@terzarima.net
@@ -131,3 +131,4 @@ Mach mpower =
 	4,		/* szfloat */
 	8,		/* szdouble */
 };
+#endif

+ 1 - 1
sys/src/libmach/qdb.c

@@ -167,7 +167,7 @@ typedef struct {
 	char	*err;		/* errmsg */
 } Instr;
 
-#define	IBF(v,a,b) (((ulong)(v)>>(32-(b)-1)) & ~(~0L<<(((b)-(a)+1))))
+#define	IBF(v,a,b) (((unsigned long)(v)>>(32-(b)-1)) & ~(~0L<<(((b)-(a)+1))))
 #define	IB(v,b) IBF((v),(b),(b))
 
 #pragma	varargck	argpos	bprint		2

+ 1 - 1
sys/src/libmach/sparc64.c

@@ -16,7 +16,7 @@
 #include "sparc64/ureg.h"
 #include <mach.h>
 
-#define	REGOFF(x)	(ulong)(&((struct Ureg *) 0)->x)
+#define	REGOFF(x)	(unsigned long)(&((struct Ureg *) 0)->x)
 
 #define R1		REGOFF(r1)
 #define R7		REGOFF(r7)

+ 2 - 0
sys/src/libmach/v.c

@@ -7,6 +7,7 @@
  * in the LICENSE file.
  */
 
+#ifdef HARVEYMIPS
 /*
  * mips definition
  */
@@ -125,3 +126,4 @@ Mach mmips =
 	4,		/* szfloat */
 	8,		/* szdouble */
 };
+#endif

+ 1 - 1
sys/src/libmemdraw/defont.c

@@ -58,7 +58,7 @@ getmemdefont(void)
 		return nil;
 	}
 
-	hdr = p+Dy(r)*i->width*sizeof(ulong);
+	hdr = p+Dy(r)*i->width*sizeof(unsigned long);
 	n = atoi(hdr);
 	p = hdr+3*12;
 	fc = malloc(sizeof(Fontchar)*(n+1));

+ 24 - 24
sys/src/libmemdraw/draw.c

@@ -1426,11 +1426,11 @@ DBG print("\n");
 #undef DBG
 
 static Buffer
-readcmap(Param *p, uchar *buf, int y)
+readcmap(Param *p, unsigned char *buf, int y)
 {
 	Buffer b;
 	int a, convgrey, copyalpha, dx, i, m;
-	uchar *q, *cmap, *begin, *end, *r, *w;
+	unsigned char *q, *cmap, *begin, *end, *r, *w;
 
 	begin = p->bytey0s + y*p->bwidth;
 	r = p->bytermin + y*p->bwidth;
@@ -1475,7 +1475,7 @@ readcmap(Param *p, uchar *buf, int y)
 		}
 	}
 
-	b.rgba = (ulong*)(buf-copyalpha);
+	b.rgba = (uint32_t*)(buf-copyalpha);
 
 	if(convgrey){
 		b.grey = buf;
@@ -1979,10 +1979,10 @@ memsetl(void *vp, uint32_t val, int n)
 }
 
 static void
-memset24(void *vp, ulong val, int n)
+memset24(void *vp, unsigned long val, int n)
 {
-	uchar *p, *ep;
-	uchar a,b,c;
+	unsigned char *p, *ep;
+	unsigned char a,b,c;
 
 	p = vp;
 	ep = p+3*n;
@@ -1996,13 +1996,13 @@ memset24(void *vp, ulong val, int n)
 	}
 }
 
-static ulong
-imgtorgba(Memimage *img, ulong val)
+static uint32_t
+imgtorgba(Memimage *img, uint32_t val)
 {
-	uchar r, g, b, a;
+	unsigned char r, g, b, a;
 	int nb, ov, v;
-	ulong chan;
-	uchar *p;
+	unsigned long chan;
+	unsigned char *p;
 
 	a = 0xFF;
 	r = g = b = 0xAA;	/* garbage */
@@ -2044,13 +2044,13 @@ imgtorgba(Memimage *img, ulong val)
 	return (r<<24)|(g<<16)|(b<<8)|a;	
 }
 
-static ulong
-rgbatoimg(Memimage *img, ulong rgba)
+static uint32_t
+rgbatoimg(Memimage *img, uint32_t rgba)
 {
-	ulong chan;
+	unsigned long chan;
 	int d, nb;
-	ulong v;
-	uchar *p, r, g, b, a, m;
+	unsigned long v;
+	unsigned char *p, r, g, b, a, m;
 
 	v = 0;
 	r = rgba>>24;
@@ -2111,9 +2111,9 @@ DBG print("state %lux mval %lux dd %d\n", par->state, par->mval, dst->depth);
 	 */
 	m = Simplesrc|Simplemask|Fullmask;
 	if((par->state&m)==m && (par->srgba&0xFF) == 0xFF && (op ==S || op == SoverD)){
-		uchar *dp, p[4];
+		unsigned char *dp, p[4];
 		int d, dwid, ppb, np, nb;
-		uchar lm, rm;
+		unsigned char lm, rm;
 
 DBG print("memopt, dst %p, dst->data->bdata %p\n", dst, dst->data->bdata);
 		dwid = dst->width*sizeof(uint32_t);
@@ -2184,7 +2184,7 @@ DBG print("dp %p v %lux lm %ux (v ^ *dp) & lm %lux\n", dp, v, lm, (v^*dp)&lm);
 		case 16:
 			p[0] = v;		/* make little endian */
 			p[1] = v>>8;
-			v = *(ushort*)p;
+			v = *(uint16_t*)p;
 DBG print("dp=%p; dx=%d; for(y=0; y<%d; y++, dp+=%d)\nmemsets(dp, v, dx);\n",
 	dp, dx, dy, dwid);
 			for(y=0; y<dy; y++, dp+=dwid)
@@ -2216,7 +2216,7 @@ DBG print("dp=%p; dx=%d; for(y=0; y<%d; y++, dp+=%d)\nmemsets(dp, v, dx);\n",
 	m = Simplemask|Fullmask;
 	if((par->state&(m|Replsrc))==m && src->depth >= 8 
 	&& src->chan == dst->chan && !(src->flags&Falpha) && (op == S || op == SoverD)){
-		uchar *sp, *dp;
+		unsigned char *sp, *dp;
 		int32_t swid, dwid, nb;
 		int dir;
 
@@ -2249,8 +2249,8 @@ DBG print("dp=%p; dx=%d; for(y=0; y<%d; y++, dp+=%d)\nmemsets(dp, v, dx);\n",
 	if((par->state&(Simplemask|Simplesrc|Replmask|Replsrc))==0 
 	&& dst->chan==GREY1 && src->chan==GREY1 && par->mask->chan==GREY1 
 	&& (par->r.min.x&7)==(par->sr.min.x&7) && (par->r.min.x&7)==(par->mr.min.x&7)){
-		uchar *sp, *dp, *mp;
-		uchar lm, rm;
+		unsigned char *sp, *dp, *mp;
+		unsigned char lm, rm;
 		int32_t swid, dwid, mwid;
 		int i, x, dir;
 
@@ -2351,10 +2351,10 @@ chardraw(Memdrawparam *par)
 	uint32_t bits;
 	int i, ddepth, dy, dx, x, bx, ex, y, npack, bsh, depth, op;
 	uint32_t v, maskwid, dstwid;
-	uchar *wp, *rp, *q, *wc;
+	unsigned char *wp, *rp, *q, *wc;
 	uint16_t *ws;
 	uint32_t *wl;
-	uchar sp[4];
+	unsigned char sp[4];
 	Rectangle r, mr;
 	Memimage *mask, *src, *dst;
 

+ 3 - 3
sys/src/libmemdraw/ellipse.c

@@ -218,7 +218,7 @@ erect(int x0, int y0, int x1, int y1, Param *p)
 {
 	Rectangle r;
 
-/*	print("R %d,%d %d,%d\n", x0, y0, x1, y1); /**/
+/*	print("R %d,%d %d,%d\n", x0, y0, x1, y1); */
 	r = Rect(p->c.x+x0, p->c.y+y0, p->c.x+x1+1, p->c.y+y1+1);
 	memdraw(p->dst, r, p->src, addpt(p->sp, r.min), memopaque, p00, p->op);
 }
@@ -233,7 +233,7 @@ epoint(int x, int y, Param *p)
 	Point p0;
 	Rectangle r;
 
-/*	print("P%d %d,%d\n", p->t, x, y);	/**/
+/*	print("P%d %d,%d\n", p->t, x, y);	*/
 	p0 = Pt(p->c.x+x, p->c.y+y);
 	r = Rpt(addpt(p0, p->disc->r.min), addpt(p0, p->disc->r.max));
 	memdraw(p->dst, r, p->src, addpt(p->sp, r.min), p->disc, p->disc->r.min, p->op);
@@ -246,7 +246,7 @@ static
 void
 eline(int x0, int y0, int x1, int y1, Param *p)
 {
-/*	print("L%d %d,%d %d,%d\n", p->t, x0, y0, x1, y1); /**/
+/*	print("L%d %d,%d %d,%d\n", p->t, x0, y0, x1, y1); */
 	if(x1 > x0+1)
 		erect(x0+1, y0-p->t, x1-1, y1+p->t, p);
 	else if(y1 > y0+1)

+ 1 - 1
sys/src/libmemdraw/hwdraw.c

@@ -13,7 +13,7 @@
 #include <memdraw.h>
 
 int
-hwdraw(Memdrawparam*)
+hwdraw(Memdrawparam* p)
 {
 	return 0;	/* could not satisfy request */
 }

+ 1 - 1
sys/src/libmemdraw/iprint.c

@@ -13,7 +13,7 @@
 #include <memdraw.h>
 
 int
-iprint(char*,...)
+iprint(char* c,...)
 {
 	return -1;
 }

+ 5 - 5
sys/src/libmemdraw/load.c

@@ -35,7 +35,7 @@ loadmemimage(Memimage *i, Rectangle r, uint8_t *data, int ndata)
 			m ^= 0xFF >> rpart;
 		for(y=r.min.y; y<r.max.y; y++){
 			*q ^= (*data^*q) & m;
-			q += i->width*sizeof(ulong);
+			q += i->width*sizeof(uint32_t);
 			data++;
 		}
 		return ndata;
@@ -43,7 +43,7 @@ loadmemimage(Memimage *i, Rectangle r, uint8_t *data, int ndata)
 	if(lpart==0 && rpart==0){	/* easy case */
 		for(y=r.min.y; y<r.max.y; y++){
 			memmove(q, data, l);
-			q += i->width*sizeof(ulong);
+			q += i->width*sizeof(uint32_t);
 			data += l;
 		}
 		return ndata;
@@ -54,7 +54,7 @@ loadmemimage(Memimage *i, Rectangle r, uint8_t *data, int ndata)
 			*q ^= (*data^*q) & m;
 			if(l > 1)
 				memmove(q+1, data+1, l-1);
-			q += i->width*sizeof(ulong);
+			q += i->width*sizeof(uint32_t);
 			data += l;
 		}
 		return ndata;
@@ -64,7 +64,7 @@ loadmemimage(Memimage *i, Rectangle r, uint8_t *data, int ndata)
 			if(l > 1)
 				memmove(q, data, l-1);
 			q[l-1] ^= (data[l-1]^q[l-1]) & mr;
-			q += i->width*sizeof(ulong);
+			q += i->width*sizeof(uint32_t);
 			data += l;
 		}
 		return ndata;
@@ -74,7 +74,7 @@ loadmemimage(Memimage *i, Rectangle r, uint8_t *data, int ndata)
 		if(l > 2)
 			memmove(q+1, data+1, l-2);
 		q[l-1] ^= (data[l-1]^q[l-1]) & mr;
-		q += i->width*sizeof(ulong);
+		q += i->width*sizeof(uint32_t);
 		data += l;
 	}
 	return ndata;

+ 1 - 1
sys/src/libmemdraw/unload.c

@@ -27,7 +27,7 @@ unloadmemimage(Memimage *i, Rectangle r, uint8_t *data, int ndata)
 	q = byteaddr(i, r.min);
 	for(y=r.min.y; y<r.max.y; y++){
 		memmove(data, q, l);
-		q += i->width*sizeof(ulong);
+		q += i->width*sizeof(uint32_t);
 		data += l;
 	}
 	return ndata;

+ 3 - 19
sys/src/libmp/amd64/mkfile

@@ -1,20 +1,4 @@
-objtype=amd64
-</$objtype/mkfile
+all:
 
-LIB=/$objtype/lib/libmp.a
-SFILES=\
-	mpdigdiv.s\
-	mpvecadd.s\
-	mpvecdigmuladd.s\
-	mpvecdigmulsub.s\
-	mpvecsub.s\
-
-HFILES=/$objtype/include/u.h /sys/include/mp.h ../port/dat.h
-
-OFILES=${SFILES:%.s=%.$O}
-
-UPDATE=mkfile\
-	$HFILES\
-	$SFILES\
-
-</sys/src/cmd/mksyslib
+%:V:
+        # nothing to see here

+ 1 - 0
sys/src/libmp/mkfile

@@ -1,3 +1,4 @@
+MKSHELL=$PLAN9/bin/rc
 </$objtype/mkfile
 
 DIRS=port $CPUS

+ 1 - 1
sys/src/libmp/port/mptouv.c

@@ -11,7 +11,7 @@
 #include <mp.h>
 #include "dat.h"
 
-#define VLDIGITS (sizeof(vlong)/sizeof(mpdigit))
+#define VLDIGITS (sizeof(int64_t)/sizeof(mpdigit))
 
 /*
  *  this code assumes that a vlong is an integral number of

+ 1 - 0
sys/src/libndb/mkfile

@@ -32,6 +32,7 @@ UPDATE=\
 	${OFILES:%.$O=%.c}\
 	${LIB:/$objtype/%=/386/%}\
 
+CFLAGS=$CFLAGS -I/sys/src/libndb
 </sys/src/cmd/mksyslib
 
 $O.out: testipinfo.$O

+ 1 - 1
sys/src/libndb/ndbhf.h

@@ -17,7 +17,7 @@ struct Ndbhf
 	int	hlen;		/* length (in entries) of hash table */
 	char	attr[Ndbalen];	/* attribute hashed */
 
-	uchar	buf[256];	/* hash file buffer */
+	unsigned char	buf[256];	/* hash file buffer */
 	long	off;		/* offset of first byte of buffer */
 	int	len;		/* length of valid data in buffer */
 };

+ 1 - 1
sys/src/liboventi/pack.c

@@ -16,7 +16,7 @@
  */
 #define	U8GET(p)	((p)[0])
 #define	U16GET(p)	(((p)[0]<<8)|(p)[1])
-#define	U32GET(p)	((u32int)(((p)[0]<<24)|((p)[1]<<16)|((p)[2]<<8)|(p)[3]))
+#define	U32GET(p)	((uint32_t)(((p)[0]<<24)|((p)[1]<<16)|((p)[2]<<8)|(p)[3]))
 #define	U48GET(p)	(((int64_t)U16GET(p)<<32)|(int64_t)U32GET((p)+2))
 #define	U64GET(p)	(((int64_t)U32GET(p)<<32)|(int64_t)U32GET((p)+4))
 

+ 6 - 6
sys/src/liboventi/packet.h

@@ -28,10 +28,10 @@ struct Mem
 {
 	Lock lk;
 	int ref;
-	uchar *bp;
-	uchar *ep;
-	uchar *rp;
-	uchar *wp;
+	unsigned char *bp;
+	unsigned char *ep;
+	unsigned char *rp;
+	unsigned char *wp;
 	Mem *next;
 };
 
@@ -45,8 +45,8 @@ struct Frag
 {
 	int state;
 	Mem *mem;
-	uchar *rp;
-	uchar *wp;
+	unsigned char *rp;
+	unsigned char *wp;
 	Frag *next;
 };
 

+ 3 - 3
sys/src/liboventi/server.c

@@ -28,9 +28,9 @@ vtServerAlloc(VtServerVtbl *vtbl)
 }
 
 static int
-srvHello(VtSession *z, char *version, char *uid, int , uint8_t *,
-	 int ,
-	 uint8_t *, int )
+srvHello(VtSession *z, char *version, char *uid, int n, uint8_t *m,
+	 int p,
+	 uint8_t *q, int r)
 {
 	vtLock(z->lk);
 	if(z->auth.state != VtAuthHello) {

+ 2 - 2
sys/src/liboventi/session.h

@@ -50,8 +50,8 @@ enum {
 
 struct VtAuth {
 	int state;
-	uchar client[VtScoreSize];
-	uchar sever[VtScoreSize];
+	unsigned char client[VtScoreSize];
+	unsigned char sever[VtScoreSize];
 };
 
 struct VtSession {

+ 1 - 1
sys/src/libscribble/hre_api.c

@@ -687,7 +687,7 @@ static void intl_initialize(void)
 
 /*make_rec_info-Create a rec_info structure*/
 
-static rec_info* make_rec_info(char*, char*, char** subset)
+static rec_info* make_rec_info(char* c, char* d, char** subset)
 {
     int i,len;
     rec_info* ri;

+ 17 - 17
sys/src/libscribble/li_recognizer.c

@@ -102,7 +102,7 @@ delete_examples(point_list* l)
  */
 
 static char*
-recognize_internal(rClassifier* rec, Stroke* str, int*)
+recognize_internal(rClassifier* rec, Stroke* str, int* i)
 {
 	char *res;
 	point_list *stroke;
@@ -291,7 +291,7 @@ recognizer_getClasses (recognizer r, char ***list, int *nc)
 }
 
 static int
-recognizer_clearState (recognizer)
+recognizer_clearState (recognizer r)
 {
   /*This operation isn't supported by the LI recognizer.*/
 
@@ -304,7 +304,7 @@ static bool isa_li(recognizer r)
 { return(CHECK_LI_MAGIC(r)); }
 
 static int
-recognizer_train(recognizer, rc*, uint, Stroke*, rec_element*, bool)
+recognizer_train(recognizer r, rc* rc, uint u, Stroke* s, rec_element* re, bool b)
 {
   /*This operation isn't supported by the LI recognizer.*/
 
@@ -443,7 +443,7 @@ static int li_recognizer_load(recognizer r, char* dir, char* filename)
 
 /*li_recognizer_save-Save a classifier file.*/
 
-static int li_recognizer_save(recognizer, char*, char*)
+static int li_recognizer_save(recognizer r, char* c, char* d)
 { 
 		/*This operation isn't supported by the LI recognizer.*/
 
@@ -452,7 +452,7 @@ static int li_recognizer_save(recognizer, char*, char*)
 }
 
 static wordset
-li_recognizer_load_dictionary(recognizer, char*, char*)
+li_recognizer_load_dictionary(recognizer r, char* c, char* d)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 
@@ -461,7 +461,7 @@ li_recognizer_load_dictionary(recognizer, char*, char*)
 }
 
 static int
-li_recognizer_save_dictionary(recognizer, char*, char*, wordset)
+li_recognizer_save_dictionary(recognizer r, char* c, char* d, wordset w)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 		li_err_msg = "Dictionaries are not supported by the LI recognizer";
@@ -469,7 +469,7 @@ li_recognizer_save_dictionary(recognizer, char*, char*, wordset)
 }
 
 static int
-li_recognizer_free_dictionary(recognizer, wordset)
+li_recognizer_free_dictionary(recognizer r, wordset w)
 {
   /*This operation isn't supported by the LI recognizer.*/
 
@@ -480,7 +480,7 @@ li_recognizer_free_dictionary(recognizer, wordset)
 }
 
 static int
-li_recognizer_add_to_dictionary(recognizer, letterset*, wordset)
+li_recognizer_add_to_dictionary(recognizer r, letterset* l, wordset w)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 		li_err_msg = "Dictionaries are not supported by the LI recognizer";
@@ -488,7 +488,7 @@ li_recognizer_add_to_dictionary(recognizer, letterset*, wordset)
 }
 
 static int
-li_recognizer_delete_from_dictionary(recognizer, letterset*, wordset)
+li_recognizer_delete_from_dictionary(recognizer r, letterset* l, wordset w)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 		li_err_msg = "Dictionaries are not supported by the LI recognizer";
@@ -511,7 +511,7 @@ li_recognizer_error(recognizer rec)
 }
 
 static int 
-li_recognizer_clear(recognizer r, bool)
+li_recognizer_clear(recognizer r, bool b)
 {
 		li_recognizer* rec; 
 
@@ -525,7 +525,7 @@ li_recognizer_clear(recognizer r, bool)
 }
 
 static int 
-li_recognizer_set_context(recognizer, rc*)
+li_recognizer_set_context(recognizer r, rc* rc)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 		li_err_msg = "Contexts are not supported by the LI recognizer";
@@ -533,7 +533,7 @@ li_recognizer_set_context(recognizer, rc*)
 }
 
 static rc*
-li_recognizer_get_context(recognizer)
+li_recognizer_get_context(recognizer r)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 		li_err_msg = "Contexts are not supported by the LI recognizer";
@@ -541,7 +541,7 @@ li_recognizer_get_context(recognizer)
 }
 
 static int 
-li_recognizer_get_buffer(recognizer, uint*, Stroke**)
+li_recognizer_get_buffer(recognizer r, uint* u, Stroke** s)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 		li_err_msg = "Buffer get/set are not supported by the LI recognizer";
@@ -549,7 +549,7 @@ li_recognizer_get_buffer(recognizer, uint*, Stroke**)
 }
 
 static int 
-li_recognizer_set_buffer(recognizer, uint, Stroke*)
+li_recognizer_set_buffer(recognizer r, uint u, Stroke* s)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 		li_err_msg = "Buffer get/set are not supported by the LI recognizer";
@@ -557,7 +557,7 @@ li_recognizer_set_buffer(recognizer, uint, Stroke*)
 }
 
 static int
-li_recognizer_translate(recognizer r, uint ncs, Stroke* tps, bool, int* nret, rec_alternative** ret)
+li_recognizer_translate(recognizer r, uint ncs, Stroke* tps, bool b, int* nret, rec_alternative** ret)
 {
 	char* clss;
 	li_recognizer* rec; 
@@ -639,7 +639,7 @@ li_recognizer_get_extension_functions(recognizer rec)
 }
 
 static char**
-li_recognizer_get_gesture_names(recognizer)
+li_recognizer_get_gesture_names(recognizer r)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 		li_err_msg = "Gestures are not supported by the LI recognizer";
@@ -647,7 +647,7 @@ li_recognizer_get_gesture_names(recognizer)
 }
 
 static xgesture
-li_recognizer_set_gesture_action(recognizer, char*, xgesture, void*)
+li_recognizer_set_gesture_action(recognizer r, char* c, xgesture x, void* v)
 {
 		/*This operation isn't supported by the LI recognizer.*/
 		li_err_msg = "Gestures are not supported by the LI recognizer";

+ 1 - 1
sys/src/libscribble/scribbleimpl.h

@@ -64,7 +64,7 @@ typedef void (*rec_fn)();
  * recognizer in a particular result.
  */
 
-typedef uchar rec_confidence;
+typedef unsigned char rec_confidence;
 
 /**************** RECOGNIZER CONFIGURATION INFORMATION *******************/
 

+ 1 - 0
sys/src/libsec/mkfile

@@ -1,3 +1,4 @@
+MKSHELL=$PLAN9/bin/rc
 </$objtype/mkfile
 
 DIRS=port $CPUS

+ 5 - 5
sys/src/libstdio/Stdio.h

@@ -71,7 +71,7 @@ int fflush(FILE *);
 FILE *fopen(const char *, const char *);
 FILE *freopen(const char *, const char *, FILE *);
 void setbuf(FILE *, char *);
-int setvbuf(FILE *, char *, int, long);
+int setvbuf(FILE *, char *, int, int32_t);
 int fprintf(FILE *, const char *, ...);
 int fscanf(FILE *, const char *, ...);
 int printf(const char *, ...);
@@ -99,12 +99,12 @@ int putchar(int);
 #define	putchar(c)	putc(c, stdout)
 int puts(const char *);
 int ungetc(int, FILE *);
-long fread(void *, long, long, FILE *);
-long fwrite(const void *, long, long, FILE *);
+int32_t fread(void *, int32_t, int32_t, FILE *);
+int32_t fwrite(const void *, int32_t, int32_t, FILE *);
 int fgetpos(FILE *, fpos_t *);
-int fseek(FILE *, long int, int);
+int fseek(FILE *, int32_t, int);
 int fsetpos(FILE *, const fpos_t *);
-long int ftell(FILE *);
+int32_t ftell(FILE *);
 void rewind(FILE *);
 void clearerr(FILE *);
 int feof(FILE *);

+ 1 - 1
sys/src/libstdio/mkfile

@@ -63,7 +63,7 @@ UPDATE=\
 
 </sys/src/cmd/mksyslib
 # this code really can't handle any flow-analysis warnings
-CFLAGS= -FTV
+#CFLAGS= -FTV
 
 test:V:	$OFILES
 	ar rv libstdio.a $OFILES

+ 7 - 6
sys/src/libstdio/setvbuf.c

@@ -40,12 +40,6 @@ int setvbuf(FILE *f, char *buf, int mode, int32_t size){
 	f->state=RDWR;
 	return 0;
 }
-int _IO_setvbuf(FILE *f){
-	static int isatty(int);
-	if(f==stderr || (f==stdout && isatty(1)))
-		return setvbuf(f, (char *)0, _IOLBF, BUFSIZ);
-	else return setvbuf(f, (char *)0, _IOFBF, BUFSIZ);
-}
 static int
 isatty(int fd)
 {
@@ -57,3 +51,10 @@ isatty(int fd)
 	/* might be /mnt/term/dev/cons */
 	return strlen(buf) >= 9 && strcmp(buf+strlen(buf)-9, "/dev/cons") == 0;
 }
+
+int _IO_setvbuf(FILE *f){
+        //static int isatty(int);
+        if(f==stderr || (f==stdout && isatty(1)))
+                return setvbuf(f, (char *)0, _IOLBF, BUFSIZ);
+        else return setvbuf(f, (char *)0, _IOFBF, BUFSIZ);
+}

+ 1 - 1
sys/src/libsunrpc/nfs3.c

@@ -124,7 +124,7 @@ static struct {
 };
 
 void
-nfs3Errstr(SunStatus status)
+nfs3Errstr(Nfs3Status status)
 {
 	int i;
 

+ 1 - 1
sys/src/libthread/amd64.c

@@ -14,7 +14,7 @@
 
 /* first argument goes in a register; simplest just to ignore it */
 static void
-launcheramd64(int, void (*f)(void *arg), void *arg)
+launcheramd64(int i, void (*f)(void *arg), void *arg)
 {
 	(*f)(arg);
 	threadexits(nil);

+ 4 - 4
sys/src/libthread/threadimpl.h

@@ -81,7 +81,7 @@ struct Thread
 	int		moribund;	/* thread needs to die */
 	State		state;		/* run state */
 	State		nextstate;	/* next run state */
-	uchar		*stk;		/* top of stack (lowest address of stack) */
+	unsigned char		*stk;		/* top of stack (lowest address of stack) */
 	uint		stksize;	/* stack size */
 	Thread		*next;		/* next on ready queue */
 
@@ -182,15 +182,15 @@ void	_threadflagrendez(Thread*);
 Proc*	_threadgetproc(void);
 void	_threadsetproc(Proc*);
 void	_threadinitstack(Thread*, void(*)(void*), void*);
-void*	_threadmalloc(long, int);
+void*	_threadmalloc(int32_t, int);
 void	_threadnote(void*, char*);
 void	_threadready(Thread*);
 void*	_threadrendezvous(void*, void*);
 void	_threadsignal(void);
 void	_threadsysfatal(char*, va_list);
 void**	_workerdata(void);
-void	_xinc(long*);
-long	_xdec(long*);
+void	_xinc(int32_t*);
+long	_xdec(int32_t*);
 
 extern int			_threaddebuglevel;
 extern char*		_threadexitsallstatus;

+ 3 - 3
sys/src/libventi/cvt.h

@@ -12,9 +12,9 @@
  */
 #define	U8GET(p)	((p)[0])
 #define	U16GET(p)	(((p)[0]<<8)|(p)[1])
-#define	U32GET(p)	((u32int)(((p)[0]<<24)|((p)[1]<<16)|((p)[2]<<8)|(p)[3]))
-#define	U48GET(p)	(((vlong)U16GET(p)<<32)|(vlong)U32GET((p)+2))
-#define	U64GET(p)	(((vlong)U32GET(p)<<32)|(vlong)U32GET((p)+4))
+#define	U32GET(p)	((uint32_t)(((p)[0]<<24)|((p)[1]<<16)|((p)[2]<<8)|(p)[3]))
+#define	U48GET(p)	(((uint32_t)U16GET(p)<<32)|(uint32_t)U32GET((p)+2))
+#define	U64GET(p)	(((uint32_t)U32GET(p)<<32)|(uint32_t)U32GET((p)+4))
 
 #define	U8PUT(p,v)	(p)[0]=(v)
 #define	U16PUT(p,v)	(p)[0]=(v)>>8;(p)[1]=(v)

+ 1 - 1
sys/src/libventi/version.c

@@ -43,7 +43,7 @@ vtreadversion(VtConn *z, char *q, char *v, int nv)
 			*v = 0;
 			break;
 		}
-		if((uchar)*v < ' ' || (uchar)*v > 0x7f || (*q && *v != *q)){
+		if((unsigned char)*v < ' ' || (unsigned char)*v > 0x7f || (*q && *v != *q)){
 			werrstr(EBadVersion);
 			return -1;
 		}

+ 3 - 2
sys/src/mkfile

@@ -1,3 +1,4 @@
+MKSHELL=$PLAN9/bin/rc
 objtype=amd64
 
 </$objtype/mkfile
@@ -77,9 +78,9 @@ libs:V:
 	date
 	for (i in $LIBS) @{
 		cd $i
-#		mk clean
+		mk clean
 		mk install
-#		mk clean
+		mk clean
 	}
 	date
 

+ 5 - 3
sys/src/mkfile.proto

@@ -4,16 +4,18 @@
 
 # Provisional for cross compiling
 objtype=amd64
+PLAN9=/home/elbing/source/plan9port
 
 #OS=568qv
 OS=o
-CPUS=arm amd64 386 power mips
+#CPUS=arm amd64 386 power mips
+CPUS=amd64
 #CFLAGS=-FTVw
-CFLAGS=-O0 -static -fplan9-extensions -ffreestanding -fno-builtin --sysroot=$ROOT $WARNFLAGS -I$INCX86_64_DIR -I$INC_DIR
+CFLAGS=-O0 -static -fplan9-extensions -ffreestanding -fno-builtin $WARNFLAGS -I$INCX86_64_DIR -I$INC_DIR
 LEX=lex
 YACC=yacc
 
-MK=/bin/mk
+#MK=/bin/mk
 
 # recursive mk will have these set from the parent
 # this is never what we want.  clear them

+ 1 - 1
util/mksys.go

@@ -39,7 +39,7 @@ func main(){
 		}
 		ass = ass + fmt.Sprintf("%v\n%v: ", name, name)
 		ass = ass + "\tMOVQ $"+ll[2]
-		ass = ass + ",%r9  // Put the system call into arg 6, which is never used on Plan 9. minimizes work on system calls\n"
+		ass = ass + ",%r9  /* Put the system call into arg 6, which is never used on Plan 9. minimizes work on system calls */\n"
 		ass = ass + "\tSYSCALL\n\tRET\n"
 		err = ioutil.WriteFile(filename, []byte(ass), 0666)
 		if err != nil {