SunOS can rot in hell.

This commit is contained in:
rsc 2004-03-26 01:59:35 +00:00
parent 4e3a2cc1f9
commit be22ae2d07
52 changed files with 211 additions and 160 deletions

View file

@ -21,39 +21,35 @@ typedef struct Subfont Subfont;
extern int Rfmt(Fmt*); extern int Rfmt(Fmt*);
extern int Pfmt(Fmt*); extern int Pfmt(Fmt*);
enum #define DOpaque 0xFFFFFFFF
{ #define DTransparent 0x00000000 /* only useful for allocimage memfillcolor */
DOpaque = 0xFFFFFFFF, #define DBlack 0x000000FF
DTransparent = 0x00000000, /* only useful for allocimage, memfillcolor */ #define DWhite 0xFFFFFFFF
DBlack = 0x000000FF, #define DRed 0xFF0000FF
DWhite = 0xFFFFFFFF, #define DGreen 0x00FF00FF
DRed = 0xFF0000FF, #define DBlue 0x0000FFFF
DGreen = 0x00FF00FF, #define DCyan 0x00FFFFFF
DBlue = 0x0000FFFF, #define DMagenta 0xFF00FFFF
DCyan = 0x00FFFFFF, #define DYellow 0xFFFF00FF
DMagenta = 0xFF00FFFF, #define DPaleyellow 0xFFFFAAFF
DYellow = 0xFFFF00FF, #define DDarkyellow 0xEEEE9EFF
DPaleyellow = 0xFFFFAAFF, #define DDarkgreen 0x448844FF
DDarkyellow = 0xEEEE9EFF, #define DPalegreen 0xAAFFAAFF
DDarkgreen = 0x448844FF, #define DMedgreen 0x88CC88FF
DPalegreen = 0xAAFFAAFF, #define DDarkblue 0x000055FF
DMedgreen = 0x88CC88FF, #define DPalebluegreen 0xAAFFFFFF
DDarkblue = 0x000055FF, #define DPaleblue 0x0000BBFF
DPalebluegreen= 0xAAFFFFFF, #define DBluegreen 0x008888FF
DPaleblue = 0x0000BBFF, #define DGreygreen 0x55AAAAFF
DBluegreen = 0x008888FF, #define DPalegreygreen 0x9EEEEEFF
DGreygreen = 0x55AAAAFF, #define DYellowgreen 0x99994CFF
DPalegreygreen = 0x9EEEEEFF, #define DMedblue 0x000099FF
DYellowgreen = 0x99994CFF, #define DGreyblue 0x005DBBFF
DMedblue = 0x000099FF, #define DPalegreyblue 0x4993DDFF
DGreyblue = 0x005DBBFF, #define DPurpleblue 0x8888CCFF
DPalegreyblue = 0x4993DDFF,
DPurpleblue = 0x8888CCFF,
DNotacolor = 0xFFFFFF00, #define DNotacolor 0xFFFFFF00
DNofill = DNotacolor, #define DNofill DNotacolor
};
enum enum
{ {

View file

@ -239,7 +239,7 @@ xstat(int argc, char **argv)
usage(); usage();
fid = xwalk(argv[0]); fid = xwalk(argv[0]);
if((d = fsdirfstat(fid)) < 0) if((d = fsdirfstat(fid)) == 0)
sysfatal("dirfstat: %r"); sysfatal("dirfstat: %r");
fmtinstall('D', dirfmt); fmtinstall('D', dirfmt);
fmtinstall('M', dirmodefmt); fmtinstall('M', dirmodefmt);

View file

@ -214,7 +214,7 @@ threadmain(int argc, char *argv[])
if(maxtab <= 0) if(maxtab <= 0)
maxtab = 8; maxtab = 8;
initdraw(nil, nil, "9term"); initdraw(0, nil, "9term");
notify(hangupnote); notify(hangupnote);
mc = initmouse(nil, screen); mc = initmouse(nil, screen);
@ -299,13 +299,27 @@ loop(void)
{ {
Rune r; Rune r;
int i; int i;
Alt a[] = { Alt a[5];
{mc->c, &mc->m, CHANRCV},
{kc->c, &r, CHANRCV}, a[0].c = mc->c;
{hostc, &i, CHANRCV}, a[0].v = &mc->m;
{mc->resizec, nil, CHANRCV}, a[0].op = CHANRCV;
{nil, nil, CHANEND},
}; a[1].c = kc->c;
a[1].v = &r;
a[1].op = CHANRCV;
a[2].c = hostc;
a[2].v = &i;
a[2].op = CHANRCV;
a[3].c = mc->resizec;
a[3].v = nil;
a[3].op = CHANRCV;
a[4].c = nil;
a[4].v = nil;
a[4].op = CHANEND;
for(;;) { for(;;) {
tcheck(); tcheck();
@ -326,7 +340,7 @@ loop(void)
key(r); key(r);
break; break;
case 2: case 2:
conswrite(rcbuf[i].data, rcbuf[i].n); conswrite((char*)rcbuf[i].data, rcbuf[i].n);
break; break;
case 3: case 3:
doreshape(); doreshape();

View file

@ -1,6 +1,8 @@
#include "9term.h" #include <u.h>
#include <termios.h> #include <termios.h>
#include <sys/termios.h> #include <sys/termios.h>
#include <libc.h>
#include "term.h"
int int
getpts(int fd[], char *slave) getpts(int fd[], char *slave)
@ -14,6 +16,19 @@ getpts(int fd[], char *slave)
return 0; return 0;
} }
int
childpty(int fd[], char *slave)
{
int sfd;
close(fd[1]);
setsid();
sfd = open(slave, ORDWR);
if(sfd < 0)
sysfatal("open %s: %r\n", slave);
return sfd;
}
struct winsize ows; struct winsize ows;
void void
@ -26,7 +41,7 @@ updatewinsize(int row, int col, int dx, int dy)
ws.ws_xpixel = dx; ws.ws_xpixel = dx;
ws.ws_ypixel = dy; ws.ws_ypixel = dy;
if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col) if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col)
if(ioctl(rcfd[0], TIOCSWINSZ, &ws) < 0) if(ioctl(rcfd, TIOCSWINSZ, &ws) < 0)
fprint(2, "ioctl: %r\n"); fprint(2, "ioctl: %r\n");
ows = ws; ows = ws;
} }

