# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1298690232 0 # Node ID e6bec2290f3fde05a478f50cda9e437ab946e252 # Parent ba3af8eb56f1b53df1f9c3933b9ee0d17469728c Fixing warnings with Xcode 4 and switched to manual releasing in the draw functions to stop leaking. diff -r ba3af8eb56f1 -r e6bec2290f3f mac/dw.m --- a/mac/dw.m Fri Feb 25 21:12:02 2011 +0000 +++ b/mac/dw.m Sat Feb 26 03:17:12 2011 +0000 @@ -180,7 +180,7 @@ dw_pointer_query_pos(&x, &y); - return containercontextfunc(handler->window, text, x, y, handler->data, user); + return containercontextfunc(handler->window, text, (int)x, (int)y, handler->data, user); } case 12: { @@ -577,7 +577,7 @@ { if(tvcols && data) { - int cols = [tvcols count]; + int cols = (int)[tvcols count]; if(cols) { return [data count] / cols; @@ -590,7 +590,7 @@ if(tvcols) { int z, col = -1; - int count = [tvcols count]; + int count = (int)[tvcols count]; for(z=0;zhandle; @@ -2851,6 +2864,7 @@ } NSDictionary *dict = [[NSDictionary alloc] init]; NSSize size = [nstr sizeWithAttributes:dict]; + [dict release]; if(width) { *width = size.width; @@ -2859,6 +2873,7 @@ { *height = size.height; } + [nstr release]; [image unlockFocus]; } @@ -2888,7 +2903,9 @@ } NSBezierPath* aPath = [NSBezierPath bezierPath]; [aPath setLineWidth: 0.5]; - [[NSColor colorWithDeviceRed: DW_RED_VALUE(_foreground)/255.0 green: DW_GREEN_VALUE(_foreground)/255.0 blue: DW_BLUE_VALUE(_foreground)/255.0 alpha: 1] set]; + NSColor *color = [NSColor colorWithDeviceRed: DW_RED_VALUE(_foreground)/255.0 green: DW_GREEN_VALUE(_foreground)/255.0 blue: DW_BLUE_VALUE(_foreground)/255.0 alpha: 1]; + [color set]; + [color release]; [aPath moveToPoint:NSMakePoint(*x, *y)]; for(z=1;zwidth = size.width; @@ -4154,9 +4175,9 @@ unsigned long API dw_notebook_page_new(HWND handle, ULONG flags, int front) { DWNotebook *notebook = handle; - int page = [notebook pageid]; + NSInteger page = [notebook pageid]; DWNotebookPage *notepage = [[DWNotebookPage alloc] initWithIdentifier:nil]; - [notepage setPageid:(NSInteger)page]; + [notepage setPageid:page]; if(front) { [notebook insertTabViewItem:notepage atIndex:(NSInteger)0]; @@ -4406,10 +4427,10 @@ if([object isMemberOfClass:[NSWindow class]]) { NSWindow *window = object; - int currentstyle = [window styleMask]; + int currentstyle = (int)[window styleMask]; int tmp; - tmp = currentstyle | mask; + tmp = currentstyle | (int)mask; tmp ^= mask; tmp |= style; @@ -4849,7 +4870,7 @@ env->MajorBuild = env->MinorBuild = 0; - len = strlen(tempbuf); + len = (int)strlen(tempbuf); strcpy(env->buildDate, __DATE__); strcpy(env->buildTime, __TIME__); @@ -5147,7 +5168,7 @@ { if((message = _findsigmessage(signame)) != 0) { - _new_signal(message, window, msgid, sigfunc, data); + _new_signal(message, window, (int)msgid, sigfunc, data); } } }