mac warnings

This commit is contained in:
Russ Cox 2005-11-07 17:34:39 +00:00
parent 494adeed0b
commit 537f761602
9 changed files with 21 additions and 18 deletions

View File

@ -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

3
README
View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -1,4 +1,5 @@
#include "os.h"
#include <u.h>
#include <libc.h>
#include <libsec.h>
/*

View File

@ -1,4 +1,6 @@
#include "os.h"
#include <u.h>
#include <libc.h>
#include <libsec.h>
void
_sha1block(uchar *p, ulong len, u32int *s)