View file

@ -35,7 +35,12 @@ rcstart(int argc, char **argv, int *pfd)
dup(sfd, 0); dup(sfd, 0);
dup(sfd, 1); dup(sfd, 1);
dup(sfd, 2); dup(sfd, 2);
system("stty tabs -onlcr -echo erase ^h intr ^?"); // system("stty tabs -onlcr -echo erase '^h' intr '^?'");
system("echo tabs; stty tabs");
system("echo onlcr; stty -onlcr");
system("echo echo; stty -echo");
system("echo erase; stty erase '^h'");
system("echo intr; stty intr '^?'");
execvp(argv[0], argv); execvp(argv[0], argv);
fprint(2, "exec %s failed: %r\n", argv[0]); fprint(2, "exec %s failed: %r\n", argv[0]);
_exits("oops"); _exits("oops");

View file

@ -133,10 +133,10 @@ threadmain(int argc, char **argv)
name = "gnot"; name = "gnot";
threadnotify(nopipes, 1); threadnotify(nopipes, 1);
if((fs = nsmount("acme", "")) < 0) if((fs = nsmount("acme", "")) == 0)
sysfatal("nsmount acme: %r"); sysfatal("nsmount acme: %r");
ctlfd = fsopen(fs, "new/ctl", ORDWR|OCEXEC); ctlfd = fsopen(fs, "new/ctl", ORDWR|OCEXEC);
if(ctlfd < 0 || fsread(ctlfd, buf, 12) != 12) if(ctlfd == 0 || fsread(ctlfd, buf, 12) != 12)
sysfatal("ctl: %r"); sysfatal("ctl: %r");
id = atoi(buf); id = atoi(buf);
sprint(buf, "%d/tag", id); sprint(buf, "%d/tag", id);

View file

