• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

An Objective-C wrapper for Mac OS X’s FSEvents C API.


コミットメタ情報

リビジョン69a2adcaaffc073e4c8d9d51583dc042e3146351 (tree)
日時2011-08-18 03:35:37
作者Aron Cedercrantz <aron@cede...>
コミッターAron Cedercrantz

ログメッセージ

Updated project for ARC.

変更サマリ

差分

--- a/CDEvent.h
+++ b/CDEvent.h
@@ -71,8 +71,8 @@ typedef FSEventStreamEventFlags CDEventFlags;
7171 @interface CDEvent : NSObject <NSCoding, NSCopying> {
7272 @private
7373 CDEventIdentifier _identifier;
74- NSDate *_date;
75- NSURL *_URL;
74+ NSDate *__weak _date;
75+ NSURL *__weak _URL;
7676 CDEventFlags _flags;
7777 }
7878
@@ -96,7 +96,7 @@ typedef FSEventStreamEventFlags CDEventFlags;
9696 *
9797 * @since 1.0.0
9898 */
99-@property (readonly) NSDate *date;
99+@property (weak, readonly) NSDate *date;
100100
101101 /**
102102 * The URL of the item which changed.
@@ -105,7 +105,7 @@ typedef FSEventStreamEventFlags CDEventFlags;
105105 *
106106 * @since 1.0.0
107107 */
108-@property (readonly) NSURL *URL;
108+@property (weak, readonly) NSURL *URL;
109109
110110
111111 /** @name Getting Event Flags */
--- a/CDEvent.m
+++ b/CDEvent.m
@@ -44,22 +44,14 @@
4444 URL:(NSURL *)URL
4545 flags:(CDEventFlags)flags
4646 {
47- return [[[CDEvent alloc] initWithIdentifier:identifier
47+ return [[CDEvent alloc] initWithIdentifier:identifier
4848 date:date
4949 URL:URL
50- flags:flags]
51- autorelease];
50+ flags:flags];
5251 }
5352
5453
5554 #pragma mark Init/dealloc methods
56-- (void)dealloc
57-{
58- [_date release];
59- [_URL release];
60-
61- [super dealloc];
62-}
6355
6456 - (id)initWithIdentifier:(NSUInteger)identifier
6557 date:(NSDate *)date
@@ -69,8 +61,8 @@
6961 if ((self = [super init])) {
7062 _identifier = identifier;
7163 _flags = flags;
72- _date = [date retain];
73- _URL = [URL retain];
64+ _date = date;
65+ _URL = URL;
7466 }
7567
7668 return self;
@@ -101,7 +93,7 @@
10193 - (id)copyWithZone:(NSZone *)zone
10294 {
10395 // We can do this since we are immutable.
104- return [self retain];
96+ return self;
10597 }
10698
10799
--- a/CDEvents.h
+++ b/CDEvents.h
@@ -107,20 +107,20 @@ extern const CDEventIdentifier kCDEventsSinceEventNow;
107107 */
108108 @interface CDEvents : NSObject <NSCopying> {
109109 @private
110- __weak id<CDEventsDelegate> _delegate;
110+ //__weak id<CDEventsDelegate> _delegate;
111111
112112 FSEventStreamRef _eventStream;
113- CFTimeInterval _notificationLatency;
113+ //CFTimeInterval _notificationLatency;
114114
115- CDEventIdentifier _sinceEventIdentifier;
115+ //CDEventIdentifier _sinceEventIdentifier;
116116 NSUInteger _eventStreamCreationFlags;
117117
118- BOOL _ignoreEventsFromSubDirectories;
118+ //BOOL _ignoreEventsFromSubDirectories;
119119
120- CDEvent *_lastEvent;
120+ //CDEvent *_lastEvent;
121121
122- NSArray *_watchedURLs;
123- NSArray *_excludedURLs;
122+ //NSArray *_watchedURLs;
123+ //NSArray *_excludedURLs;
124124 }
125125
126126 #pragma mark Properties
@@ -135,7 +135,7 @@ extern const CDEventIdentifier kCDEventsSinceEventNow;
135135 *
136136 * @since 1.0.0
137137 */
138-@property (assign) __weak id<CDEventsDelegate> delegate;
138+@property (weak) id<CDEventsDelegate> delegate;
139139
140140 /** @name Getting Event Watcher Properties */
141141 /**
@@ -163,7 +163,7 @@ extern const CDEventIdentifier kCDEventsSinceEventNow;
163163 *
164164 * @since 1.0.0
165165 */
166-@property (retain, readonly) CDEvent *lastEvent;
166+@property (strong, readonly) CDEvent *lastEvent;
167167
168168 /**
169169 * The URLs that we watch for events.
@@ -172,7 +172,7 @@ extern const CDEventIdentifier kCDEventsSinceEventNow;
172172 *
173173 * @since 1.0.0
174174 */
175-@property (readonly) NSArray *watchedURLs;
175+@property (strong, readonly) NSArray *watchedURLs;
176176
177177
178178 /** @name Configuring the Event watcher */
--- a/CDEvents.m
+++ b/CDEvents.m
@@ -27,7 +27,8 @@ const CDEventIdentifier kCDEventsSinceEventNow = kFSEventStreamEventIdSinceNow;
2727 // Private API
2828 @interface CDEvents ()
2929
30-@property (retain, readwrite) CDEvent *lastEvent;
30+@property (strong, readwrite) CDEvent *lastEvent;
31+@property (strong, readwrite) NSArray *watchedURLs;
3132
3233 // The FSEvents callback function
3334 static void CDEventsCallback(
@@ -74,11 +75,7 @@ static void CDEventsCallback(
7475
7576 _delegate = nil;
7677
77- [_lastEvent release];
78- [_watchedURLs release];
79- [_excludedURLs release];
8078
81- [super dealloc];
8279 }
8380
8481 - (void)finalize
@@ -193,10 +190,10 @@ ignoreEventsFromSubDirs:(BOOL)ignoreEventsFromSubDirs
193190 - (NSString *)streamDescription
194191 {
195192 CFStringRef streamDescriptionCF = FSEventStreamCopyDescription(_eventStream);
196- NSString *returnString = [[NSString alloc] initWithString:(NSString *)streamDescriptionCF];
193+ NSString *returnString = [[NSString alloc] initWithString:(__bridge NSString *)streamDescriptionCF];
197194 CFRelease(streamDescriptionCF);
198195
199- return [returnString autorelease];
196+ return returnString;
200197 }
201198
202199
@@ -205,7 +202,7 @@ ignoreEventsFromSubDirs:(BOOL)ignoreEventsFromSubDirs
205202 {
206203 FSEventStreamContext callbackCtx;
207204 callbackCtx.version = 0;
208- callbackCtx.info = (void *)self;
205+ callbackCtx.info = (__bridge void *)self;
209206 callbackCtx.retain = NULL;
210207 callbackCtx.release = NULL;
211208 callbackCtx.copyDescription = NULL;
@@ -218,7 +215,7 @@ ignoreEventsFromSubDirs:(BOOL)ignoreEventsFromSubDirs
218215 _eventStream = FSEventStreamCreate(kCFAllocatorDefault,
219216 &CDEventsCallback,
220217 &callbackCtx,
221- (CFArrayRef)watchedPaths,
218+ (__bridge CFArrayRef)watchedPaths,
222219 (FSEventStreamEventId)[self sinceEventIdentifier],
223220 [self notificationLatency],
224221 _eventStreamCreationFlags);
@@ -244,11 +241,11 @@ static void CDEventsCallback(
244241 const FSEventStreamEventFlags eventFlags[],
245242 const FSEventStreamEventId eventIds[])
246243 {
247- CDEvents *watcher = (CDEvents *)callbackCtxInfo;
244+ CDEvents *watcher = (__bridge CDEvents *)callbackCtxInfo;
248245
249246 NSArray *watchedURLs = [watcher watchedURLs];
250247 NSArray *excludedURLs = [watcher excludedURLs];
251- NSArray *eventPathsArray = (NSArray *)eventPaths;
248+ NSArray *eventPathsArray = (__bridge NSArray *)eventPaths;
252249 BOOL shouldIgnore = NO;
253250
254251 for (NSUInteger i = 0; i < numEvents; ++i) {
@@ -293,7 +290,6 @@ static void CDEventsCallback(
293290 [watcher setLastEvent:event];
294291 }
295292
296- [event release];
297293 }
298294 }
299295
--- a/CDEvents.xcodeproj/project.pbxproj
+++ b/CDEvents.xcodeproj/project.pbxproj
@@ -321,13 +321,14 @@
321321 isa = XCBuildConfiguration;
322322 buildSettings = {
323323 ALWAYS_SEARCH_USER_PATHS = NO;
324+ CLANG_ENABLE_OBJC_ARC = YES;
324325 COPY_PHASE_STRIP = NO;
325326 DYLIB_COMPATIBILITY_VERSION = 1;
326327 DYLIB_CURRENT_VERSION = 1;
327328 FRAMEWORK_VERSION = A;
328329 GCC_DYNAMIC_NO_PIC = NO;
329330 GCC_ENABLE_FIX_AND_CONTINUE = YES;
330- GCC_ENABLE_OBJC_GC = supported;
331+ GCC_ENABLE_OBJC_GC = unsupported;
331332 GCC_MODEL_TUNING = G5;
332333 GCC_OPTIMIZATION_LEVEL = 0;
333334 GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -344,11 +345,12 @@
344345 isa = XCBuildConfiguration;
345346 buildSettings = {
346347 ALWAYS_SEARCH_USER_PATHS = NO;
348+ CLANG_ENABLE_OBJC_ARC = YES;
347349 DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
348350 DYLIB_COMPATIBILITY_VERSION = 1;
349351 DYLIB_CURRENT_VERSION = 1;
350352 FRAMEWORK_VERSION = A;
351- GCC_ENABLE_OBJC_GC = supported;
353+ GCC_ENABLE_OBJC_GC = unsupported;
352354 GCC_MODEL_TUNING = G5;
353355 GCC_PRECOMPILE_PREFIX_HEADER = YES;
354356 GCC_PREFIX_HEADER = CDEvents_Prefix.pch;
@@ -363,16 +365,13 @@
363365 1DEB91B208733DA50010E9CD /* Debug */ = {
364366 isa = XCBuildConfiguration;
365367 buildSettings = {
366- ARCHS = (
367- x86_64,
368- i386,
369- );
368+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
370369 GCC_C_LANGUAGE_STANDARD = gnu99;
371370 GCC_OPTIMIZATION_LEVEL = 0;
372371 GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
373372 GCC_WARN_ABOUT_RETURN_TYPE = YES;
374373 GCC_WARN_UNUSED_VARIABLE = YES;
375- MACOSX_DEPLOYMENT_TARGET = 10.5;
374+ MACOSX_DEPLOYMENT_TARGET = 10.7;
376375 ONLY_ACTIVE_ARCH = YES;
377376 PREBINDING = NO;
378377 RUN_CLANG_STATIC_ANALYZER = YES;
@@ -383,15 +382,12 @@
383382 1DEB91B308733DA50010E9CD /* Release */ = {
384383 isa = XCBuildConfiguration;
385384 buildSettings = {
386- ARCHS = (
387- x86_64,
388- i386,
389- );
385+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
390386 GCC_C_LANGUAGE_STANDARD = gnu99;
391387 GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
392388 GCC_WARN_ABOUT_RETURN_TYPE = YES;
393389 GCC_WARN_UNUSED_VARIABLE = YES;
394- MACOSX_DEPLOYMENT_TARGET = 10.5;
390+ MACOSX_DEPLOYMENT_TARGET = 10.7;
395391 PREBINDING = NO;
396392 RUN_CLANG_STATIC_ANALYZER = YES;
397393 SDKROOT = macosx;