diff --git a/Make.unix b/Make.unix index 2e5fdbb..753e023 100644 --- a/Make.unix +++ b/Make.unix @@ -1,14 +1,16 @@ # Unix +PTHREAD= +#PTHREAD=-pthread AR=ar AS=as -CC=gcc -Wall -Wno-missing-braces RANLIB=ranlib -CFLAGS=-I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -ggdb -D_THREAD_SAFE -pthread # not ready for this yet: -Wall +CC=gcc +CFLAGS=-Wall -Wno-missing-braces -ggdb -I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -D_THREAD_SAFE $(PTHREAD) O=o OS=posix GUI=x11 LDADD=-L/usr/X11R6/lib -lX11 -ggdb -LDFLAGS=-pthread +LDFLAGS=$(PTHREAD) TARG=drawterm all: default diff --git a/README b/README index 5fa1f0b..f72e310 100644 --- a/README +++ b/README @@ -27,9 +27,6 @@ On the web at http://cvs.pdos.csail.mit.edu/cvs/drawterm TO DO: ------ -- Should clean up the code so that gcc -Wall doesn't print -any warnings. - - Should import latest /dev/draw to allow resize of window - Should copy 9term code and make console window a real diff --git a/gui-x11/screen.c b/gui-x11/screen.c index 7568235..9e19f17 100644 --- a/gui-x11/screen.c +++ b/gui-x11/screen.c @@ -191,8 +191,8 @@ setcursor(void) drawqlock(); fg = map[0]; bg = map[255]; - xsrc = XCreateBitmapFromData(xdisplay, xdrawable, src, 16, 16); - xmask = XCreateBitmapFromData(xdisplay, xdrawable, mask, 16, 16); + xsrc = XCreateBitmapFromData(xdisplay, xdrawable, (char*)src, 16, 16); + xmask = XCreateBitmapFromData(xdisplay, xdrawable, (char*)mask, 16, 16); xc = XCreatePixmapCursor(xdisplay, xsrc, xmask, &fg, &bg, -cursor.offset.x, -cursor.offset.y); if(xc != 0) { XDefineCursor(xdisplay, xdrawable, xc); @@ -403,7 +403,7 @@ xinitscreen(void) name.value = (uchar*)"drawterm"; name.encoding = XA_STRING; name.format = 8; - name.nitems = strlen(name.value); + name.nitems = strlen((char*)name.value); normalhints.flags = USSize|PMaxSize; normalhints.max_width = Dx(r); normalhints.max_height = Dy(r); diff --git a/kern/devcons.c b/kern/devcons.c index 855900e..f654e82 100644 --- a/kern/devcons.c +++ b/kern/devcons.c @@ -13,7 +13,7 @@ Queue* kbdq; /* unprocessed console input */ Queue* lineq; /* processed console input */ Queue* serialoq; /* serial console output */ Queue* kprintoq; /* console output, for /dev/kprint */ -ulong kprintinuse; /* test and set whether /dev/kprint is open */ +long kprintinuse; /* test and set whether /dev/kprint is open */ int iprintscreenputs = 0; int panicking; diff --git a/kern/devfs-posix.c b/kern/devfs-posix.c index 465ea16..825ed63 100644 --- a/kern/devfs-posix.c +++ b/kern/devfs-posix.c @@ -585,7 +585,7 @@ fsdirread(Chan *c, uchar *va, int count, ulong offset) d.length = stbuf.st_size; d.type = 'U'; d.dev = c->dev; - n = convD2M(&d, (char*)va+i, count-i); + n = convD2M(&d, (uchar*)va+i, count-i); if(n == BIT16SZ){ strcpy(uif->nextname, de); break; diff --git a/kern/devip-posix.c b/kern/devip-posix.c index 96a6224..21f698d 100644 --- a/kern/devip-posix.c +++ b/kern/devip-posix.c @@ -72,7 +72,7 @@ so_connect(int fd, unsigned long raddr, unsigned short rport) void so_getsockname(int fd, unsigned long *laddr, unsigned short *lport) { - int len; + uint len; struct sockaddr_in sin; len = sizeof(sin); @@ -96,7 +96,8 @@ so_listen(int fd) int so_accept(int fd, unsigned long *raddr, unsigned short *rport) { - int nfd, len; + int nfd; + uint len; struct sockaddr_in sin; len = sizeof(sin); diff --git a/libdraw/chan.c b/libdraw/chan.c index 5145b42..8bace15 100644 --- a/libdraw/chan.c +++ b/libdraw/chan.c @@ -31,7 +31,7 @@ chantostr(char *buf, ulong cc) /* avoid pulling in ctype when using with drawterm etc. */ static int -isspace(char c) +xisspace(char c) { return c==' ' || c== '\t' || c=='\r' || c=='\n'; } @@ -45,10 +45,10 @@ strtochan(char *s) c = 0; p=s; - while(*p && isspace(*p)) + while(*p && xisspace(*p)) p++; - while(*p && !isspace(*p)){ + while(*p && !xisspace(*p)){ if((q = strchr(channames, p[0])) == nil) return 0; t = q-channames; diff --git a/posix-power/md5block.c b/posix-power/md5block.c index 07fe223..30edce4 100644 --- a/posix-power/md5block.c +++ b/posix-power/md5block.c @@ -1,4 +1,5 @@ -#include "os.h" +#include +#include #include /* diff --git a/posix-power/sha1block.c b/posix-power/sha1block.c index 82566f2..1b49551 100644 --- a/posix-power/sha1block.c +++ b/posix-power/sha1block.c @@ -1,4 +1,6 @@ -#include "os.h" +#include +#include +#include void _sha1block(uchar *p, ulong len, u32int *s)