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

View file

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

View file

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

View file

@ -1,6 +1,8 @@
#include "9term.h"
#include <u.h>
#include <termios.h>
#include <sys/termios.h>
#include <libc.h>
#include "term.h"
int
getpts(int fd[], char *slave)
@ -14,6 +16,19 @@ getpts(int fd[], char *slave)
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;
void
@ -26,7 +41,7 @@ updatewinsize(int row, int col, int dx, int dy)
ws.ws_xpixel = dx;
ws.ws_ypixel = dy;
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");
ows = ws;
}

View file

@ -35,7 +35,12 @@ rcstart(int argc, char **argv, int *pfd)
dup(sfd, 0);
dup(sfd, 1);
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);
fprint(2, "exec %s failed: %r\n", argv[0]);
_exits("oops");

View file

@ -133,10 +133,10 @@ threadmain(int argc, char **argv)
name = "gnot";
threadnotify(nopipes, 1);
if((fs = nsmount("acme", "")) < 0)
if((fs = nsmount("acme", "")) == 0)
sysfatal("nsmount acme: %r");
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");
id = atoi(buf);
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)
goto Rescue;
*evalp = TRUE;
return (Range){line, line};
return range(line, line);
}
q0 = r.q0;
q1 = r.q1;
@ -104,7 +104,7 @@ number(Mntdir *md, Text *t, Range r, int line, int dir, int size, int *evalp)
--q0;
}
*evalp = TRUE;
return (Range){q0, q1};
return range(q0, q1);
Rescue:
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 == '.')
r = ar;
else
r = (Range){t->file->b.nc, t->file->b.nc};
r = range(t->file->b.nc, t->file->b.nc);
if(q < q1)
dir = Fore;
else

View file

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

View file

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

View file

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

View file

@ -591,7 +591,7 @@ expandfile(Text *t, uint q0, uint q1, Expand *e)
e->u.at = t;
e->a0 = amin+1;
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;
Isntfile:
@ -723,7 +723,7 @@ openfile(Text *t, Expand *e)
eval = FALSE;
else{
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)
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 */
if(selectq > t->file->b.nc)
selectq = t->org + t->fr.p0;
t->fr.scroll = nil;
t->fr.scroll = 0;
if(selectq < t->org)
q0 = selectq;
else

View file

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

View file

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

View file

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

View file

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

View file

@ -992,7 +992,7 @@ static int naux;
static char auxname[Maxaux][Buflen];
static char auxval[Maxaux][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;
#define cursize (curentry.end-curentry.start)
@ -1154,7 +1154,7 @@ oedprintentry(Entry e, int cmd)
outchars(auxstate[Num]);
outchars(") ");
} else if(t == Sgk) {
i = grtab[auxstate[Num][0]];
i = grtab[(uchar)auxstate[Num][0]];
if(i != NONE)
outrune(i);
outchars(". ");

View file

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

View file

@ -122,22 +122,25 @@ static Fcall* fsysremove(Fcall*, uchar*, Fid*);
static Fcall* fsysstat(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,
[Tversion] = fsysversion,
[Tauth] = fsysauth,
[Tattach] = fsysattach,
[Twalk] = fsyswalk,
[Topen] = fsysopen,
[Tcreate] = fsyscreate,
[Tread] = fsysread,
[Twrite] = fsyswrite,
[Tclunk] = fsysclunk,
[Tremove]= fsysremove,
[Tstat] = fsysstat,
[Twstat] = fsyswstat,
};
fcall[Tflush] = fsysflush;
fcall[Tversion] = fsysversion;
fcall[Tauth] = fsysauth;
fcall[Tattach] = fsysattach;
fcall[Twalk] = fsyswalk;
fcall[Topen] = fsysopen;
fcall[Tcreate] = fsyscreate;
fcall[Tread] = fsysread;
fcall[Twrite] = fsyswrite;
fcall[Tclunk] = fsysclunk;
fcall[Tremove]= fsysremove;
fcall[Tstat] = fsysstat;
fcall[Twstat] = fsyswstat;
}
char Ebadfcall[] = "bad fcall type";
char Eperm[] = "permission denied";
@ -208,6 +211,7 @@ fsysproc(void *v)
uchar *buf;
USED(v);
initfcall();
t = nil;
for(;;){
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*),
*rremove(Fid*), *rstat(Fid*), *rwstat(Fid*);
char *(*fcalls[])(Fid*) = {
[Tversion] rversion,
[Tflush] rflush,
[Tauth] rauth,
[Tattach] rattach,
[Twalk] rwalk,
[Topen] ropen,
[Tcreate] rcreate,
[Tread] rread,
[Twrite] rwrite,
[Tclunk] rclunk,
[Tremove] rremove,
[Tstat] rstat,
[Twstat] rwstat,
};
char *(*fcalls[Tmax])(Fid*);
static void
initfcalls(void)
{
fcalls[Tversion]= rversion;
fcalls[Tflush]= rflush;
fcalls[Tauth]= rauth;
fcalls[Tattach]= rattach;
fcalls[Twalk]= rwalk;
fcalls[Topen]= ropen;
fcalls[Tcreate]= rcreate;
fcalls[Tread]= rread;
fcalls[Twrite]= rwrite;
fcalls[Tclunk]= rclunk;
fcalls[Tremove]= rremove;
fcalls[Tstat]= rstat;
fcalls[Twstat]= rwstat;
}
char Eperm[] = "permission denied";
char Enotdir[] = "not a directory";
@ -141,6 +145,7 @@ main(int argc, char *argv[])
int stdio = 0;
char *service;
initfcalls();
service = "ramfs";
defmnt = "/tmp";
ARGBEGIN{

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,5 @@
#include "x11-inc.h"
#include <u.h>
#include "x11-inc.h"
#include <libc.h>
#include <draw.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.
*/
#include "x11-inc.h"
#include <u.h>
#include "x11-inc.h"
#include <libc.h>
#include <draw.h>
#include <memdraw.h>
@ -69,7 +69,8 @@ _initdisplay(void (*error)(Display*, char*), char *label)
static Image*
getimage0(Display *d)
{
char *a, info[12*12+1];
char info[12*12+1];
uchar *a;
int n;
Image *image;
@ -323,7 +324,7 @@ xattach(char *label)
name.value = (uchar*)label;
name.encoding = XA_STRING;
name.format = 8;
name.nitems = strlen(name.value);
name.nitems = strlen((char*)name.value);
memset(&normalhint, 0, sizeof normalhint);
normalhint.flags = USSize|PMaxSize;
@ -435,7 +436,7 @@ drawsetlabel(Display *d, char *label)
name.value = (uchar*)label;
name.encoding = XA_STRING;
name.format = 8;
name.nitems = strlen(name.value);
name.nitems = strlen((char*)name.value);
memset(&classhint, 0, sizeof classhint);
classhint.res_name = label;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -24,7 +24,7 @@ fsdirwstat(Fsys *fs, char *name, Dir *d)
int
fsdirfwstat(Fid *fid, Dir *d)
{
char *a;
uchar *a;
int n, nn;
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)
// for converting between int's and mpint's

View file

@ -1593,7 +1593,7 @@ static Ints *alg_oid_tab[NUMALGS+1] = {
(Ints*)&oid_md5,
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
freecert(CertX509* c)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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