Revision: 28543
          http://sourceforge.net/p/bibdesk/svn/28543
Author:   hofman
Date:     2024-01-04 23:15:02 +0000 (Thu, 04 Jan 2024)
Log Message:
-----------
add a __bridge and two CFBridgingRelease

Modified Paths:
--------------
    trunk/bibdesk/BDSKErrorManager.m
    trunk/bibdesk/BDSKSciFinderParser.m
    trunk/bibdesk/BDSKSharingServer.m

Modified: trunk/bibdesk/BDSKErrorManager.m
===================================================================
--- trunk/bibdesk/BDSKErrorManager.m    2024-01-04 16:51:17 UTC (rev 28542)
+++ trunk/bibdesk/BDSKErrorManager.m    2024-01-04 23:15:02 UTC (rev 28543)
@@ -81,7 +81,7 @@
 {
     if (document)
         BDSKENSURE_MAIN_THREAD(
-                               [document removeObserver:self 
forKeyPath:@"fileURL" context:&BDSKErrorManagerObservationContext];
+            [document removeObserver:self forKeyPath:@"fileURL" 
context:&BDSKErrorManagerObservationContext];
             [document removeObserver:self forKeyPath:@"documentStringEncoding" 
context:&BDSKErrorManagerObservationContext];
         );
     BDSKDESTROY(document);

Modified: trunk/bibdesk/BDSKSciFinderParser.m
===================================================================
--- trunk/bibdesk/BDSKSciFinderParser.m 2024-01-04 16:51:17 UTC (rev 28542)
+++ trunk/bibdesk/BDSKSciFinderParser.m 2024-01-04 23:15:02 UTC (rev 28543)
@@ -50,23 +50,20 @@
     return [[string stringByTrimmingCharactersInSet:[NSCharacterSet 
newlineCharacterSet]] hasPrefix:@"START_RECORD"];
 }
 
-+ (BOOL)copyKey:(NSString **)key value:(NSString **)value fromLine:(NSString 
*)line;
++ (BOOL)getKey:(NSString **)key value:(NSString **)value fromLine:(NSString 
*)line;
 {
     NSRange r = [line rangeOfString:@":"];
     NSUInteger len = [line length];
     if (r.location != NSNotFound && (r.location + 1) < len) {
         CFAllocatorRef alloc = CFGetAllocator((__bridge CFStringRef)line);
-        *key = (id)CFStringCreateWithSubstring(alloc, (__bridge 
CFStringRef)line, CFRangeMake(0, r.location));
+        *key = CFBridgingRelease(CFStringCreateWithSubstring(alloc, (__bridge 
CFStringRef)line, CFRangeMake(0, r.location)));
         // advance range past the ":"
         r.location += 1;
-        *value = (id)CFStringCreateWithSubstring(alloc, (__bridge 
CFStringRef)line, CFRangeMake(r.location, len - r.location));
+        *value = CFBridgingRelease(CFStringCreateWithSubstring(alloc, 
(__bridge CFStringRef)line, CFRangeMake(r.location, len - r.location)));
         
         // just checking length may not be sufficient; some entries have a 
single space past the colon
         if ([*value rangeOfCharacterFromSet:[NSCharacterSet 
alphanumericCharacterSet]].length)
             return YES;
-        // no meaningful characters, so release and return NO
-        [*key release];
-        [*value release];
     }
     return NO;
 }
@@ -222,7 +219,7 @@
             
             // lots of keys have empty values, so check the return value of 
this method
             // some fields also seem to be continued, but those end up getting 
dumped into Annote
-            if ([self copyKey:&key value:&value fromLine:line]) {
+            if ([self getKey:&key value:&value fromLine:line]) {
                 fixAndAddKeyValueToDictionary(key, value, pubFields);
                 [key release];
                 [value release];

Modified: trunk/bibdesk/BDSKSharingServer.m
===================================================================
--- trunk/bibdesk/BDSKSharingServer.m   2024-01-04 16:51:17 UTC (rev 28542)
+++ trunk/bibdesk/BDSKSharingServer.m   2024-01-04 23:15:02 UTC (rev 28543)
@@ -88,7 +88,7 @@
     CFIndex cnt = CFArrayGetCount(changedKeys);
     NSString *key;
     while(cnt--){
-        key = (id)CFArrayGetValueAtIndex(changedKeys, cnt);
+        key = (__bridge id)CFArrayGetValueAtIndex(changedKeys, cnt);
         if ([key isEqualToString:BDSKComputerNameChangedKey])
             BDSKENSURE_MAIN_THREAD( [[NSNotificationCenter defaultCenter] 
postNotificationName:BDSKComputerNameChangedNotification object:nil]; );
     }

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