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
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue