diff --git a/exportfs/exportsrv.c b/exportfs/exportsrv.c index 7163684..95abecf 100644 --- a/exportfs/exportsrv.c +++ b/exportfs/exportsrv.c @@ -30,7 +30,6 @@ emallocz(ulong n) return v; } -ulong messagesize; void Xversion(Fsrpc *t) @@ -392,7 +391,7 @@ Xwstat(Fsrpc *t) return; } strings = emallocz(t->work.nstat); /* ample */ - if(convM2D(t->work.stat, t->work.nstat, &d, strings) < 0){ + if(convM2D(t->work.stat, t->work.nstat, &d, strings) <= BIT16SZ){ rerrstr(err, sizeof err); reply(&t->work, &rhdr, err); t->busy = 0; diff --git a/gui-x11/alloc.c b/gui-x11/alloc.c index ecdaaf4..8053c44 100644 --- a/gui-x11/alloc.c +++ b/gui-x11/alloc.c @@ -159,7 +159,6 @@ putXdata(Memimage *m, Rectangle r) Xmem *xm; XImage *xi; GC g; - int offset; Point xdelta, delta; Point tp; int x, y; @@ -175,10 +174,6 @@ putXdata(Memimage *m, Rectangle r) xi = xm->xi; g = (m->chan == GREY1) ? xgccopy0 : xgccopy; - if(m->depth == 24) - offset = r.min.x % 4; - else - offset = m->r.min.x & (31/m->depth); delta = subpt(r.min, m->r.min); tp = xm->r.min; /* avoid unaligned access on digital unix */ diff --git a/gui-x11/screen.c b/gui-x11/screen.c index 9e19f17..0c79bae 100644 --- a/gui-x11/screen.c +++ b/gui-x11/screen.c @@ -73,8 +73,6 @@ Atom targets; Atom text; Atom compoundtext; -static XModifierKeymap *modmap; -static int keypermod; static Drawable xdrawable; /* static Atom wm_take_focus; */ static void xexpose(XEvent*); @@ -288,7 +286,6 @@ xinitscreen(void) XSetWindowAttributes attrs; XPixmapFormatValues *pfmt; int n; - Memdata *md; xscreenid = 0; xdrawable = 0; @@ -378,14 +375,11 @@ xinitscreen(void) initmap(rootwin); } - if((modmap = XGetModifierMapping(xdisplay))) - keypermod = modmap->max_keypermod; r.min = ZP; r.max.x = WidthOfScreen(screen); r.max.y = HeightOfScreen(screen); - md = mallocz(sizeof(Memdata), 1); xsize = Dx(r)*3/4; ysize = Dy(r)*3/4; @@ -644,11 +638,7 @@ xmapping(XEvent *e) if(e->type != MappingNotify) return; xe = (XMappingEvent*)e; - if(modmap) - XFreeModifiermap(modmap); - modmap = XGetModifierMapping(xe->display); - if(modmap) - keypermod = modmap->max_keypermod; + USED(xe); } diff --git a/kern/devip-posix.c b/kern/devip-posix.c index 21f698d..7f6171e 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) { - uint len; + socklen_t len; struct sockaddr_in sin; len = sizeof(sin); @@ -97,7 +97,7 @@ int so_accept(int fd, unsigned long *raddr, unsigned short *rport) { int nfd; - uint len; + socklen_t len; struct sockaddr_in sin; len = sizeof(sin); diff --git a/kern/posix.c b/kern/posix.c index cd1af3f..3e06131 100644 --- a/kern/posix.c +++ b/kern/posix.c @@ -126,6 +126,7 @@ tramp(void *vp) /* BUG: leaks Proc */ pthread_setspecific(prdakey, 0); pthread_exit(0); + return 0; } void @@ -161,20 +162,32 @@ int randfd; void randominit(void) { +#ifdef USE_RANDOM + srandom(getpid()+fastticks(nil)+ticks()); +#else if((randfd = open("/dev/urandom", OREAD)) < 0) if((randfd = open("/dev/random", OREAD)) < 0) panic("open /dev/random: %r"); +#endif } #undef read ulong randomread(void *v, ulong n) { +#ifdef USE_RANDOM + int i; + + for(i=0; irr); + wakeup(&q->rr); /* if we just wokeup a higher priority process, let it run */ /* + p = wakeup(&q->rr); if(p != nil && p->priority > up->priority) sched(); */ diff --git a/kern/term.c b/kern/term.c index 8dd282a..f8fa9cb 100644 --- a/kern/term.c +++ b/kern/term.c @@ -27,10 +27,9 @@ extern Memimage *gscreen; static Rectangle flushr; static Rectangle window; static Point curpos; -static int h, w; +static int h; static void termscreenputs(char*, int); -Point ZP; static void screenflush(void) @@ -51,7 +50,7 @@ addflush(Rectangle r) static void screenwin(void) { - Point p, q; + Point p; char *greet; Memimage *grey; @@ -60,7 +59,6 @@ screenwin(void) conscol = memblack; memfillcolor(gscreen, 0x444488FF); - w = memdefont->info[' '].width; h = memdefont->height; window.min = addpt(gscreen->r.min, Pt(20,20)); @@ -83,7 +81,6 @@ screenwin(void) greet = " Plan 9 Console "; p = addpt(window.min, Pt(10, 0)); - q = memsubfontwidth(memdefont, greet); memimagestring(gscreen, p, conscol, ZP, memdefont, greet); window.min.y += h+6; curpos = window.min; diff --git a/libmemdraw/draw.c b/libmemdraw/draw.c index c71b753..dab0ca2 100644 --- a/libmemdraw/draw.c +++ b/libmemdraw/draw.c @@ -308,9 +308,6 @@ drawclip(Memimage *dst, Rectangle *r, Memimage *src, Point *p0, Memimage *mask, * Conversion tables. */ static uchar replbit[1+8][256]; /* replbit[x][y] is the replication of the x-bit quantity y to 8-bit depth */ -static uchar conv18[256][8]; /* conv18[x][y] is the yth pixel in the depth-1 pixel x */ -static uchar conv28[256][4]; /* ... */ -static uchar conv48[256][2]; /* * bitmap of how to replicate n bits to fill 8, for 1 ≤ n ≤ 8. @@ -344,7 +341,7 @@ static int replmul[1+8] = { static void mktables(void) { - int i, j, mask, sh, small; + int i, j, small; if(tablesbuilt) return; @@ -361,17 +358,6 @@ mktables(void) } } - /* bit unpacking up to 8 bits, only powers of 2 */ - for(i=0; i<256; i++){ - for(j=0, sh=7, mask=1; j<8; j++, sh--) - conv18[i][j] = replbit[1][(i>>sh)&mask]; - - for(j=0, sh=6, mask=3; j<4; j++, sh-=2) - conv28[i][j] = replbit[2][(i>>sh)&mask]; - - for(j=0, sh=4, mask=15; j<2; j++, sh-=4) - conv48[i][j] = replbit[4][(i>>sh)&mask]; - } } static uchar ones = 0xff;