Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed all clang warnings

  • Loading branch information...
commit 81b330d56d413bc432d98ad42274c8833b032203 1 parent 1e8d091
David Keegan authored April 05, 2012
9  Source/ETAppleEventObject.m
@@ -158,8 +158,9 @@ + (AliasHandle)newAliasHandleWithPath:(NSString *)path
158 158
 
159 159
 - (NSString *) stringForOSType: (DescType) descType;
160 160
 {
161  
-    NSString * descString = (NSString *) UTCreateStringForOSType(descType);
162  
-    [descString autorelease];
  161
+    CFStringRef descRef = UTCreateStringForOSType(descType);
  162
+    NSString * descString = [NSString stringWithString:(NSString *)descRef];
  163
+    CFRelease(descRef);
163 164
     return descString;
164 165
 }
165 166
 
@@ -1158,7 +1159,7 @@ - (NSArray *)getPropertyAsStringWithDumpForDesc:(DescType)descType
1158 1159
 	DescType	resultType;
1159 1160
 	Size		resultSize;
1160 1161
 	NSString	*replyString = nil;
1161  
-	
  1162
+	NSArray     *valueAndDump = nil;
1162 1163
 	AppleEvent *replyEvent = [self getPropertyOfType:descType];
1163 1164
 	if (!replyEvent) {
1164 1165
 		// TODO: raise exception?
@@ -1197,7 +1198,7 @@ - (NSArray *)getPropertyAsStringWithDumpForDesc:(DescType)descType
1197 1198
 											length:resultSize 
1198 1199
 										  encoding:NSUnicodeStringEncoding] autorelease];
1199 1200
 	
1200  
-	NSArray *valueAndDump = [NSArray arrayWithObjects:replyString,
  1201
+    valueAndDump = [NSArray arrayWithObjects:replyString,
1201 1202
 		[ETAppleEventObject debugHexDump:replyValue ofLength:resultSize], nil];
1202 1203
 	
1203 1204
 	
2  Source/ETEyeTunes.m
@@ -791,7 +791,7 @@ - (ETPlaylist*)addPlaylistWithName:(NSString*)name
791 791
 	OSErr err;
792 792
 	AppleEvent getEvent, replyEvent;
793 793
 	AEDescList replyObject;
794  
-	ETPlaylist* playlist;
  794
+	ETPlaylist* playlist = nil;
795 795
 	NSString *gizmo = [NSString stringWithFormat:@"kocl:type('cPly'), prdt: {pnam:'utxt'(\"%@\")}", name];	
796 796
 	
797 797
 	AEBuildError buildError;		
2  Source/ETPlaylist.m
@@ -111,7 +111,7 @@ - (ETPlaylist*) parentPlaylist
111 111
 	}
112 112
 	
113 113
 	Handle stringHandle;
114  
-	OSErr err = AEPrintDescToHandle(replyEvent, &stringHandle);
  114
+	OSErr __unused err = AEPrintDescToHandle(replyEvent, &stringHandle);
115 115
 	if (doLog) NSLog(@"-[ETPlaylist parentplaylist] %@ -- replyEvent: %s (AEPrintDescToHandle result %d)", [self name], *stringHandle, err);
116 116
 	
117 117
 	/* Read Results */
6  Source/ETPlaylistCache.m
@@ -132,14 +132,13 @@ - (void) reload;
132 132
 	while ((playlist = [en2 nextObject])) 
133 133
 	{
134 134
 		unsigned long long playlistPersistentID = [playlist persistentId];
135  
-		NSString * playlistName = [playlist name];
136 135
 		if (playlistPersistentID == 0) // root
137 136
 			continue;
138 137
 		
139 138
 		long long parentPersistentId = [playlist parentPlaylistId];
140 139
 		
141 140
 		ETPlaylist * parentPlaylist = [self playlistForPersistentId:parentPersistentId];
142  
-		if (NO) NSLog (@"playlist: %@ (%@) [%qi] -- parent: %@", playlistName, [playlist stringForOSType:[playlist specialKind]], [playlist persistentId], [parentPlaylist name]);
  141
+		if (NO) NSLog (@"playlist: %@ (%@) [%qi] -- parent: %@", [playlist name], [playlist stringForOSType:[playlist specialKind]], [playlist persistentId], [parentPlaylist name]);
143 142
 		[parentPlaylist addChildPlaylistId:[playlist persistentIdNumber]];
144 143
 	}	
145 144
 	
@@ -181,14 +180,13 @@ - (void) reload;
181 180
 	while ((playlist = [en2 nextObject])) 
182 181
 	{
183 182
 		unsigned long long playlistPersistentID = [playlist persistentId];
184  
-		NSString * playlistName = [playlist name];
185 183
 		if (playlistPersistentID == 0) // root
186 184
 			continue;
187 185
 		
188 186
 		long long parentPersistentId = [playlist parentPlaylistId];
189 187
 		
190 188
 		ETPlaylist * parentPlaylist = [self userPlaylistForPersistentId:parentPersistentId];
191  
-		if (NO) NSLog (@"playlist: %@ (%@) [%qi] -- parent: %@", playlistName, [playlist stringForOSType:[playlist specialKind]], [playlist persistentId], [parentPlaylist name]);
  189
+		if (NO) NSLog (@"playlist: %@ (%@) [%qi] -- parent: %@", [playlist name], [playlist stringForOSType:[playlist specialKind]], [playlist persistentId], [parentPlaylist name]);
192 190
 		[parentPlaylist addChildPlaylistId:[playlist persistentIdNumber]];
193 191
 	}	
194 192
 }

0 notes on commit 81b330d

Please sign in to comment.
Something went wrong with that request. Please try again.