@ -64,7 +64,7 @@ number(Mntdir *md, Text *t, Range r, int line, int dir, int size, int *evalp)
if(line<0 || line>t->file->b.nc) if(line<0 || line>t->file->b.nc)
goto Rescue; goto Rescue;
*evalp = TRUE; *evalp = TRUE;
return (Range){line, line}; return range(line, line);
} }
q0 = r.q0; q0 = r.q0;
q1 = r.q1; q1 = r.q1;
@ -104,7 +104,7 @@ number(Mntdir *md, Text *t, Range r, int line, int dir, int size, int *evalp)
--q0; --q0;
} }
*evalp = TRUE; *evalp = TRUE;
return (Range){q0, q1}; return range(q0, q1);
Rescue: Rescue:
if(md != nil) if(md != nil)
@ -197,7 +197,7 @@ address(Mntdir *md, Text *t, Range lim, Range ar, void *a, uint q0, uint q1, int
if(c == '.') if(c == '.')
r = ar; r = ar;
else else
r = (Range){t->file->b.nc, t->file->b.nc}; r = range(t->file->b.nc, t->file->b.nc);
if(q < q1) if(q < q1)
dir = Fore; dir = Fore;
else else

View file

@ -106,7 +106,7 @@ Exectab exectab[] = {
{ LTab, tab, FALSE, XXX, XXX }, { LTab, tab, FALSE, XXX, XXX },
{ LUndo, undo, FALSE, TRUE, XXX }, { LUndo, undo, FALSE, TRUE, XXX },
{ LZerox, zeroxx, FALSE, XXX, XXX }, { LZerox, zeroxx, FALSE, XXX, XXX },
{ nil, nil, 0, 0, 0 }, { nil, 0, 0, 0, 0 },
}; };
Exectab* Exectab*

View file

@ -91,6 +91,7 @@ void flushwarnings(void);
void startplumbing(void); void startplumbing(void);
Runestr runestr(Rune*, uint); Runestr runestr(Rune*, uint);
Range range(int, int);
#define runemalloc(a) (Rune*)emalloc((a)*sizeof(Rune)) #define runemalloc(a) (Rune*)emalloc((a)*sizeof(Rune))
#define runerealloc(a, b) (Rune*)erealloc((a), (b)*sizeof(Rune)) #define runerealloc(a, b) (Rune*)erealloc((a), (b)*sizeof(Rune))

View file

@ -310,7 +310,7 @@ Xfid*
fsysflush(Xfid *x, Fid *f) fsysflush(Xfid *x, Fid *f)
{ {
USED(f); USED(f);
sendp(x->c, xfidflush); sendp(x->c, (void*)xfidflush);
return nil; return nil;
} }
@ -526,7 +526,7 @@ fsysopen(Xfid *x, Fid *f)
if(((f->dir->perm&~(DMDIR|DMAPPEND))&m) != m) if(((f->dir->perm&~(DMDIR|DMAPPEND))&m) != m)
goto Deny; goto Deny;
sendp(x->c, xfidopen); sendp(x->c, (void*)xfidopen);
return nil; return nil;
Deny: Deny:
@ -624,7 +624,7 @@ fsysread(Xfid *x, Fid *f)
free(b); free(b);
return x; return x;
} }
sendp(x->c, xfidread); sendp(x->c, (void*)xfidread);
return nil; return nil;
} }
@ -633,7 +633,7 @@ Xfid*
fsyswrite(Xfid *x, Fid *f) fsyswrite(Xfid *x, Fid *f)
{ {
USED(f); USED(f);
sendp(x->c, xfidwrite); sendp(x->c, (void*)xfidwrite);
return nil; return nil;
} }
@ -642,7 +642,7 @@ Xfid*
fsysclunk(Xfid *x, Fid *f) fsysclunk(Xfid *x, Fid *f)
{ {
fsysdelid(f->mntdir); fsysdelid(f->mntdir);
sendp(x->c, xfidclose); sendp(x->c, (void*)xfidclose);
return nil; return nil;
} }

View file

@ -591,7 +591,7 @@ expandfile(Text *t, uint q0, uint q1, Expand *e)
e->u.at = t; e->u.at = t;
e->a0 = amin+1; e->a0 = amin+1;
eval = FALSE; eval = FALSE;
address(nil, nil, (Range){-1,-1}, (Range){0, 0}, t, e->a0, amax, tgetc, &eval, (uint*)&e->a1); address(nil, nil, range(-1,-1), range(0,0), t, e->a0, amax, tgetc, &eval, (uint*)&e->a1);
return TRUE; return TRUE;
Isntfile: Isntfile:
@ -723,7 +723,7 @@ openfile(Text *t, Expand *e)
eval = FALSE; eval = FALSE;
else{ else{
eval = TRUE; eval = TRUE;
r = address(nil, t, (Range){-1, -1}, (Range){t->q0, t->q1}, e->u.at, e->a0, e->a1, e->agetc, &eval, &dummy); r = address(nil, t, range(-1,-1), range(t->q0, t->q1), e->u.at, e->a0, e->a1, e->agetc, &eval, &dummy);
if(eval == FALSE) if(eval == FALSE)
e->jump = FALSE; /* don't jump if invalid address */ e->jump = FALSE; /* don't jump if invalid address */
} }

View file

@ -894,7 +894,7 @@ textselect(Text *t)
/* horrible botch: while asleep, may have lost selection altogether */ /* horrible botch: while asleep, may have lost selection altogether */
if(selectq > t->file->b.nc) if(selectq > t->file->b.nc)
selectq = t->org + t->fr.p0; selectq = t->org + t->fr.p0;
t->fr.scroll = nil; t->fr.scroll = 0;
if(selectq < t->org) if(selectq < t->org)
q0 = selectq; q0 = selectq;
else else

View file

@ -14,6 +14,16 @@
static Point prevmouse; static Point prevmouse;
static Window *mousew; static Window *mousew;
Range
range(int q0, int q1)
{
Range r;
r.q0 = q0;
r.q1 = q1;
return r;
}
Runestr Runestr
runestr(Rune *r, uint n) runestr(Rune *r, uint n)
{ {

View file

@ -47,7 +47,7 @@ xfidctl(void *arg)
threadsetname("xfidctlthread"); threadsetname("xfidctlthread");
x = arg; x = arg;
for(;;){ for(;;){
f = recvp(x->c); f = (void(*)(Xfid*))recvp(x->c);
(*f)(x); (*f)(x);
flushimage(display, 1); flushimage(display, 1);
sendp(cxfidfree, x); sendp(cxfidfree, x);
@ -104,8 +104,8 @@ xfidopen(Xfid *x)
switch(q){ switch(q){
case QWaddr: case QWaddr:
if(w->nopen[q]++ == 0){ if(w->nopen[q]++ == 0){
w->addr = (Range){0,0}; w->addr = range(0,0);
w->limit = (Range){-1,-1}; w->limit = range(-1,-1);
} }
break; break;
case QWdata: case QWdata:
@ -164,7 +164,7 @@ xfidopen(Xfid *x)
seq++; seq++;
filemark(t->file); filemark(t->file);
cut(t, t, nil, FALSE, TRUE, nil, 0); cut(t, t, nil, FALSE, TRUE, nil, 0);
w->wrselrange = (Range){t->q1, t->q1}; w->wrselrange = range(t->q1, t->q1);
w->nomark = TRUE; w->nomark = TRUE;
break; break;
case QWeditout: case QWeditout:
@ -173,7 +173,7 @@ xfidopen(Xfid *x)
respond(x, &fc, Eperm); respond(x, &fc, Eperm);
return; return;
} }
w->wrselrange = (Range){t->q1, t->q1}; w->wrselrange = range(t->q1, t->q1);
break; break;
} }
winunlock(w); winunlock(w);

View file

@ -7,15 +7,19 @@
* American Heritage Dictionary (encrypted) * American Heritage Dictionary (encrypted)
*/ */
static Rune intab[256] = { static Rune intab[256];
[0x82] 0xe9,
[0x85] 0xe0, static void
[0x89] 0xeb, initintab(void)
[0x8a] 0xe8, {
[0xa4] 0xf1, intab[0x82] = 0xe9;
[0xf8] 0xb0, intab[0x85] = 0xe0;
[0xf9] 0xb7, intab[0x89] = 0xeb;
}; intab[0x8a] = 0xe8;
intab[0xa4] = 0xf1;
intab[0xf8] = 0xb0;
intab[0xf9] = 0xb7;
}
static char tag[64]; static char tag[64];
@ -33,6 +37,7 @@ ahdprintentry(Entry e, int cmd)
int c, state = Run; int c, state = Run;
if(!inited){ if(!inited){
initintab();
for(c=0; c<256; c++) for(c=0; c<256; c++)
if(intab[c] == 0) if(intab[c] == 0)
intab[c] = c; intab[c] = c;

View file

@ -67,7 +67,7 @@ inittagtab(void)
tagtab[TI]= "TI"; tagtab[TI]= "TI";
tagtab[TX]= "TX"; tagtab[TX]= "TX";
tagtab[VD]= "VD"; tagtab[VD]= "VD";
}; }
static char *mget(int, char *, char *, char **); static char *mget(int, char *, char *, char **);
#if 0 #if 0

View file

@ -992,7 +992,7 @@ static int naux;
static char auxname[Maxaux][Buflen]; static char auxname[Maxaux][Buflen];
static char auxval[Maxaux][Buflen]; static char auxval[Maxaux][Buflen];
static char spec[Buflen]; static char spec[Buflen];
static uchar *auxstate[Naux]; /* vals for most recent tag */ static char *auxstate[Naux]; /* vals for most recent tag */
static Entry curentry; static Entry curentry;
#define cursize (curentry.end-curentry.start) #define cursize (curentry.end-curentry.start)
@ -1154,7 +1154,7 @@ oedprintentry(Entry e, int cmd)
outchars(auxstate[Num]); outchars(auxstate[Num]);
outchars(") "); outchars(") ");
} else if(t == Sgk) { } else if(t == Sgk) {
i = grtab[auxstate[Num][0]]; i = grtab[(uchar)auxstate[Num][0]];
if(i != NONE) if(i != NONE)
outrune(i); outrune(i);
outchars(". "); outchars(". ");

View file

@ -124,7 +124,7 @@ yyerror(char *e, ...)
exits("syntax"); exits("syntax");
} }
long int
yylex(void) yylex(void)
{ {
char *q, *eq; char *q, *eq;

View file

@ -122,22 +122,25 @@ static Fcall* fsysremove(Fcall*, uchar*, Fid*);
static Fcall* fsysstat(Fcall*, uchar*, Fid*); static Fcall* fsysstat(Fcall*, uchar*, Fid*);
static Fcall* fsyswstat(Fcall*, uchar*, Fid*); static Fcall* fsyswstat(Fcall*, uchar*, Fid*);
Fcall* (*fcall[Tmax])(Fcall*, uchar*, Fid*) = Fcall* (*fcall[Tmax])(Fcall*, uchar*, Fid*);
static void
initfcall(void)
{ {
[Tflush] = fsysflush, fcall[Tflush] = fsysflush;
[Tversion] = fsysversion, fcall[Tversion] = fsysversion;
[Tauth] = fsysauth, fcall[Tauth] = fsysauth;
[Tattach] = fsysattach, fcall[Tattach] = fsysattach;
[Twalk] = fsyswalk, fcall[Twalk] = fsyswalk;
[Topen] = fsysopen, fcall[Topen] = fsysopen;
[Tcreate] = fsyscreate, fcall[Tcreate] = fsyscreate;
[Tread] = fsysread, fcall[Tread] = fsysread;
[Twrite] = fsyswrite, fcall[Twrite] = fsyswrite;
[Tclunk] = fsysclunk, fcall[Tclunk] = fsysclunk;
[Tremove]= fsysremove, fcall[Tremove]= fsysremove;
[Tstat] = fsysstat, fcall[Tstat] = fsysstat;
[Twstat] = fsyswstat, fcall[Twstat] = fsyswstat;
}; }
char Ebadfcall[] = "bad fcall type"; char Ebadfcall[] = "bad fcall type";
char Eperm[] = "permission denied"; char Eperm[] = "permission denied";
@ -208,6 +211,7 @@ fsysproc(void *v)
uchar *buf; uchar *buf;
USED(v); USED(v);
initfcall();
t = nil; t = nil;
for(;;){ for(;;){
buf = malloc(messagesize); /* avoid memset of emalloc */ buf = malloc(messagesize); /* avoid memset of emalloc */

View file

@ -89,21 +89,25 @@ char *rflush(Fid*), *rversion(Fid*), *rauth(Fid*),
*rread(Fid*), *rwrite(Fid*), *rclunk(Fid*), *rread(Fid*), *rwrite(Fid*), *rclunk(Fid*),
*rremove(Fid*), *rstat(Fid*), *rwstat(Fid*); *rremove(Fid*), *rstat(Fid*), *rwstat(Fid*);
char *(*fcalls[])(Fid*) = { char *(*fcalls[Tmax])(Fid*);
[Tversion] rversion,
[Tflush] rflush, static void
[Tauth] rauth, initfcalls(void)
[Tattach] rattach, {
[Twalk] rwalk, fcalls[Tversion]= rversion;
[Topen] ropen, fcalls[Tflush]= rflush;
[Tcreate] rcreate, fcalls[Tauth]= rauth;
[Tread] rread, fcalls[Tattach]= rattach;
[Twrite] rwrite, fcalls[Twalk]= rwalk;
[Tclunk] rclunk, fcalls[Topen]= ropen;
[Tremove] rremove, fcalls[Tcreate]= rcreate;
[Tstat] rstat, fcalls[Tread]= rread;
[Twstat] rwstat, fcalls[Twrite]= rwrite;
}; fcalls[Tclunk]= rclunk;
fcalls[Tremove]= rremove;
fcalls[Tstat]= rstat;
fcalls[Twstat]= rwstat;
}
char Eperm[] = "permission denied"; char Eperm[] = "permission denied";
char Enotdir[] = "not a directory"; char Enotdir[] = "not a directory";
@ -141,6 +145,7 @@ main(int argc, char *argv[])
int stdio = 0; int stdio = 0;
char *service; char *service;
initfcalls();
service = "ramfs"; service = "ramfs";
defmnt = "/tmp"; defmnt = "/tmp";
ARGBEGIN{ ARGBEGIN{

View file

@ -216,10 +216,9 @@ void Updenv(void){
} }
*/ */
int int
cmpenv(a, b) cmpenv(const void *a, const void *b)
char **a, **b;
{ {
return strcmp(*a, *b); return strcmp(*(char**)a, *(char**)b);
} }
char **mkenv(){ char **mkenv(){
register char **env, **ep, *p, *q; register char **env, **ep, *p, *q;
@ -462,7 +461,7 @@ void Noerror(void){
interrupted=0; interrupted=0;
} }
int int
Isatty(fd){ Isatty(int fd){
return isatty(fd); return isatty(fd);
} }
void Abort(void){ void Abort(void){

View file

@ -1,3 +1,4 @@
#include <u.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>

View file

@ -1,3 +1,4 @@
#include <u.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>

View file

@ -43,7 +43,7 @@ tm2Tm(struct tm *tm, Tm *bigtm)
if(bigtm->zone[0] == 0){ if(bigtm->zone[0] == 0){
s = getenv("TIMEZONE"); s = getenv("TIMEZONE");
if(s){ if(s){
strecpy(bigtm->zone, bigtm->zone+4, tm->tm_zone); strecpy(bigtm->zone, bigtm->zone+4, s);
free(s); free(s);
} }
} }

View file

@ -834,7 +834,7 @@ _drawmsgwrite(Display *d, void *v, int n)
err = "image parameters incompatibile with screen"; err = "image parameters incompatibile with screen";
goto error; goto error;
} }
reffn = nil; reffn = 0;
switch(refresh){ switch(refresh){
case Refbackup: case Refbackup:
break; break;
@ -985,9 +985,9 @@ _drawmsgwrite(Display *d, void *v, int n)
oy = BGLONG(a+41); oy = BGLONG(a+41);
op = drawclientop(client); op = drawclientop(client);
/* high bit indicates arc angles are present */ /* high bit indicates arc angles are present */
if(ox & (1<<31)){ if(ox & ((ulong)1<<31)){
if((ox & (1<<30)) == 0) if((ox & ((ulong)1<<30)) == 0)
ox &= ~(1<<31); ox &= ~((ulong)1<<31);
memarc(dst, p, e0, e1, c, src, sp, ox, oy, op); memarc(dst, p, e0, e1, c, src, sp, ox, oy, op);
}else }else
memellipse(dst, p, e0, e1, c, src, sp, op); memellipse(dst, p, e0, e1, c, src, sp, op);

View file

@ -56,27 +56,27 @@ fillellipseop(Image *dst, Point c, int a, int b, Image *src, Point sp, Drawop op
void void
arc(Image *dst, Point c, int a, int b, int thick, Image *src, Point sp, int alpha, int phi) arc(Image *dst, Point c, int a, int b, int thick, Image *src, Point sp, int alpha, int phi)
{ {
alpha |= 1<<31; alpha |= ((ulong)1)<<31;
doellipse('e', dst, &c, a, b, thick, src, &sp, alpha, phi, SoverD); doellipse('e', dst, &c, a, b, thick, src, &sp, alpha, phi, SoverD);
} }
void void
arcop(Image *dst, Point c, int a, int b, int thick, Image *src, Point sp, int alpha, int phi, Drawop op) arcop(Image *dst, Point c, int a, int b, int thick, Image *src, Point sp, int alpha, int phi, Drawop op)
{ {
alpha |= 1<<31; alpha |= (ulong)1<<31;
doellipse('e', dst, &c, a, b, thick, src, &sp, alpha, phi, op); doellipse('e', dst, &c, a, b, thick, src, &sp, alpha, phi, op);
} }
void void
fillarc(Image *dst, Point c, int a, int b, Image *src, Point sp, int alpha, int phi) fillarc(Image *dst, Point c, int a, int b, Image *src, Point sp, int alpha, int phi)
{ {
alpha |= 1<<31; alpha |= (ulong)1<<31;
doellipse('E', dst, &c, a, b, 0, src, &sp, alpha, phi, SoverD); doellipse('E', dst, &c, a, b, 0, src, &sp, alpha, phi, SoverD);
} }
void void
fillarcop(Image *dst, Point c, int a, int b, Image *src, Point sp, int alpha, int phi, Drawop op) fillarcop(Image *dst, Point c, int a, int b, Image *src, Point sp, int alpha, int phi, Drawop op)
{ {
alpha |= 1<<31; alpha |= (ulong)1<<31;
doellipse('E', dst, &c, a, b, 0, src, &sp, alpha, phi, op); doellipse('E', dst, &c, a, b, 0, src, &sp, alpha, phi, op);
} }

View file

@ -1906,7 +1906,7 @@ boolcopyfn(Memimage *img, Memimage *mask)
default: default:
assert(0 /* boolcopyfn */); assert(0 /* boolcopyfn */);
} }
return nil; return 0;
} }
/* /*

View file

@ -29,7 +29,7 @@ memlsetrefresh(Memimage *i, Refreshfn fn, void *ptr)
return 0; return 0;
/* easiest way is just to update the entire save area */ /* easiest way is just to update the entire save area */
l->refreshfn(i, i->r, l->refreshptr); l->refreshfn(i, i->r, l->refreshptr);
l->refreshfn = nil; l->refreshfn = 0;
l->refreshptr = nil; l->refreshptr = nil;
return 1; return 1;
} }

View file

@ -1,6 +1,5 @@
#include <sys/stat.h>
#include <u.h> #include <u.h>
#include <sys/stat.h>
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <cursor.h> #include <cursor.h>

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>

View file

@ -1,8 +1,8 @@
/* /*
* Some of the stuff in this file is not X-dependent and should be elsewhere. * Some of the stuff in this file is not X-dependent and should be elsewhere.
*/ */
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>
@ -69,7 +69,8 @@ _initdisplay(void (*error)(Display*, char*), char *label)
static Image* static Image*
getimage0(Display *d) getimage0(Display *d)
{ {
char *a, info[12*12+1]; char info[12*12+1];
uchar *a;
int n; int n;
Image *image; Image *image;
@ -323,7 +324,7 @@ xattach(char *label)
name.value = (uchar*)label; name.value = (uchar*)label;
name.encoding = XA_STRING; name.encoding = XA_STRING;
name.format = 8; name.format = 8;
name.nitems = strlen(name.value); name.nitems = strlen((char*)name.value);
memset(&normalhint, 0, sizeof normalhint); memset(&normalhint, 0, sizeof normalhint);
normalhint.flags = USSize|PMaxSize; normalhint.flags = USSize|PMaxSize;
@ -435,7 +436,7 @@ drawsetlabel(Display *d, char *label)
name.value = (uchar*)label; name.value = (uchar*)label;
name.encoding = XA_STRING; name.encoding = XA_STRING;
name.format = 8; name.format = 8;
name.nitems = strlen(name.value); name.nitems = strlen((char*)name.value);
memset(&classhint, 0, sizeof classhint); memset(&classhint, 0, sizeof classhint);
classhint.res_name = label; classhint.res_name = label;

View file

@ -1,8 +1,7 @@
/* input event and data structure translation */ /* input event and data structure translation */
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>
@ -318,8 +317,8 @@ _xsetcursor(Cursor *c)
fg = _x.map[0]; fg = _x.map[0];
bg = _x.map[255]; bg = _x.map[255];
xsrc = XCreateBitmapFromData(_x.display, _x.drawable, src, 16, 16); xsrc = XCreateBitmapFromData(_x.display, _x.drawable, (char*)src, 16, 16);
xmask = XCreateBitmapFromData(_x.display, _x.drawable, mask, 16, 16); xmask = XCreateBitmapFromData(_x.display, _x.drawable, (char*)mask, 16, 16);
xc = XCreatePixmapCursor(_x.display, xsrc, xmask, &fg, &bg, -c->offset.x, -c->offset.y); xc = XCreatePixmapCursor(_x.display, xsrc, xmask, &fg, &bg, -c->offset.x, -c->offset.y);
if(xc != 0) { if(xc != 0) {
XDefineCursor(_x.display, _x.drawable, xc); XDefineCursor(_x.display, _x.drawable, xc);
@ -412,14 +411,14 @@ _xgetsnarf(XDisplay *xd)
data = nil; data = nil;
}else{ }else{
if(xdata){ if(xdata){
data = strdup((char*)xdata); data = (uchar*)strdup((char*)xdata);
XFree(xdata); XFree(xdata);
}else }else
data = nil; data = nil;
} }
out: out:
qunlock(&clip.lk); qunlock(&clip.lk);
return data; return (char*)data;
} }
void void

View file

@ -1,5 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <thread.h> #include <thread.h>

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>

View file

@ -1,5 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <thread.h> #include <thread.h>

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>

View file

@ -1,5 +1,5 @@
#include "x11-inc.h"
#include <u.h> #include <u.h>
#include "x11-inc.h"
#include <libc.h> #include <libc.h>
#include <draw.h> #include <draw.h>
#include <memdraw.h> #include <memdraw.h>

View file

@ -24,7 +24,7 @@ fsdirwstat(Fsys *fs, char *name, Dir *d)
int int
fsdirfwstat(Fid *fid, Dir *d) fsdirfwstat(Fid *fid, Dir *d)
{ {
char *a; uchar *a;
int n, nn; int n, nn;
Fcall tx, rx; Fcall tx, rx;

View file

@ -1,4 +1,4 @@
#define mpdighi (mpdigit)(1<<(Dbits-1)) #define mpdighi (mpdigit)((ulong)1<<(Dbits-1))
#define DIGITS(x) ((Dbits - 1 + (x))/Dbits) #define DIGITS(x) ((Dbits - 1 + (x))/Dbits)
// for converting between int's and mpint's // for converting between int's and mpint's

View file

@ -1593,7 +1593,7 @@ static Ints *alg_oid_tab[NUMALGS+1] = {
(Ints*)&oid_md5, (Ints*)&oid_md5,
nil nil
}; };
static DigestFun digestalg[NUMALGS+1] = { md5, md5, md5, md5, sha1, md5, nil }; static DigestFun digestalg[NUMALGS+1] = { md5, md5, md5, md5, sha1, md5, 0 };
static void static void
freecert(CertX509* c) freecert(CertX509* c)

View file

@ -1,3 +1,4 @@
#include <u.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include "threadimpl.h" #include "threadimpl.h"

View file

@ -1,3 +1,4 @@
#include <u.h>
#include <signal.h> #include <signal.h>
#include "threadimpl.h" #include "threadimpl.h"

View file

@ -1,3 +1,4 @@
#include <u.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include "threadimpl.h" #include "threadimpl.h"

View file

@ -1,3 +1,4 @@
#include <u.h>
#include <signal.h> #include <signal.h>
#include "threadimpl.h" #include "threadimpl.h"

View file

@ -1,3 +1,4 @@
#include <u.h>
#include <signal.h> #include <signal.h>
#include "threadimpl.h" #include "threadimpl.h"

View file

@ -25,12 +25,12 @@ threadnotify(int (*f)(void*, char*), int in)
int (*from)(void*, char*), (*to)(void*, char*); int (*from)(void*, char*), (*to)(void*, char*);
if(in){ if(in){
from = nil; from = 0;
to = f; to = f;
topid = _threadgetproc()->pid; topid = _threadgetproc()->pid;
}else{ }else{
from = f; from = f;
to = nil; to = 0;
topid = 0; topid = 0;
} }
lock(&onnotelock); lock(&onnotelock);