[vlc-devel] [PATCH] VLCKit: nitpicking semantics
Florent Pillet
fpillet at gmail.com
Sun Jul 13 12:00:11 CEST 2014
Use nil for objects, not NULL
---
Sources/VLCMedia.m | 6 +++---
Sources/VLCMediaList.m | 2 +-
Sources/VLCServicesDiscoverer.m | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Sources/VLCMedia.m b/Sources/VLCMedia.m
index 2b52720..b76691c 100644
--- a/Sources/VLCMedia.m
+++ b/Sources/VLCMedia.m
@@ -311,7 +311,7 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
- (NSDictionary*) stats
{
if (!p_md)
- return NULL;
+ return nil;
libvlc_media_stats_t p_stats;
libvlc_media_get_stats(p_md, &p_stats);
@@ -645,7 +645,7 @@ NSString *const VLCMediaTracksInformationTextEncoding = @"encoding"; // NSString
- (NSString *)metadataForKey:(NSString *)key
{
if (!p_md)
- return NULL;
+ return nil;
if (![self isParsed])
[self synchronousParse];
@@ -653,7 +653,7 @@ NSString *const VLCMediaTracksInformationTextEncoding = @"encoding"; // NSString
char *returnValue = libvlc_media_get_meta(p_md, [VLCMedia stringToMetaType:key]);
if (!returnValue)
- return NULL;
+ return nil;
NSString *actualReturnValue = @(returnValue);
free(returnValue);
diff --git a/Sources/VLCMediaList.m b/Sources/VLCMediaList.m
index 8af4eba..92592b1 100644
--- a/Sources/VLCMediaList.m
+++ b/Sources/VLCMediaList.m
@@ -167,7 +167,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
{
if (index < [cachedMedia count])
return cachedMedia[index];
- return NULL;
+ return nil;
}
- (NSInteger)indexOfMedia:(VLCMedia *)media
diff --git a/Sources/VLCServicesDiscoverer.m b/Sources/VLCServicesDiscoverer.m
index cde12d0..0544651 100644
--- a/Sources/VLCServicesDiscoverer.m
+++ b/Sources/VLCServicesDiscoverer.m
@@ -29,7 +29,7 @@
#include <vlc/libvlc.h>
-static VLCServicesDiscoverer * sharedDiscoverer = NULL;
+static VLCServicesDiscoverer * sharedDiscoverer = nil;
@implementation VLCServicesDiscoverer
+ (id)sharedDiscoverer
--
1.8.5.2 (Apple Git-48)
More information about the vlc-devel
mailing list