Revision: 28631
          http://sourceforge.net/p/bibdesk/svn/28631
Author:   hofman
Date:     2024-01-19 16:45:49 +0000 (Fri, 19 Jan 2024)
Log Message:
-----------
Add bridging calls. Declare __unsafe_unretained qualifiers. Release on main 
thread using dispatch. Workaround for forced autorelease.

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAliasBadge.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageCache.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageDescription.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.mm
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVConcreteOperationQueue.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIconOperation.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon_Private.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMainThreadOperationQueue.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMovieIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPDFIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPlaceholderImage.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.mm
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVQuickLookIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVScaledImageView.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVThread.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.h
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVMappedDataProvider.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVPreviewerWindow.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVSplitSet.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAliasBadge.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAliasBadge.m    2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAliasBadge.m    2024-01-19 
16:45:49 UTC (rev 28631)
@@ -78,7 +78,7 @@
         
         [NSGraphicsContext restoreGraphicsState];
         
-        [_badges addObject:(id)layer];
+        [_badges addObject:(__bridge id)layer];
         CGLayerRelease(layer);
     }
 }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageCache.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageCache.m  2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageCache.m  2024-01-19 
16:45:49 UTC (rev 28631)
@@ -108,9 +108,8 @@
 
 - (void)cacheImage:(CGImageRef)image forKey:(id)aKey;
 {
-    NSData *data = (NSData *)FVCreateDataWithCGImage(image);
+    NSData *data = (NSData *)CFBridgingRelease(FVCreateDataWithCGImage(image));
     [_cacheFile saveData:data forKey:aKey];
-    [data release];
 }
 
 - (void)invalidateCachedImageForKey:(id)aKey
@@ -210,13 +209,14 @@
     size_t approximateLength = CGImageGetBytesPerRow(image) * 
CGImageGetHeight(image) + 20 * sizeof(size_t);
     NSMutableData *mdata = [[NSMutableData allocWithZone:FVDefaultZone()] 
initWithCapacity:approximateLength];
     
-    NSKeyedArchiver *archiver = [[NSKeyedArchiver 
allocWithZone:FVDefaultZone()] initForWritingWithMutableData:(NSMutableData 
*)mdata];
+    NSKeyedArchiver *archiver = [[NSKeyedArchiver 
allocWithZone:FVDefaultZone()] initForWritingWithMutableData:mdata];
     [archiver encodeObject:imageDescription];
     [archiver finishEncoding];
     [imageDescription release];
     [archiver release];
     
-    data = (CFDataRef)mdata;
+    data = (CFDataRef)CFBridgingRetain(mdata);
+    [mdata release];
 #endif    
     return data;
 }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageDescription.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageDescription.m    
2024-01-18 15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageDescription.m    
2024-01-19 16:45:49 UTC (rev 28631)
@@ -125,7 +125,7 @@
         [aCoder encodeInteger:_shouldInterpolate forKey:@"_shouldInterpolate"];
         [aCoder encodeInteger:_renderingIntent forKey:@"_renderingIntent"];
         [aCoder encodeObject:_colorSpaceDescription 
forKey:@"_colorSpaceDescription"];
-        [aCoder encodeObject:(NSData *)_bitmapData forKey:@"_bitmapData"];
+        [aCoder encodeObject:(__bridge NSData *)_bitmapData 
forKey:@"_bitmapData"];
         [aCoder encodeBytes:(const uint8_t *)_decode length:[self 
_decodeLength]  forKey:@"_decode"];
     }
     else {

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm     
2024-01-18 15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm     
2024-01-19 16:45:49 UTC (rev 28631)
@@ -834,8 +834,8 @@
     std::vector <FVRegion> regions = __FVTileRegionsForImage(image, scale);
     
     // fixed size mutable arrays
-    NSMutableArray *planarTilesA = (NSMutableArray 
*)CFArrayCreateMutable(NULL, 4, &kCFTypeArrayCallBacks);
-    NSMutableArray *planarTilesB = (NSMutableArray 
*)CFArrayCreateMutable(NULL, 4, &kCFTypeArrayCallBacks);
+    NS_VALID_UNTIL_END_OF_SCOPE NSMutableArray *planarTilesA = 
[[NSMutableArray alloc] initWithCapacity:4];
+    NS_VALID_UNTIL_END_OF_SCOPE NSMutableArray *planarTilesB = 
[[NSMutableArray alloc] initWithCapacity:4];
     
     // first region is not necessarily the largest region anymore; figure out 
the maximum height and width for tiles
     size_t maxWidth = 0, maxHeight = 0;

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.mm
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.mm    2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCacheFile.mm    2024-01-19 
16:45:49 UTC (rev 28631)
@@ -255,7 +255,7 @@
     if ([key isKindOfClass:[_FVCacheKey class]] == NO)
         return;
 
-    CFURLRef theURL = (CFURLRef)key->_URL;
+    CFURLRef theURL = (__bridge CFURLRef)key->_URL;
     CFStringRef scheme = CFURLCopyScheme(theURL);
     CFStringRef identifier = NULL;
     if (scheme && CFStringCompare(scheme, (CFStringRef)NSURLFileScheme, 0) == 
kCFCompareEqualTo) {
@@ -269,7 +269,7 @@
     if (NULL == identifier)
         identifier = CFStringCreateWithCString(NULL, "anonymous", 
kCFStringEncodingASCII);
     
-    _FVCacheEventRecord *rec = [_eventTable objectForKey:(id)identifier];
+    _FVCacheEventRecord *rec = [_eventTable objectForKey:(__bridge 
id)identifier];
     if (nil != rec) {
         rec->_kbytes += kbytes;
         rec->_count += 1;
@@ -279,7 +279,7 @@
         rec->_kbytes = kbytes;
         rec->_count = 1;
         rec->_identifier = (CFStringRef)CFRetain(identifier);
-        [_eventTable setObject:rec forKey:(id)identifier];
+        [_eventTable setObject:rec forKey:(__bridge id)identifier];
         [rec release];
     }
     
@@ -466,7 +466,7 @@
 {
     [_writeLock lock];
     // give copyDataForKey: a chance to get/retain
-    [[[_offsetTable objectForKey:aKey] retain] autorelease];
+    FVRetainAutorelease([_offsetTable objectForKey:aKey]);
     [_offsetTable removeObjectForKey:aKey];
     [_writeLock unlock];
 }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVConcreteOperationQueue.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVConcreteOperationQueue.m        
2024-01-18 15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVConcreteOperationQueue.m        
2024-01-19 16:45:49 UTC (rev 28631)
@@ -284,12 +284,12 @@
 
 static mach_port_t __FVGetQueuePort(void *info)
 {
-    return ((FVConcreteOperationQueue *)info)->_threadPort;
+    return ((__bridge FVConcreteOperationQueue *)info)->_threadPort;
 }
 
 static void * __FVQueueMachPerform(void *msg, CFIndex size, CFAllocatorRef 
allocator, void *info)
 {
-    [(FVConcreteOperationQueue *)info _startQueuedOperations];
+    [(__bridge FVConcreteOperationQueue *)info _startQueuedOperations];
     return NULL;
 }
 

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2024-01-19 
16:45:49 UTC (rev 28631)
@@ -882,10 +882,10 @@
 
 - (void)_getDisplayName:(NSString **)name andLabel:(NSUInteger *)label 
forURL:(NSURL *)aURL;
 {
-    _FVURLInfo *info = [(id)_infoTable objectForKey:aURL];
+    _FVURLInfo *info = [(__bridge id)_infoTable objectForKey:aURL];
     if (nil == info) {
         info = [[_FVURLInfo allocWithZone:[self zone]] initWithURL:aURL];
-        CFDictionarySetValue(_infoTable, (CFURLRef)aURL, info);
+        CFDictionarySetValue(_infoTable, (__bridge CFURLRef)aURL, (__bridge 
void *)info);
         [info release];
     }
     if (name) *name = [info name];
@@ -1917,8 +1917,8 @@
 
 - (void)_handleFinderLabelChanged:(NSNotification *)note {
     NSURL *url = [note object];
-    if (CFDictionaryContainsKey(_infoTable, url)) {
-        CFDictionaryRemoveValue(_infoTable, url);
+    if (CFDictionaryContainsKey(_infoTable, (__bridge void *)url)) {
+        CFDictionaryRemoveValue(_infoTable, (__bridge void *)url);
         [self setNeedsDisplay:YES];
     }
 }
@@ -2195,7 +2195,7 @@
     while (kCFStringTokenizerTokenNone != 
CFStringTokenizerAdvanceToNextToken(tokenizer)) {
         CFStringRef word = 
CFStringTokenizerCopyCurrentTokenAttribute(tokenizer, 
kCFStringTokenizerAttributeLatinTranscription);
         if (word) {
-            [words addObject:(id)word];
+            [words addObject:(__bridge id)word];
             CFRelease(word);
         }
     }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m    2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m    2024-01-19 
16:45:49 UTC (rev 28631)
@@ -175,7 +175,7 @@
     if (NO == drawsLinkBadge) {
         // see if this is a plain folder; we don't want to show 
FVGenericFolderIcon for a package/app/custom icon
         CFTypeRef aUTI = NULL;
-        if (CFURLCopyResourcePropertyForKey((CFURLRef)aURL, 
kCFURLTypeIdentifierKey, &aUTI, NULL) && aUTI) {
+        if (CFURLCopyResourcePropertyForKey((__bridge CFURLRef)aURL, 
kCFURLTypeIdentifierKey, &aUTI, NULL) && aUTI) {
             if (UTTypeEqual(aUTI, kUTTypeFolder)) {
                 if ([aURL getResourceValue:&icon forKey:NSURLCustomIconKey 
error:NULL])
                     isPlainFolder = (icon == nil);

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m  2024-01-18 15:52:26 UTC 
(rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m  2024-01-19 16:45:49 UTC 
(rev 28631)
@@ -172,7 +172,7 @@
     BOOL isLink = NO;
     CFTypeRef theUTI = NULL;
     
-    if (CFURLCopyResourcePropertyForKey((CFURLRef)representedURL, 
kCFURLTypeIdentifierKey, &theUTI, NULL)) {
+    if (CFURLCopyResourcePropertyForKey((__bridge CFURLRef)representedURL, 
kCFURLTypeIdentifierKey, &theUTI, NULL)) {
         isLink = UTTypeConformsTo(theUTI, kUTTypeResolvable);
         /*
          For a link/alias, get the target's UTI in order to determine which 
concrete subclass to create.
@@ -182,19 +182,17 @@
         if (isLink) {
             if (UTTypeConformsTo(theUTI, kUTTypeSymLink)) {
                 resolvedURL = [representedURL URLByResolvingSymlinksInPath];
-                if (resolvedURL && [resolvedURL isEqual:representedURL] == NO)
-                    [resolvedURL retain];
-                else
+                if ([resolvedURL isEqual:representedURL])
                     resolvedURL = nil;
             } else if (UTTypeConformsTo(theUTI, kUTTypeAliasFile)) {
-                CFDataRef bookmark = CFURLCreateBookmarkDataFromFile(NULL, 
(CFURLRef)representedURL, NULL);
+                CFDataRef bookmark = CFURLCreateBookmarkDataFromFile(NULL, 
(__bridge CFURLRef)representedURL, NULL);
                 if (bookmark) {
                     CFURLRef targetURL = 
CFURLCreateByResolvingBookmarkData(NULL, bookmark, 
kCFURLBookmarkResolutionWithoutUIMask, NULL, NULL, NULL, NULL);
                     if (CFURLIsFileReferenceURL(targetURL)) {
-                        resolvedURL = (NSURL *)CFURLCreateFilePathURL(NULL, 
targetURL, NULL);
+                        resolvedURL = (NSURL 
*)CFBridgingRelease(CFURLCreateFilePathURL(NULL, targetURL, NULL));
                         CFRelease(targetURL);
                     } else {
-                        resolvedURL = (NSURL *)targetURL;
+                        resolvedURL = (NSURL *)CFBridgingRelease(targetURL);
                     }
                 }
             }
@@ -202,7 +200,7 @@
             if (resolvedURL) {
                 CFRelease(theUTI);
                 theUTI = NULL;
-                CFURLCopyResourcePropertyForKey((CFURLRef)resolvedURL, 
kCFURLTypeIdentifierKey, &theUTI, NULL);
+                CFURLCopyResourcePropertyForKey((__bridge 
CFURLRef)resolvedURL, kCFURLTypeIdentifierKey, &theUTI, NULL);
             }
         }
     } else if ([representedURL checkResourceIsReachableAndReturnError:NULL] == 
NO) {
@@ -211,7 +209,7 @@
     }
     
     if (resolvedURL == nil)
-        resolvedURL = [representedURL retain];
+        resolvedURL = representedURL;
 
     // limit FVTextIcon to < 20 MB files; layout is really slow with large 
files
     const UInt64 maximumTextDataSize = 20 * 1024 * 1024;
@@ -225,13 +223,13 @@
     UInt64 dataPhysicalSize = 0;
     
     CFTypeRef number = NULL;
-    if (CFURLCopyResourcePropertyForKey((CFURLRef)resolvedURL, 
kCFURLFileSizeKey, &number, NULL) && number != NULL) {
+    if (CFURLCopyResourcePropertyForKey((__bridge CFURLRef)resolvedURL, 
kCFURLFileSizeKey, &number, NULL) && number != NULL) {
         CFNumberGetValue(number, kCFNumberSInt64Type, &dataPhysicalSize);
         CFRelease(number);
     }
 
     FVIcon *anIcon = nil;
-    NSString *type = (NSString *)theUTI;
+    NSString *type = (__bridge NSString *)theUTI;
     
     /*
      Problems here.  TextMate claims a lot of plain text types but doesn't 
declare a UTI for any of them, 
@@ -276,8 +274,7 @@
     if (nil == anIcon)
         anIcon = [FVFinderIcon newWithURL:resolvedURL drawsLinkBadge:isLink];
     
-    [(id)theUTI release];
-    [resolvedURL release];
+    if (theUTI) CFRelease(theUTI);
     
     return (id)anIcon;
 }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIconOperation.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIconOperation.m 2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIconOperation.m 2024-01-19 
16:45:49 UTC (rev 28631)
@@ -70,7 +70,12 @@
 {
     [_icon release];
     // release is thread safe, but we don't want to trigger dealloc on this 
thread
-    [_view performSelectorOnMainThread:@selector(release) withObject:nil 
waitUntilDone:NO];
+    NS_VALID_UNTIL_END_OF_SCOPE __block id view = [_view retain];
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [view release];
+        view = nil;
+    });
+    [_view release];
     [super dealloc];
 }
 

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon_Private.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon_Private.m  2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon_Private.m  2024-01-19 
16:45:49 UTC (rev 28631)
@@ -89,7 +89,7 @@
 
                 if (superClass == FVIconClass) {
                     _FVQueuedKeys *qkeys = [_FVQueuedKeys new];
-                    CFDictionaryAddValue(queuedKeysByClass, aClass, qkeys);
+                    CFDictionaryAddValue(queuedKeysByClass, (__bridge void 
*)aClass, (__bridge void *)qkeys);
                     [qkeys release];
                     break;
                 }
@@ -124,7 +124,7 @@
 
 + (void)_startRenderingForKey:(id)aKey;
 {
-    _FVQueuedKeys *qkeys = [(NSDictionary *)_queuedKeysByClass 
objectForKey:self];
+    _FVQueuedKeys *qkeys = [(__bridge NSDictionary *)_queuedKeysByClass 
objectForKey:self];
     NSParameterAssert(nil != qkeys);
     [qkeys startRenderingForKey:aKey];
 }
@@ -131,7 +131,7 @@
 
 + (void)_stopRenderingForKey:(id)aKey;
 {
-    _FVQueuedKeys *qkeys = [(NSDictionary *)_queuedKeysByClass 
objectForKey:self];
+    _FVQueuedKeys *qkeys = [(__bridge NSDictionary *)_queuedKeysByClass 
objectForKey:self];
     NSParameterAssert(nil != qkeys);
     [qkeys stopRenderingForKey:aKey];   
 }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageIcon.m     2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageIcon.m     2024-01-19 
16:45:49 UTC (rev 28631)
@@ -54,11 +54,11 @@
 {
     NSParameterAssert(type);
     
-    if (false == UTTypeConformsTo((CFStringRef)type, kUTTypeImage))
+    if (false == UTTypeConformsTo((__bridge CFStringRef)type, kUTTypeImage))
         return NO;
     
     // should never be called in this case, but ImageIO lies about support for 
PDF rdar://problem/5447874
-    if (UTTypeEqual((CFStringRef)type, kUTTypePDF)) return NO;
+    if (UTTypeEqual((__bridge CFStringRef)type, kUTTypePDF)) return NO;
     
     static NSArray *types = nil;
     if (types == nil) {

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMainThreadOperationQueue.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMainThreadOperationQueue.m      
2024-01-18 15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMainThreadOperationQueue.m      
2024-01-19 16:45:49 UTC (rev 28631)
@@ -150,7 +150,7 @@
 static void __FVProcessSingleEntry(CFRunLoopObserverRef observer, 
CFRunLoopActivity activity, void *info)
 {
     NSCAssert(pthread_main_np() != 0, @"incorrect thread for main queue");
-    FVMainThreadOperationQueue *queue = info;    
+    FVMainThreadOperationQueue *queue = (__bridge id)info;    
     FVOperation *op = nil;
 
     // ignore cancelled operations, so we get finishedOperation: (no 
coalescing on _activeOperations)

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMovieIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMovieIcon.m     2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMovieIcon.m     2024-01-19 
16:45:49 UTC (rev 28631)
@@ -61,7 +61,7 @@
 
 + (BOOL)canInitWithURL:(NSURL *)aURL withType:(NSString *)type
 {
-    if (false == UTTypeConformsTo((CFStringRef)type, kUTTypeMovie))
+    if (false == UTTypeConformsTo((__bridge CFStringRef)type, kUTTypeMovie))
         return NO;
     
     /*
@@ -69,7 +69,7 @@
      if you uncheck "Open local files immediately" in its pref pane.  Bypass 
it entirely if we have
      Quick Look.  No idea if this is a QT bug or Flip4Mac bug, so I suppose I 
should file something...
      */
-    if (UTTypeEqual((CFStringRef)type, 
FVSTR("com.microsoft.windows-media-wmv")))
+    if (UTTypeEqual((__bridge CFStringRef)type, 
FVSTR("com.microsoft.windows-media-wmv")))
         return NO;
     
 #if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < 
MAC_OS_X_VERSION_10_7

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPDFIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPDFIcon.m       2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPDFIcon.m       2024-01-19 
16:45:49 UTC (rev 28631)
@@ -115,7 +115,7 @@
 
 + (BOOL)canInitWithURL:(NSURL *)aURL withType:(NSString *)type
 {
-    return UTTypeConformsTo((CFStringRef)type, kUTTypePDF);
+    return UTTypeConformsTo((__bridge CFStringRef)type, kUTTypePDF);
 }
 
 - (id)initWithURL:(NSURL *)aURL drawsLinkBadge:(BOOL)drawsLinkBadge
@@ -192,7 +192,7 @@
     [FVCGImageCache invalidateCachesForKey:_cacheKey];
     pthread_mutex_lock(&_pageCountsLock);
     if (_documentPageCounts)
-        NSMapRemove(_documentPageCounts, _cacheKey);
+        NSMapRemove(_documentPageCounts, (__bridge void *)_cacheKey);
     pthread_mutex_unlock(&_pageCountsLock);
     [self lock];
     CGImageRelease(_thumbnail);
@@ -363,7 +363,7 @@
         if (NULL != _thumbnail) {
             _thumbnailSize = FVCGImageSize(_thumbnail);
             pthread_mutex_lock(&_pageCountsLock);
-            if (_documentPageCounts && NSMapMember(_documentPageCounts, 
_cacheKey, NULL, (void **)&_pageCount)) {
+            if (_documentPageCounts && NSMapMember(_documentPageCounts, 
(__bridge void *)_cacheKey, NULL, (void **)&_pageCount)) {
                 if (_pageCount == NSNotFound) {
                     _isLocked = YES;
                     _pageCount = 1;
@@ -399,7 +399,7 @@
                 pthread_mutex_lock(&_pageCountsLock);
                 if (nil == _documentPageCounts)
                     _documentPageCounts = 
NSCreateMapTable(NSObjectMapKeyCallBacks, NSIntegerMapValueCallBacks, 0);
-                NSMapInsert(_documentPageCounts, _cacheKey, (const void 
*)(_isLocked ? NSNotFound : _pageCount));
+                NSMapInsert(_documentPageCounts, (__bridge void *)_cacheKey, 
(const void *)(_isLocked ? NSNotFound : _pageCount));
                 pthread_mutex_unlock(&_pageCountsLock);
             }
         }
@@ -571,7 +571,7 @@
 
 + (BOOL)canInitWithURL:(NSURL *)aURL withType:(NSString *)type
 {
-    return UTTypeConformsTo((CFStringRef)type, 
FVSTR("net.sourceforge.skim-app.pdfd"));
+    return UTTypeConformsTo((__bridge CFStringRef)type, 
FVSTR("net.sourceforge.skim-app.pdfd"));
 }
 
 static NSURL * __FVCreatePDFURLForPDFBundleURL(NSURL *aURL)
@@ -618,7 +618,7 @@
 
 + (BOOL)canInitWithURL:(NSURL *)aURL withType:(NSString *)type
 {
-    return UTTypeConformsTo((CFStringRef)type, 
FVSTR("com.apple.localized-pdf-bundle"));
+    return UTTypeConformsTo((__bridge CFStringRef)type, 
FVSTR("com.apple.localized-pdf-bundle"));
 }
 
 // return the same thing as PDF; just a container for the URL, until actually 
asked to render the PDF file
@@ -672,7 +672,7 @@
 
 + (BOOL)canInitWithURL:(NSURL *)aURL withType:(NSString *)type
 {
-    return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber13_0 && 
UTTypeConformsTo((CFStringRef)type, FVSTR("com.adobe.postscript"));
+    return floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber13_0 && 
UTTypeConformsTo((__bridge CFStringRef)type, FVSTR("com.adobe.postscript"));
 }
 
 - (id)initWithURL:(NSURL *)aURL drawsLinkBadge:(BOOL)drawsLinkBadge

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPlaceholderImage.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPlaceholderImage.m      
2024-01-18 15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPlaceholderImage.m      
2024-01-19 16:45:49 UTC (rev 28631)
@@ -88,7 +88,7 @@
         
         [NSGraphicsContext restoreGraphicsState];
                 
-        [_placeholders addObject:(id)layer];
+        [_placeholders addObject:(__bridge id)layer];
         CGLayerRelease(layer);
     }
 }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m     2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m     2024-01-19 
16:45:49 UTC (rev 28631)
@@ -93,11 +93,11 @@
         NO == [aURL checkResourceIsReachableAndReturnError:NULL])
         return NO;
     
-    if (nil == theUTI || UTTypeEqual((CFStringRef)theUTI, kUTTypeData)) {
+    if (nil == theUTI || UTTypeEqual((__bridge CFStringRef)theUTI, 
kUTTypeData)) {
         NSAttributedString *string = [[[NSAttributedString alloc] 
initWithURL:aURL options:@{} documentAttributes:NULL error:NULL] autorelease];
         return (string == nil);
     }
-    else if (UTTypeConformsTo((CFStringRef)theUTI, kUTTypePDF) || 
UTTypeConformsTo((CFStringRef)theUTI, FVSTR("com.adobe.postscript"))) {
+    else if (UTTypeConformsTo((__bridge CFStringRef)theUTI, kUTTypePDF) || 
UTTypeConformsTo((__bridge CFStringRef)theUTI, FVSTR("com.adobe.postscript"))) {
         return NO;
     }
     else if ([FVTextIcon canInitWithURL:aURL withType:theUTI]) {
@@ -282,7 +282,7 @@
         pdfData = nil;
     }
     
-    return [(id)pdfData autorelease];
+    return CFBridgingRelease(pdfData);
 }
 
 - (void)_loadAttributedString:(NSAttributedString *)string 
documentAttributes:(NSDictionary *)attrs inView:(NSTextView *)theView
@@ -330,10 +330,10 @@
     // everything from here on safely assumes a file URL
     
     // kLSItemContentType returns a CFStringRef, according to the header
-    CFTypeRef theUTI = NULL;
+    NSString *theUTI = NULL;
     BOOL notFound = NO;
     
-    if ([representedURL getResourceValue:(NSString **)theUTI 
forKey:NSURLTypeIdentifierKey error:NULL] == NO)
+    if ([representedURL getResourceValue:&theUTI forKey:NSURLTypeIdentifierKey 
error:NULL] == NO)
         notFound = NO == [representedURL 
checkResourceIsReachableAndReturnError:NULL];
     
     NSView *theView = nil;
@@ -343,7 +343,7 @@
         theView = imageView;
         [(FVScaledImageView *)theView displayImageAtURL:representedURL];
     }
-    else if (nil == theUTI || UTTypeEqual(theUTI, kUTTypeData)) {
+    else if (nil == theUTI || UTTypeEqual((__bridge CFStringRef)theUTI, 
kUTTypeData)) {
         theView = textView;
         NSDictionary *attrs;
         NSAttributedString *string = [[NSAttributedString alloc] 
initWithURL:representedURL options:@{} documentAttributes:&attrs error:NULL];
@@ -353,19 +353,19 @@
             theView = nil;
         [string release]; 
     }
-    else if (UTTypeConformsTo(theUTI, kUTTypePDF)) {
+    else if (UTTypeConformsTo((__bridge CFStringRef)theUTI, kUTTypePDF)) {
         theView = pdfView;
         PDFDocument *pdfDoc = [[PDFDocument alloc] initWithURL:representedURL];
         [pdfView setDocument:pdfDoc];
         [pdfDoc release];
     }
-    else if (UTTypeConformsTo(theUTI, FVSTR("com.adobe.postscript"))) {
+    else if (UTTypeConformsTo((__bridge CFStringRef)theUTI, 
FVSTR("com.adobe.postscript"))) {
         theView = pdfView;
         PDFDocument *pdfDoc = [[PDFDocument alloc] 
initWithData:PDFDataWithPostScriptDataAtURL(representedURL)];
         [pdfView setDocument:pdfDoc];
         [pdfDoc release];         
     }
-    else if (UTTypeConformsTo(theUTI, kUTTypeImage)) {
+    else if (UTTypeConformsTo((__bridge CFStringRef)theUTI, kUTTypeImage)) {
         theView = imageView;
         [(FVScaledImageView *)theView displayImageAtURL:representedURL];
     }
@@ -380,7 +380,7 @@
         }
     }
  */
-    else if ([FVTextIcon canInitWithURL:representedURL withType:(NSString 
*)theUTI]) {
+    else if ([FVTextIcon canInitWithURL:representedURL withType:theUTI]) {
         theView = textView;
         NSDictionary *attrs;
         NSAttributedString *string = [[NSAttributedString alloc] 
initWithURL:representedURL options:@{} documentAttributes:&attrs error:NULL];

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.mm
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.mm        
2024-01-18 15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.mm        
2024-01-19 16:45:49 UTC (rev 28631)
@@ -160,8 +160,8 @@
 - (void)push:(id)object;
 { 
     NSParameterAssert([object respondsToSelector:@selector(compare:)]);
-    if (CFSetContainsValue(_set, object) == FALSE) {
-        CFSetAddValue(_set, object);
+    if (CFSetContainsValue(_set, (__bridge void *)object) == FALSE) {
+        CFSetAddValue(_set, (__bridge void *)object);
         NSUInteger count = __FVPriorityQueueCount(self);
         count++;
         __FVPriorityQueueSetCount(self, count);
@@ -190,7 +190,7 @@
 
 - (void)pushMultiple:(NSArray *)objects;
 {
-    CFArrayRef cfObjects = reinterpret_cast <CFArrayRef>(objects);
+    CFArrayRef cfObjects = (__bridge CFArrayRef)(objects);
     const CFIndex iMax = CFArrayGetCount(cfObjects);
     CFIndex i, numberAdded = 0;
     
@@ -215,8 +215,8 @@
     for (i = 0; i < iMax; i++) {
         id object = reinterpret_cast <id>(const_cast <void 
*>(CFArrayGetValueAtIndex(cfObjects, i)));
         NSParameterAssert([object respondsToSelector:@selector(compare:)]);
-        if (CFSetContainsValue(_set, object) == FALSE) {
-            CFSetAddValue(_set, object);
+        if (CFSetContainsValue(_set, (__bridge void *)object) == FALSE) {
+            CFSetAddValue(_set, (__bridge void *)object);
             buffer[numberAdded] = object;
             numberAdded++;
         }
@@ -256,7 +256,7 @@
         
         // make sure we don't remove the last reference to this object
         toReturn = [[toReturn retain] autorelease];
-        CFSetRemoveValue(_set, toReturn);
+        CFSetRemoveValue(_set, (__bridge void *)toReturn);
         
         if (0 == count)
             _madeHeap = 0;
@@ -327,10 +327,10 @@
 void FVPriorityQueueApplyFunction(FVPriorityQueue *queue, 
FVPriorityQueueApplierFunction applier, void *context)
 {
     [queue _sortQueueForEnumeration];
-    const void **values = (const void **)__FVPriorityQueueHeapStart(queue);
-    CFArrayRef array = CFArrayCreate(CFGetAllocator(queue), values, 
__FVPriorityQueueCount(queue), NULL);
-    CFArrayApplyFunction(array, CFRangeMake(0, CFArrayGetCount(array)), 
applier, context);
-    CFRelease(array);
+    id __unsafe_unretained *values = __FVPriorityQueueHeapStart(queue);
+    NSUInteger i, count = __FVPriorityQueueCount(queue);
+    for (i = 0; i < count; i++)
+        applier((__bridge void *)values[i], context);
 }
 
 @end

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVQuickLookIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVQuickLookIcon.m 2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVQuickLookIcon.m 2024-01-19 
16:45:49 UTC (rev 28631)
@@ -55,7 +55,7 @@
     BOOL ret = YES;
     CFStringRef theUTI;
     
-    if (CFURLCopyResourcePropertyForKey((CFURLRef)aURL, 
kCFURLTypeIdentifierKey, &theUTI, NULL)) {
+    if (CFURLCopyResourcePropertyForKey((__bridge CFURLRef)aURL, 
kCFURLTypeIdentifierKey, &theUTI, NULL)) {
         /* 
          No background for movies; the QL icon is always used for .wmv types 
(see comment in FVIcon for motiviation).  
          Drawing a black background and highlighting it would make the icon 
look like Finder's Desktop icons, but that's 
@@ -171,7 +171,7 @@
         // !!! QLThumbnailImageCreate is not currently a good candidate for 
FVAllocator, since image sizes are unpredictable.  I'm not sure how that should 
be handled, but at present FVQuickLookIcon is not enough of a problem to worry 
about.
         if (NULL == _thumbnail) {
             CGFloat dim = FVMaxImageDimension * FVDefaultScale;
-            _thumbnail = QLThumbnailImageCreate(NULL, (CFURLRef)_fileURL, 
NSMakeSize(dim, dim), NULL);
+            _thumbnail = QLThumbnailImageCreate(NULL, (__bridge 
CFURLRef)_fileURL, NSMakeSize(dim, dim), NULL);
         }
         
         if (NULL == _thumbnail)
@@ -188,7 +188,7 @@
             }
             
             if (NULL == _fullImage) {
-                _fullImage = QLThumbnailImageCreate(NULL, (CFURLRef)_fileURL, 
NSSizeToCGSize(size), NULL);
+                _fullImage = QLThumbnailImageCreate(NULL, (__bridge 
CFURLRef)_fileURL, NSSizeToCGSize(size), NULL);
             }
             
             if (NULL == _fullImage)

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVScaledImageView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVScaledImageView.m       
2024-01-18 15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVScaledImageView.m       
2024-01-19 16:45:49 UTC (rev 28631)
@@ -107,7 +107,7 @@
         [fileDescription appendAttributedString:details];
         [details release];
     }
-    [_text autorelease];
+    [_text release];
     _text = fileDescription;
 }
 
@@ -141,7 +141,7 @@
 {
     [self setFileURL:aURL];
     [self setIcon:[FVIcon iconWithURL:aURL]];
-    [_text autorelease];
+    [_text release];
     _text = nil;
 }
 

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m      2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m      2024-01-19 
16:45:49 UTC (rev 28631)
@@ -51,7 +51,7 @@
      Additionally, files that are named "README" are public.data, but actually 
plain text files.  Since
      LS doesn't sniff types, we'll just try to open anything that's equal (not 
conforming) to public.data.
      */
-    if (type == nil || UTTypeEqual((CFStringRef)type, kUTTypeData)) {
+    if (type == nil || UTTypeEqual((__bridge CFStringRef)type, kUTTypeData)) {
         // This is mainly useful to prove that the file cannot be opened; as 
in the case of OmniGraffle files (see comment above), it returns YES.
         NSAttributedString *attributedString = [[NSAttributedString 
allocWithZone:[self zone]] initWithURL:aURL options:@{} documentAttributes:NULL 
error:NULL];
         BOOL canInit = (nil != attributedString);
@@ -66,7 +66,7 @@
 
     NSUInteger cnt = [types count];
     while (cnt--)
-        if (UTTypeConformsTo((CFStringRef)type, (CFStringRef)[types 
objectAtIndex:cnt]))
+        if (UTTypeConformsTo((__bridge CFStringRef)type, (__bridge 
CFStringRef)[types objectAtIndex:cnt]))
             return YES;
     return NO;
 }
@@ -128,7 +128,7 @@
     }
     FVAPIParameterAssert(nil != attrString);
     
-    CFMutableAttributedStringRef cfAttrString = 
(CFMutableAttributedStringRef)attrString;
+    CFMutableAttributedStringRef cfAttrString = 
(CFMutableAttributedStringRef)CFBridgingRetain(attrString);
     
     // set up page layout parameters
     CGRect paperRect = CGRectMake(0.0, 0.0, FVDefaultPaperWidth, 
FVDefaultPaperHeight);
@@ -205,6 +205,8 @@
     
     CGImageRef image = CGBitmapContextCreateImage(ctxt);
     
+    CFRelease(cfAttrString);
+    
     // don't need to resample for _fullImage
     *isFullSize = YES;
     

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVThread.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVThread.m        2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVThread.m        2024-01-19 
16:45:49 UTC (rev 28631)
@@ -207,8 +207,12 @@
         
         // not required as an ivar at present
         pthread_t thread;
-        if (0 == err)
-            err = pthread_create(&thread, &attr, __FVThread_main, [self 
retain]);
+        if (0 == err) {
+            CFTypeRef retainedSelf = CFBridgingRetain(self);
+            err = pthread_create(&thread, &attr, __FVThread_main, (void 
*)retainedSelf);
+            if (0 != err)
+                CFRelease(retainedSelf);
+        }
         pthread_attr_destroy(&attr);
         
         if (0 != err) {
@@ -274,7 +278,7 @@
     @autoreleasepool {
 #endif
     
-    _FVThread *self = obj;
+    _FVThread *self = (__bridge id)obj;
     
     pthread_mutex_lock(&self->_mutex);
         
@@ -329,7 +333,7 @@
             [_FVThread recycleThread:self];
         }
     }
-    [self release];
+    CFRelease((__bridge CFTypeRef)self);
 #if DEBUG_REAPER
     }
 #endif

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.h     2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.h     2024-01-19 
16:45:49 UTC (rev 28631)
@@ -92,6 +92,10 @@
  Run a block with the current appearance set to the effective appearance of 
the object. */
 FV_PRIVATE_EXTERN void FVRunWithAppearance(id object, void (^code)(void));
 
+/** @internal
+ Ensure an object is keps autoreleased in safe way for ARC. */
+FV_PRIVATE_EXTERN void FVRetainAutorelease(id object);
+
 __END_DECLS
 
 #endif /* _FVUTILITIES_H_ */

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m     2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m     2024-01-19 
16:45:49 UTC (rev 28631)
@@ -45,7 +45,7 @@
 @interface _FVNSObjectTimerInfo : NSObject
 {
 @public;
-    id  target;
+    __weak id  target;
     SEL selector;
 }
 @end
@@ -53,18 +53,18 @@
 @implementation _FVNSObjectTimerInfo
 @end
 
-static const void * __FVTimerInfoRetain(const void *info) { return [(id)info 
retain]; }
-static void __FVTimerInfoRelease(const void *info) { [(id)info release]; }
+static const void * __FVTimerInfoRetain(const void *info) { return info == 
NULL ? NULL :  CFRetain((CFTypeRef)info); }
+static void __FVTimerInfoRelease(const void *info) { if (info != NULL) 
CFRelease((CFTypeRef)info); }
 static CFStringRef __FVTimerInfoCopyDescription(const void *info)
 {
-    _FVNSObjectTimerInfo *tmi = (void *)info;
+    _FVNSObjectTimerInfo *tmi = (__bridge id)info;
     return (CFStringRef)[[NSString alloc] 
initWithFormat:@"_FVNSObjectTimerInfo = {\n\ttarget = %@,\n\tselector = %@\n}", 
tmi->target, NSStringFromSelector(tmi->selector)];    
 }
 
 static void __FVRunLoopTimerFired(CFRunLoopTimerRef timer, void *info)
 {
-    _FVNSObjectTimerInfo *tmi = info;
-    [tmi->target performSelector:tmi->selector withObject:(id)timer];
+    _FVNSObjectTimerInfo *tmi = (__bridge id)info;
+    [tmi->target performSelector:tmi->selector withObject:(__bridge id)timer];
 }
 
 CFRunLoopTimerRef FVCreateWeakTimerWithTimeInterval(NSTimeInterval interval, 
NSTimeInterval fireTime, id target, SEL selector)
@@ -74,7 +74,7 @@
     tmi->target = target;
     tmi->selector = selector;
     
-    CFRunLoopTimerContext timerContext = {  0, tmi, __FVTimerInfoRetain, 
__FVTimerInfoRelease, __FVTimerInfoCopyDescription };
+    CFRunLoopTimerContext timerContext = {  0, (__bridge void *)tmi, 
__FVTimerInfoRetain, __FVTimerInfoRelease, __FVTimerInfoCopyDescription };
     CFRunLoopTimerRef timer = CFRunLoopTimerCreate(CFAllocatorGetDefault(), 
fireTime, interval, 0, 0, __FVRunLoopTimerFired, &timerContext);
     
     // now owned by the timer
@@ -186,12 +186,12 @@
     
     CFBooleanRef flag = NULL;
     bool rv = false;
-    if (CFURLCopyResourcePropertyForKey((CFURLRef)fileURL, 
kCFURLVolumeIsInternalKey, &flag, NULL) && flag) {
+    if (CFURLCopyResourcePropertyForKey((__bridge CFURLRef)fileURL, 
kCFURLVolumeIsInternalKey, &flag, NULL) && flag) {
         rv = CFBooleanGetValue(flag);
         CFRelease(flag);
     }
     CFTypeRef volumeID = NULL;
-    if (rv == false && CFURLCopyResourcePropertyForKey((CFURLRef)fileURL, 
kCFURLVolumeIdentifierKey, &volumeID, NULL) && volumeID) {
+    if (rv == false && CFURLCopyResourcePropertyForKey((__bridge 
CFURLRef)fileURL, kCFURLVolumeIdentifierKey, &volumeID, NULL) && volumeID) {
         CFTypeRef otherVolumeID = NULL;
         if (CFURLCopyResourcePropertyForKey((CFURLRef)[NSURL 
fileURLWithPath:NSOpenStepRootDirectory()], kCFURLVolumeIdentifierKey, 
&otherVolumeID, NULL) && otherVolumeID) {
             rv = CFEqual(volumeID, otherVolumeID);
@@ -312,3 +312,11 @@
     }
 }
 
+void FVRetainAutorelease(id object) {
+#if defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MIN_REQUIRED >= 
MAC_OS_X_VERSION_10_9
+    (void)CFAutorelease(CFBridgingRetain(object));
+#else
+    CFTypeRef (*autoreleaseImp)(CFTypeRef, SEL) = (CFTypeRef (*)(CFTypeRef, 
SEL))[object methodForSelector:@selector(autorelease)];
+    (void)autoreleaseImp(CFBridgingRetain(object), @selector(autorelease));
+#endif
+}

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m   2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m   2024-01-19 
16:45:49 UTC (rev 28631)
@@ -94,7 +94,7 @@
     }
     
     if (_maxWebViews > 0)
-        _waitingList = (NSMutableArray *)CFArrayCreateMutable(NULL, 0, NULL);
+        _waitingList = [[NSMutableArray alloc] init];
 }
 
 + (BOOL)_isSupportedScheme:(NSString *)scheme
@@ -109,7 +109,7 @@
     if (0 == _maxWebViews) {
         return NO;
     } else if ([aURL isFileURL]) {
-        return UTTypeConformsTo((CFStringRef)type, kUTTypeHTML) || 
UTTypeConformsTo((CFStringRef)type, kUTTypeWebArchive);
+        return UTTypeConformsTo((__bridge CFStringRef)type, kUTTypeHTML) || 
UTTypeConformsTo((__bridge CFStringRef)type, kUTTypeWebArchive);
     } else {
         // if this is not an http or file URL, return a finder icon instead
         return [self _isSupportedScheme:[aURL scheme]];
@@ -619,7 +619,8 @@
     FVAPIAssert([_webView downloadDelegate] == nil, @"downloadDelegate 
non-nil");
     FVAPIAssert([_webView UIDelegate] == nil, @"UIDelegate non-nil");
     // autorelease instead of release to workaround rdar://problem/9923439 
(WebKit: crash when loading cancelled due to policy delegate callout)
-    [_webView autorelease];
+    FVRetainAutorelease(_webView);
+    [_webView release];
     _webView = nil;
     return YES;
 }
@@ -712,7 +713,7 @@
      See 
http://trac.webkit.org/projects/webkit/browser/trunk/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m
      */
     
-    CFStringRef theUTI = type == nil ? NULL : 
UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (CFStringRef)type, 
NULL);
+    CFStringRef theUTI = type == nil ? NULL : 
UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (__bridge 
CFStringRef)type, NULL);
     
     // FVWebViewIcon handles .webarchive files, so implement the standard 
file: URL handler
     if ([[request URL] isFileURL]) {
@@ -731,7 +732,7 @@
     }
     else if (NO == [[sender class] canShowMIMEType:type] ||
              (NULL != theUTI && FALSE == UTTypeConformsTo(theUTI, 
kUTTypeText))) {
-        [_icon _webViewReceivedUnsupportedMIMEType:(NSString *)theUTI];
+        [_icon _webViewReceivedUnsupportedMIMEType:(__bridge NSString 
*)theUTI];
         // this triggers webView:didFailProvisionalLoadWithError:forFrame:
         [listener ignore];
     }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVMappedDataProvider.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVMappedDataProvider.m   
2024-01-18 15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVMappedDataProvider.m   
2024-01-19 16:45:49 UTC (rev 28631)
@@ -129,7 +129,7 @@
             pInfo->_provider = CGDataProviderCreateDirect(mapInfo, 
mapInfo->length, &_FVMappedDataProviderDirectCallBacks);
         }
         close(fd);
-        CFDictionarySetValue(_dataProviders, (CFURLRef)aURL, pInfo);
+        CFDictionarySetValue(_dataProviders, (__bridge CFURLRef)aURL, 
(__bridge void *)pInfo);
         [pInfo release];
     }
     if (pInfo) pInfo->_refCount++;
@@ -146,7 +146,7 @@
         pInfo->_refCount--;
         if (pInfo->_refCount == 0) {
             CGDataProviderRelease(pInfo->_provider);
-            CFDictionaryRemoveValue(_dataProviders, aURL);
+            CFDictionaryRemoveValue(_dataProviders, (__bridge CFURLRef)aURL);
         }
     }
     pthread_mutex_unlock(&_providerLock);

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVPreviewerWindow.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVPreviewerWindow.m      
2024-01-18 15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVPreviewerWindow.m      
2024-01-19 16:45:49 UTC (rev 28631)
@@ -44,7 +44,7 @@
 
 static CGEventRef __FVPreviewWindowMouseDown(CGEventTapProxy proxy, 
CGEventType type, CGEventRef event, void *refcon)
 {
-    _FVPreviewerWindow *self = refcon;
+    _FVPreviewerWindow *self = (__bridge id)refcon;
     
     if (CGRectContainsPoint(NSRectToCGRect([self frame]), 
CGEventGetUnflippedLocation(event))) {
         

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVSplitSet.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVSplitSet.m     2024-01-18 
15:52:26 UTC (rev 28630)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/_FVSplitSet.m     2024-01-19 
16:45:49 UTC (rev 28631)
@@ -67,22 +67,22 @@
 - (void)addObject:(id)obj
 {
     if (_split == (NSUInteger)CFSetGetCount(_new)) {
-        [(NSMutableSet *)_old unionSet:(NSSet *)_new];
+        [(__bridge NSMutableSet *)_old unionSet:(__bridge NSSet *)_new];
         CFSetRemoveAllValues(_new);
     }
-    CFSetAddValue(_new, obj);
-    CFSetRemoveValue(_old, obj);
+    CFSetAddValue(_new, (__bridge void *)obj);
+    CFSetRemoveValue(_old, (__bridge void *)obj);
 }
 
 - (void)removeObject:(id)obj
 {
-    CFSetRemoveValue(_new, obj);
-    CFSetRemoveValue(_old, obj);
+    CFSetRemoveValue(_new, (__bridge void *)obj);
+    CFSetRemoveValue(_old, (__bridge void *)obj);
 }
 
 - (void)removeOldObjects { CFSetRemoveAllValues(_old); }
 
-- (NSSet *)copyOldObjects { return (NSSet 
*)CFSetCreateCopy(CFGetAllocator(_old), _old); }
+- (NSSet *)copyOldObjects { return [(NSSet 
*)CFBridgingRelease(CFSetCreateCopy(CFGetAllocator(_old), _old)) retain]; }
 
 - (NSUInteger)count { return CFSetGetCount(_old) + CFSetGetCount(_new); }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to