From 67ea41051f3eba777fcceb037c07d7d1d8e7fcaf Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 11 Apr 2008 17:52:05 +0000 Subject: [PATCH] mac build compiles again --- Transmission.xcodeproj/project.pbxproj | 32 +++++++++++++------------- macosx/Controller.m | 20 ++++++++-------- macosx/TorrentCell.m | 4 ++-- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 088122b2c..f1e878ea7 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -248,12 +248,12 @@ BEFC1E2C0C07861A00B0BB3C /* upnp.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1DF30C07861A00B0BB3C /* upnp.h */; }; BEFC1E2D0C07861A00B0BB3C /* upnp.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DF40C07861A00B0BB3C /* upnp.c */; }; BEFC1E2E0C07861A00B0BB3C /* transmission.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1DF50C07861A00B0BB3C /* transmission.h */; }; - BEFC1E2F0C07861A00B0BB3C /* transmission.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DF60C07861A00B0BB3C /* transmission.c */; }; + BEFC1E2F0C07861A00B0BB3C /* session.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DF60C07861A00B0BB3C /* session.c */; }; BEFC1E300C07861A00B0BB3C /* tracker.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1DF70C07861A00B0BB3C /* tracker.h */; }; BEFC1E310C07861A00B0BB3C /* tracker.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DF80C07861A00B0BB3C /* tracker.c */; }; BEFC1E320C07861A00B0BB3C /* torrent.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DF90C07861A00B0BB3C /* torrent.c */; }; - BEFC1E350C07861A00B0BB3C /* shared.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1DFC0C07861A00B0BB3C /* shared.h */; }; - BEFC1E360C07861A00B0BB3C /* shared.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DFD0C07861A00B0BB3C /* shared.c */; }; + BEFC1E350C07861A00B0BB3C /* port-forwarding.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1DFC0C07861A00B0BB3C /* port-forwarding.h */; }; + BEFC1E360C07861A00B0BB3C /* port-forwarding.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1DFD0C07861A00B0BB3C /* port-forwarding.c */; }; BEFC1E390C07861A00B0BB3C /* ratecontrol.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1E000C07861A00B0BB3C /* ratecontrol.h */; }; BEFC1E3A0C07861A00B0BB3C /* ratecontrol.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1E010C07861A00B0BB3C /* ratecontrol.c */; }; BEFC1E3B0C07861A00B0BB3C /* platform.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1E020C07861A00B0BB3C /* platform.h */; }; @@ -266,7 +266,7 @@ BEFC1E4A0C07861A00B0BB3C /* metainfo.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1E110C07861A00B0BB3C /* metainfo.c */; }; BEFC1E4B0C07861A00B0BB3C /* ipcparse.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1E120C07861A00B0BB3C /* ipcparse.h */; }; BEFC1E4C0C07861A00B0BB3C /* ipcparse.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1E130C07861A00B0BB3C /* ipcparse.c */; }; - BEFC1E4D0C07861A00B0BB3C /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1E140C07861A00B0BB3C /* internal.h */; }; + BEFC1E4D0C07861A00B0BB3C /* session.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1E140C07861A00B0BB3C /* session.h */; }; BEFC1E4E0C07861A00B0BB3C /* inout.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1E150C07861A00B0BB3C /* inout.h */; }; BEFC1E4F0C07861A00B0BB3C /* inout.c in Sources */ = {isa = PBXBuildFile; fileRef = BEFC1E160C07861A00B0BB3C /* inout.c */; }; BEFC1E520C07861A00B0BB3C /* fdlimit.h in Headers */ = {isa = PBXBuildFile; fileRef = BEFC1E190C07861A00B0BB3C /* fdlimit.h */; }; @@ -699,12 +699,12 @@ BEFC1DF30C07861A00B0BB3C /* upnp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = upnp.h; path = libtransmission/upnp.h; sourceTree = ""; }; BEFC1DF40C07861A00B0BB3C /* upnp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = upnp.c; path = libtransmission/upnp.c; sourceTree = ""; }; BEFC1DF50C07861A00B0BB3C /* transmission.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = transmission.h; path = libtransmission/transmission.h; sourceTree = ""; }; - BEFC1DF60C07861A00B0BB3C /* transmission.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = transmission.c; path = libtransmission/transmission.c; sourceTree = ""; }; + BEFC1DF60C07861A00B0BB3C /* session.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = session.c; path = libtransmission/session.c; sourceTree = ""; }; BEFC1DF70C07861A00B0BB3C /* tracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = tracker.h; path = libtransmission/tracker.h; sourceTree = ""; }; BEFC1DF80C07861A00B0BB3C /* tracker.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = tracker.c; path = libtransmission/tracker.c; sourceTree = ""; }; BEFC1DF90C07861A00B0BB3C /* torrent.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = torrent.c; path = libtransmission/torrent.c; sourceTree = ""; }; - BEFC1DFC0C07861A00B0BB3C /* shared.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = shared.h; path = libtransmission/shared.h; sourceTree = ""; }; - BEFC1DFD0C07861A00B0BB3C /* shared.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = shared.c; path = libtransmission/shared.c; sourceTree = ""; }; + BEFC1DFC0C07861A00B0BB3C /* port-forwarding.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "port-forwarding.h"; path = "libtransmission/port-forwarding.h"; sourceTree = ""; }; + BEFC1DFD0C07861A00B0BB3C /* port-forwarding.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = "port-forwarding.c"; path = "libtransmission/port-forwarding.c"; sourceTree = ""; }; BEFC1E000C07861A00B0BB3C /* ratecontrol.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ratecontrol.h; path = libtransmission/ratecontrol.h; sourceTree = ""; }; BEFC1E010C07861A00B0BB3C /* ratecontrol.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ratecontrol.c; path = libtransmission/ratecontrol.c; sourceTree = ""; }; BEFC1E020C07861A00B0BB3C /* platform.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = platform.h; path = libtransmission/platform.h; sourceTree = ""; }; @@ -717,7 +717,7 @@ BEFC1E110C07861A00B0BB3C /* metainfo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = metainfo.c; path = libtransmission/metainfo.c; sourceTree = ""; }; BEFC1E120C07861A00B0BB3C /* ipcparse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ipcparse.h; path = libtransmission/ipcparse.h; sourceTree = ""; }; BEFC1E130C07861A00B0BB3C /* ipcparse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ipcparse.c; path = libtransmission/ipcparse.c; sourceTree = ""; }; - BEFC1E140C07861A00B0BB3C /* internal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = internal.h; path = libtransmission/internal.h; sourceTree = ""; }; + BEFC1E140C07861A00B0BB3C /* session.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = session.h; path = libtransmission/session.h; sourceTree = ""; }; BEFC1E150C07861A00B0BB3C /* inout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = inout.h; path = libtransmission/inout.h; sourceTree = ""; }; BEFC1E160C07861A00B0BB3C /* inout.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = inout.c; path = libtransmission/inout.c; sourceTree = ""; }; BEFC1E190C07861A00B0BB3C /* fdlimit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fdlimit.h; path = libtransmission/fdlimit.h; sourceTree = ""; }; @@ -1076,13 +1076,14 @@ BEFC1DF30C07861A00B0BB3C /* upnp.h */, BEFC1DF40C07861A00B0BB3C /* upnp.c */, BEFC1DF50C07861A00B0BB3C /* transmission.h */, - BEFC1DF60C07861A00B0BB3C /* transmission.c */, + BEFC1DF60C07861A00B0BB3C /* session.c */, + BEFC1E140C07861A00B0BB3C /* session.h */, A20152790D1C26EB0081714F /* torrent-ctor.c */, BEFC1DF70C07861A00B0BB3C /* tracker.h */, BEFC1DF80C07861A00B0BB3C /* tracker.c */, BEFC1DF90C07861A00B0BB3C /* torrent.c */, - BEFC1DFC0C07861A00B0BB3C /* shared.h */, - BEFC1DFD0C07861A00B0BB3C /* shared.c */, + BEFC1DFC0C07861A00B0BB3C /* port-forwarding.h */, + BEFC1DFD0C07861A00B0BB3C /* port-forwarding.c */, BEFC1E000C07861A00B0BB3C /* ratecontrol.h */, BEFC1E010C07861A00B0BB3C /* ratecontrol.c */, BEFC1E020C07861A00B0BB3C /* platform.h */, @@ -1095,7 +1096,6 @@ BEFC1E110C07861A00B0BB3C /* metainfo.c */, BEFC1E120C07861A00B0BB3C /* ipcparse.h */, BEFC1E130C07861A00B0BB3C /* ipcparse.c */, - BEFC1E140C07861A00B0BB3C /* internal.h */, BEFC1E150C07861A00B0BB3C /* inout.h */, BEFC1E160C07861A00B0BB3C /* inout.c */, BEFC1E190C07861A00B0BB3C /* fdlimit.h */, @@ -1338,14 +1338,14 @@ BEFC1E2C0C07861A00B0BB3C /* upnp.h in Headers */, BEFC1E2E0C07861A00B0BB3C /* transmission.h in Headers */, BEFC1E300C07861A00B0BB3C /* tracker.h in Headers */, - BEFC1E350C07861A00B0BB3C /* shared.h in Headers */, + BEFC1E350C07861A00B0BB3C /* port-forwarding.h in Headers */, BEFC1E390C07861A00B0BB3C /* ratecontrol.h in Headers */, BEFC1E3B0C07861A00B0BB3C /* platform.h in Headers */, BEFC1E450C07861A00B0BB3C /* net.h in Headers */, BEFC1E470C07861A00B0BB3C /* natpmp.h in Headers */, BEFC1E490C07861A00B0BB3C /* metainfo.h in Headers */, BEFC1E4B0C07861A00B0BB3C /* ipcparse.h in Headers */, - BEFC1E4D0C07861A00B0BB3C /* internal.h in Headers */, + BEFC1E4D0C07861A00B0BB3C /* session.h in Headers */, BEFC1E4E0C07861A00B0BB3C /* inout.h in Headers */, BEFC1E520C07861A00B0BB3C /* fdlimit.h in Headers */, BEFC1E540C07861A00B0BB3C /* fastresume.h in Headers */, @@ -1754,10 +1754,10 @@ files = ( BEFC1E2B0C07861A00B0BB3C /* utils.c in Sources */, BEFC1E2D0C07861A00B0BB3C /* upnp.c in Sources */, - BEFC1E2F0C07861A00B0BB3C /* transmission.c in Sources */, + BEFC1E2F0C07861A00B0BB3C /* session.c in Sources */, BEFC1E310C07861A00B0BB3C /* tracker.c in Sources */, BEFC1E320C07861A00B0BB3C /* torrent.c in Sources */, - BEFC1E360C07861A00B0BB3C /* shared.c in Sources */, + BEFC1E360C07861A00B0BB3C /* port-forwarding.c in Sources */, BEFC1E3A0C07861A00B0BB3C /* ratecontrol.c in Sources */, BEFC1E3C0C07861A00B0BB3C /* platform.c in Sources */, BEFC1E460C07861A00B0BB3C /* net.c in Sources */, diff --git a/macosx/Controller.m b/macosx/Controller.m index 7ba3e46f2..605216626 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -3977,17 +3977,16 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi if (!idlist) return fTorrents; - NSMutableArray * torrents = [NSMutableArray array]; + NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [idlist count]]; - NSEnumerator * torrentEnum = [fTorrents objectEnumerator], * idEnum; - int torId; + NSEnumerator * torrentEnum = [fTorrents objectEnumerator]; Torrent * torrent; - NSNumber * tempId; while ((torrent = [torrentEnum nextObject])) { - torId = [torrent torrentID]; + int torId = [torrent torrentID]; - idEnum = [idlist objectEnumerator]; + NSEnumerator * idEnum = [idlist objectEnumerator]; + NSNumber * tempId; while ((tempId = [idEnum nextObject])) { if ([tempId intValue] == torId) @@ -4006,16 +4005,15 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi if (!hashlist) return fTorrents; - NSMutableArray * torrents = [NSMutableArray array]; + NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [hashlist count]]; - NSEnumerator * torrentEnum = [fTorrents objectEnumerator], * hashEnum; - NSString * torHash, * tempHash; + NSEnumerator * torrentEnum = [fTorrents objectEnumerator]; Torrent * torrent; while ((torrent = [torrentEnum nextObject])) { - torHash = [torrent hashString]; + NSString * torHash = [torrent hashString], * tempHash; - hashEnum = [hashlist objectEnumerator]; + NSEnumerator * hashEnum = [hashlist objectEnumerator]; while ((tempHash = [hashEnum nextObject])) { if ([torHash caseInsensitiveCompare: tempHash] == NSOrderedSame) diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index 05bf421b7..c80358cee 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -678,10 +678,10 @@ && [fDefaults boolForKey: @"DisplayProgressBarAvailable"]) { int notAvailableWidth = MIN(ceil(barRect.size.width * [torrent notAvailableDesired]), rightWidth); - rightWidth -= notAvailableWidth; - if (notAvailableWidth > 0) { + rightWidth -= notAvailableWidth; + NSRect notAvailableRect = barRect; notAvailableRect.origin.x += leftWidth + rightWidth; notAvailableRect.size.width = notAvailableWidth;