mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
all: fix or silence all INSTALL warnings on macOS
Should be a clean build now. Change-Id: Id3460371cb5e8d4071f8faa9c2aec870d213a067 Reviewed-on: https://plan9port-review.googlesource.com/2781 Reviewed-by: Russ Cox <rsc@swtch.com>
This commit is contained in:
parent
9e0d3750c5
commit
310ae03327
15 changed files with 106 additions and 87 deletions
6
bin/9c
6
bin/9c
|
@ -41,8 +41,10 @@ quiet()
|
|||
ignore=$ignore'| from'
|
||||
ignore=$ignore'|use of C99 long long'
|
||||
ignore=$ignore'|ISO C forbids conversion'
|
||||
ignore=$ignore'|marked deprecated'
|
||||
ignore=$ignore'|is deprecated'
|
||||
ignore=$ignore'|warn_unused_result'
|
||||
ignore=$ignore'|expanded from macro'
|
||||
|
||||
grep -v '__p9l_autolib_' $1 |
|
||||
egrep -v "$ignore" |
|
||||
|
@ -80,12 +82,10 @@ case "$tag" in
|
|||
*FreeBSD*gcc*) usegcc ;;
|
||||
*FreeBSD*clang*) useclang ;;
|
||||
*DragonFly*|*BSD*) usegcc ;;
|
||||
*Darwin-x86_64*clang*)
|
||||
*Darwin-x86_64*)
|
||||
useclang
|
||||
cflags="$ngflags -g3 -m64"
|
||||
;;
|
||||
*Darwin-x86_64*) usegcc
|
||||
cflags="$ngflags -g3 -no-cpp-precomp -m64" ;;
|
||||
*Darwin*clang*)
|
||||
useclang
|
||||
cflags="$ngflags -g3 -m32"
|
||||
|
|
|
@ -128,7 +128,8 @@ yyparse(void)
|
|||
yychar = -1;
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yyp = &yys[-1];
|
||||
yyp = &yys[0];
|
||||
yyp--;
|
||||
goto yystack;
|
||||
|
||||
ret0:
|
||||
|
|
|
@ -46,8 +46,8 @@ iobuf_init(void)
|
|||
|
||||
n = nclust*sizeof(Ioclust) +
|
||||
nclust*BUFPERCLUST*(sizeof(Iobuf)+Sectorsize);
|
||||
mem = sbrk(n);
|
||||
if(mem == (void*)-1)
|
||||
mem = malloc(n);
|
||||
if(mem == (void*)0)
|
||||
panic(0, "iobuf_init");
|
||||
memset(mem, 0, n);
|
||||
|
||||
|
|
|
@ -652,7 +652,7 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname)
|
|||
d = dirstat(name);
|
||||
if(d!=nil && runeeq(namer, nname, f->name, f->nname)){
|
||||
/* f->mtime+1 because when talking over NFS it's often off by a second */
|
||||
if(f->dev!=d->dev || f->qidpath!=d->qid.path || abs(f->mtime-d->mtime) > 1){
|
||||
if(f->dev!=d->dev || f->qidpath!=d->qid.path || labs((long)(f->mtime-d->mtime)) > 1){
|
||||
if(f->unread)
|
||||
warning(nil, "%s not written; file already exists\n", name);
|
||||
else
|
||||
|
|
|
@ -219,13 +219,12 @@ main(int argc, char *argv[])
|
|||
fprint(2, "dd: counts: cannot be zero\n");
|
||||
exits("counts");
|
||||
}
|
||||
ibuf = sbrk(ibs);
|
||||
ibuf = malloc(ibs);
|
||||
if(fflag)
|
||||
obuf = ibuf;
|
||||
else
|
||||
obuf = sbrk(obs);
|
||||
sbrk(64); /* For good measure */
|
||||
if(ibuf == (char *)-1 || obuf == (char *)-1) {
|
||||
obuf = malloc(obs);
|
||||
if(ibuf == (char *)0 || obuf == (char *)0) {
|
||||
fprint(2, "dd: not enough memory: %r\n");
|
||||
exits("memory");
|
||||
}
|
||||
|
|
|
@ -28,6 +28,30 @@
|
|||
#include "bigarrow.h"
|
||||
#include "glendapng.h"
|
||||
|
||||
// Use non-deprecated names.
|
||||
#define NSKeyDown NSEventTypeKeyDown
|
||||
#define NSAlternateKeyMask NSEventModifierFlagOption
|
||||
#define NSCommandKeyMask NSEventModifierFlagCommand
|
||||
#define NSResizableWindowMask NSWindowStyleMaskResizable
|
||||
#define NSLeftMouseDown NSEventTypeLeftMouseDown
|
||||
#define NSLeftMouseUp NSEventTypeLeftMouseUp
|
||||
#define NSRightMouseDown NSEventTypeRightMouseDown
|
||||
#define NSRightMouseUp NSEventTypeRightMouseUp
|
||||
#define NSOtherMouseDown NSEventTypeOtherMouseDown
|
||||
#define NSOtherMouseUp NSEventTypeOtherMouseUp
|
||||
#define NSScrollWheel NSEventTypeScrollWheel
|
||||
#define NSMouseMoved NSEventTypeMouseMoved
|
||||
#define NSLeftMouseDragged NSEventTypeLeftMouseDragged
|
||||
#define NSRightMouseDragged NSEventTypeRightMouseDragged
|
||||
#define NSOtherMouseDragged NSEventTypeOtherMouseDragged
|
||||
#define NSCompositeCopy NSCompositingOperationCopy
|
||||
#define NSCompositeSourceIn NSCompositingOperationSourceIn
|
||||
#define NSFlagsChanged NSEventTypeFlagsChanged
|
||||
#define NSTitledWindowMask NSWindowStyleMaskTitled
|
||||
#define NSClosableWindowMask NSWindowStyleMaskClosable
|
||||
#define NSMiniaturizableWindowMask NSWindowStyleMaskMiniaturizable
|
||||
#define NSBorderlessWindowMask NSWindowStyleMaskBorderless
|
||||
|
||||
AUTOFRAMEWORK(Cocoa)
|
||||
|
||||
#define LOG if(0)NSLog
|
||||
|
@ -53,7 +77,9 @@ usage(void)
|
|||
threadexitsall("usage");
|
||||
}
|
||||
|
||||
@interface appdelegate : NSObject @end
|
||||
@interface appdelegate : NSObject<NSApplicationDelegate,NSWindowDelegate> @end
|
||||
|
||||
NSObject<NSApplicationDelegate,NSWindowDelegate> *myApp;
|
||||
|
||||
void
|
||||
threadmain(int argc, char **argv)
|
||||
|
@ -97,7 +123,8 @@ threadmain(int argc, char **argv)
|
|||
|
||||
[NSApplication sharedApplication];
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
[NSApp setDelegate:[appdelegate new]];
|
||||
myApp = [appdelegate new];
|
||||
[NSApp setDelegate:myApp];
|
||||
[NSApp run];
|
||||
}
|
||||
|
||||
|
@ -402,7 +429,7 @@ makewin(char *s)
|
|||
backing:NSBackingStoreBuffered defer:YES];
|
||||
for(i=0; i<2; i++){
|
||||
[win.ofs[i] setAcceptsMouseMovedEvents:YES];
|
||||
[win.ofs[i] setDelegate:[NSApp delegate]];
|
||||
[win.ofs[i] setDelegate:myApp];
|
||||
[win.ofs[i] setDisplaysWhenScreenProfileChanges:NO];
|
||||
}
|
||||
win.isofs = 0;
|
||||
|
@ -567,7 +594,7 @@ flushimg(NSRect rect)
|
|||
rect = dilate(scalerect(rect, win.topointscale));
|
||||
r.size.height -= Cornersize;
|
||||
dr = NSIntersectionRect(r, rect);
|
||||
LOG(@"r %.0f %.0f", r.origin.x, r.origin.y, rect.size.width, rect.size.height);
|
||||
LOG(@"r %.0f %.0f %.0f %.0f", r.origin.x, r.origin.y, rect.size.width, rect.size.height);
|
||||
LOG(@"rect in points %f %f %.0f %.0f", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
|
||||
LOG(@"dr in points %f %f %.0f %.0f", dr.origin.x, dr.origin.y, dr.size.width, dr.size.height);
|
||||
drawimg(dr, NSCompositeCopy);
|
||||
|
@ -792,52 +819,52 @@ static void updatecursor(void);
|
|||
|
||||
static int keycvt[] =
|
||||
{
|
||||
[QZ_IBOOK_ENTER] '\n',
|
||||
[QZ_RETURN] '\n',
|
||||
[QZ_ESCAPE] 27,
|
||||
[QZ_BACKSPACE] '\b',
|
||||
[QZ_LALT] Kalt,
|
||||
[QZ_LCTRL] Kctl,
|
||||
[QZ_LSHIFT] Kshift,
|
||||
[QZ_F1] KF+1,
|
||||
[QZ_F2] KF+2,
|
||||
[QZ_F3] KF+3,
|
||||
[QZ_F4] KF+4,
|
||||
[QZ_F5] KF+5,
|
||||
[QZ_F6] KF+6,
|
||||
[QZ_F7] KF+7,
|
||||
[QZ_F8] KF+8,
|
||||
[QZ_F9] KF+9,
|
||||
[QZ_F10] KF+10,
|
||||
[QZ_F11] KF+11,
|
||||
[QZ_F12] KF+12,
|
||||
[QZ_INSERT] Kins,
|
||||
[QZ_DELETE] 0x7F,
|
||||
[QZ_HOME] Khome,
|
||||
[QZ_END] Kend,
|
||||
[QZ_KP_PLUS] '+',
|
||||
[QZ_KP_MINUS] '-',
|
||||
[QZ_TAB] '\t',
|
||||
[QZ_PAGEUP] Kpgup,
|
||||
[QZ_PAGEDOWN] Kpgdown,
|
||||
[QZ_UP] Kup,
|
||||
[QZ_DOWN] Kdown,
|
||||
[QZ_LEFT] Kleft,
|
||||
[QZ_RIGHT] Kright,
|
||||
[QZ_KP_MULTIPLY] '*',
|
||||
[QZ_KP_DIVIDE] '/',
|
||||
[QZ_KP_ENTER] '\n',
|
||||
[QZ_KP_PERIOD] '.',
|
||||
[QZ_KP0] '0',
|
||||
[QZ_KP1] '1',
|
||||
[QZ_KP2] '2',
|
||||
[QZ_KP3] '3',
|
||||
[QZ_KP4] '4',
|
||||
[QZ_KP5] '5',
|
||||
[QZ_KP6] '6',
|
||||
[QZ_KP7] '7',
|
||||
[QZ_KP8] '8',
|
||||
[QZ_KP9] '9',
|
||||
[QZ_IBOOK_ENTER]= '\n',
|
||||
[QZ_RETURN]= '\n',
|
||||
[QZ_ESCAPE]= 27,
|
||||
[QZ_BACKSPACE]= '\b',
|
||||
[QZ_LALT]= Kalt,
|
||||
[QZ_LCTRL]= Kctl,
|
||||
[QZ_LSHIFT]= Kshift,
|
||||
[QZ_F1]= KF+1,
|
||||
[QZ_F2]= KF+2,
|
||||
[QZ_F3]= KF+3,
|
||||
[QZ_F4]= KF+4,
|
||||
[QZ_F5]= KF+5,
|
||||
[QZ_F6]= KF+6,
|
||||
[QZ_F7]= KF+7,
|
||||
[QZ_F8]= KF+8,
|
||||
[QZ_F9]= KF+9,
|
||||
[QZ_F10]= KF+10,
|
||||
[QZ_F11]= KF+11,
|
||||
[QZ_F12]= KF+12,
|
||||
[QZ_INSERT]= Kins,
|
||||
[QZ_DELETE]= 0x7F,
|
||||
[QZ_HOME]= Khome,
|
||||
[QZ_END]= Kend,
|
||||
[QZ_KP_PLUS]= '+',
|
||||
[QZ_KP_MINUS]= '-',
|
||||
[QZ_TAB]= '\t',
|
||||
[QZ_PAGEUP]= Kpgup,
|
||||
[QZ_PAGEDOWN]= Kpgdown,
|
||||
[QZ_UP]= Kup,
|
||||
[QZ_DOWN]= Kdown,
|
||||
[QZ_LEFT]= Kleft,
|
||||
[QZ_RIGHT]= Kright,
|
||||
[QZ_KP_MULTIPLY]= '*',
|
||||
[QZ_KP_DIVIDE]= '/',
|
||||
[QZ_KP_ENTER]= '\n',
|
||||
[QZ_KP_PERIOD]= '.',
|
||||
[QZ_KP0]= '0',
|
||||
[QZ_KP1]= '1',
|
||||
[QZ_KP2]= '2',
|
||||
[QZ_KP3]= '3',
|
||||
[QZ_KP4]= '4',
|
||||
[QZ_KP5]= '5',
|
||||
[QZ_KP6]= '6',
|
||||
[QZ_KP7]= '7',
|
||||
[QZ_KP8]= '8',
|
||||
[QZ_KP9]= '9',
|
||||
};
|
||||
|
||||
@interface apptext : NSTextView @end
|
||||
|
@ -1138,30 +1165,25 @@ sendmouse(void)
|
|||
void
|
||||
setmouse(Point p)
|
||||
{
|
||||
static int first = 1;
|
||||
NSPoint q;
|
||||
NSRect r;
|
||||
|
||||
if([NSApp isActive]==0 && in.willactivate==0)
|
||||
return;
|
||||
|
||||
if(first){
|
||||
/* Try to move Acme's scrollbars without that! */
|
||||
CGSetLocalEventsSuppressionInterval(0);
|
||||
first = 0;
|
||||
}
|
||||
if([WIN inLiveResize])
|
||||
return;
|
||||
|
||||
in.mpos = scalepoint(NSMakePoint(p.x, p.y), win.topointscale); // race condition
|
||||
|
||||
q = [win.content convertPoint:in.mpos toView:nil];
|
||||
q = [WIN convertBaseToScreen:q];
|
||||
q = [WIN convertRectToScreen:NSMakeRect(q.x, q.y, 0, 0)].origin;
|
||||
|
||||
r = [[[NSScreen screens] objectAtIndex:0] frame];
|
||||
q.y = r.size.height - q.y; /* Quartz is top-left-based here */
|
||||
|
||||
CGWarpMouseCursorPosition(NSPointToCGPoint(q));
|
||||
CGAssociateMouseAndMouseCursorPosition(true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1431,14 +1453,14 @@ makecursor(Cursor *c)
|
|||
samplesPerPixel:2
|
||||
hasAlpha:YES
|
||||
isPlanar:YES
|
||||
colorSpaceName:NSDeviceBlackColorSpace
|
||||
colorSpaceName:NSDeviceWhiteColorSpace
|
||||
bytesPerRow:2
|
||||
bitsPerPixel:1];
|
||||
|
||||
[r getBitmapDataPlanes:plane];
|
||||
|
||||
for(b=0; b<2*16; b++){
|
||||
plane[0][b] = c->set[b];
|
||||
plane[0][b] = ~c->set[b];
|
||||
plane[1][b] = c->clr[b];
|
||||
}
|
||||
p = NSMakePoint(-c->offset.x, -c->offset.y);
|
||||
|
|
|
@ -727,10 +727,10 @@ drawcoord(uchar *p, uchar *maxp, int oldx, int *newx)
|
|||
x |= *p++ << 7;
|
||||
x |= *p++ << 15;
|
||||
if(x & (1<<22))
|
||||
x |= ~0<<23;
|
||||
x |= ~0U<<23;
|
||||
}else{
|
||||
if(b & 0x40)
|
||||
x |= ~0<<7;
|
||||
x |= ~0U<<7;
|
||||
x += oldx;
|
||||
}
|
||||
*newx = x;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
AUTOFRAMEWORK(Foundation)
|
||||
AUTOFRAMEWORK(Cocoa)
|
||||
|
||||
@interface appdelegate : NSObject @end
|
||||
@interface appdelegate : NSObject<NSApplicationDelegate> @end
|
||||
|
||||
void
|
||||
main(void)
|
||||
|
@ -16,7 +16,7 @@ main(void)
|
|||
[NSAutoreleasePool new];
|
||||
|
||||
[NSApplication sharedApplication];
|
||||
NSObject *delegate = [appdelegate new];
|
||||
NSObject<NSApplicationDelegate> *delegate = [appdelegate new];
|
||||
[NSApp setDelegate:delegate];
|
||||
|
||||
NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager]; /* Register a call-back for URL Events */
|
||||
|
|
|
@ -66,7 +66,7 @@ $O.flfmt: flfmt9660.$O
|
|||
|
||||
flfmt%.$O: flfmt9660.h
|
||||
|
||||
$O.conf:D: conf.rc
|
||||
$O.conf:DQ: conf.rc
|
||||
{
|
||||
echo '#!/usr/local/plan9/bin/rc'
|
||||
echo '# THIS FILE IS AUTOMATICALLY GENERATED'
|
||||
|
|
|
@ -10,11 +10,11 @@ mal(int n)
|
|||
n = (n+3) & ~3;
|
||||
if(m < n) {
|
||||
if(n > Nhunk) {
|
||||
v = sbrk(n);
|
||||
v = malloc(n);
|
||||
memset(v, 0, n);
|
||||
return v;
|
||||
}
|
||||
s = sbrk(Nhunk);
|
||||
s = malloc(Nhunk);
|
||||
m = Nhunk;
|
||||
}
|
||||
v = s;
|
||||
|
|
|
@ -9,7 +9,7 @@ static int
|
|||
Xperspective(struct place *place, double *x, double *y)
|
||||
{
|
||||
double r;
|
||||
if(viewpt<=1+FUZZ && fabs(place->nlat.s<=viewpt+.01))
|
||||
if(viewpt<=1+FUZZ && fabs(place->nlat.s)<=viewpt+.01)
|
||||
return(-1);
|
||||
r = place->nlat.c*(viewpt - 1.)/(viewpt - place->nlat.s);
|
||||
*x = - r*place->wlon.s;
|
||||
|
|
|
@ -154,7 +154,7 @@ statgraph(Graph *g)
|
|||
|
||||
qlock(&memdrawlock);
|
||||
ginit();
|
||||
if(smallfont==nil || black==nil || blue==nil || red==nil || hifill==nil || lofill==nil){
|
||||
if(smallfont==nil || black==nil || blue==nil || red==nil || hifill[0]==nil || lofill[0]==nil){
|
||||
werrstr("graphics initialization failed: %r");
|
||||
qunlock(&memdrawlock);
|
||||
return nil;
|
||||
|
|
|
@ -1701,7 +1701,7 @@ badop:
|
|||
return 0;
|
||||
ip->imm64 = ip->imm;
|
||||
if(ip->rex&REXW && (ip->imm & (1<<31)) != 0)
|
||||
ip->imm64 |= (vlong)~0 << 32;
|
||||
ip->imm64 |= (vlong)(~0ULL << 32);
|
||||
} else {
|
||||
if (igets(map, ip, &s)< 0)
|
||||
return 0;
|
||||
|
|
|
@ -138,7 +138,7 @@ typedef struct {
|
|||
char *err; /* errmsg */
|
||||
} Instr;
|
||||
|
||||
#define IBF(v,a,b) (((ulong)(v)>>(32-(b)-1)) & ~(~0L<<(((b)-(a)+1))))
|
||||
#define IBF(v,a,b) (((ulong)(v)>>(32-(b)-1)) & ~(~0UL<<(((b)-(a)+1))))
|
||||
#define IB(v,b) IBF((v),(b),(b))
|
||||
|
||||
static void
|
||||
|
@ -165,7 +165,7 @@ decode(ulong pc, Instr *i)
|
|||
i->crbb = IBF(w, 16, 20);
|
||||
i->bd = IBF(w, 16, 29)<<2;
|
||||
if(i->bd & 0x8000)
|
||||
i->bd |= ~0L<<16;
|
||||
i->bd |= ~0UL<<16;
|
||||
i->crfd = IBF(w, 6, 8);
|
||||
i->crfs = IBF(w, 11, 13);
|
||||
i->bi = IBF(w, 11, 15);
|
||||
|
@ -181,7 +181,7 @@ decode(ulong pc, Instr *i)
|
|||
i->crm = IBF(w, 12, 19);
|
||||
i->li = IBF(w, 6, 29)<<2;
|
||||
if(IB(w, 6))
|
||||
i->li |= ~0<<25;
|
||||
i->li |= ~0UL<<25;
|
||||
i->lk = IB(w, 31);
|
||||
i->mb = IBF(w, 21, 25);
|
||||
i->me = IBF(w, 26, 30);
|
||||
|
|
|
@ -15,9 +15,6 @@ struct Node
|
|||
Reinst* last;
|
||||
}Node;
|
||||
|
||||
/* max character classes per program is nelem(reprog->class) */
|
||||
static Reprog *reprog;
|
||||
|
||||
/* max rune ranges per character class is nelem(classp->spans)/2 */
|
||||
#define NCCRUNE nelem(classp->spans)
|
||||
|
||||
|
@ -327,7 +324,7 @@ dump(Reprog *pp)
|
|||
static Reclass*
|
||||
newclass(void)
|
||||
{
|
||||
if(nclass >= nelem(reprog->class))
|
||||
if(nclass >= nelem(((Reprog*)0)->class))
|
||||
rcerror("too many character classes; increase Reprog.class size");
|
||||
return &(classp[nclass++]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue