Revision: 28511
http://sourceforge.net/p/bibdesk/svn/28511
Author: hofman
Date: 2024-01-02 16:03:03 +0000 (Tue, 02 Jan 2024)
Log Message:
-----------
add more simple __bridge
Modified Paths:
--------------
trunk/bibdesk/BDSKAppController.m
trunk/bibdesk/BDSKAsynchronousWebParser.m
trunk/bibdesk/BDSKBibDeskProtocol.m
trunk/bibdesk/BDSKBibTeXParser.m
trunk/bibdesk/BDSKConverter.m
trunk/bibdesk/BDSKDOIParser.m
trunk/bibdesk/BDSKErrorEditor.m
trunk/bibdesk/BDSKMARCParser.m
trunk/bibdesk/BDSKMODSParser.m
trunk/bibdesk/BDSKPreferenceController.m
trunk/bibdesk/BDSKPubMedParser.m
trunk/bibdesk/BDSKRISParser.m
trunk/bibdesk/BDSKReferParser.m
trunk/bibdesk/BDSKSciFinderParser.m
trunk/bibdesk/BDSKScriptMenu.m
trunk/bibdesk/BDSKSoapBinding.m
trunk/bibdesk/BDSKWebOfScienceParser.m
trunk/bibdesk/BibDocument_Groups.m
trunk/bibdesk/NSAttributedString_BDSKExtensions.m
trunk/bibdesk/NSData_BDSKExtensions.m
trunk/bibdesk/NSFileManager_BDSKExtensions.m
trunk/bibdesk/NSImage_BDSKExtensions.m
trunk/bibdesk/NSMenu_BDSKExtensions.m
trunk/bibdesk/NSPasteboard_BDSKExtensions.m
trunk/bibdesk/NSPointerFunctions_BDSKExtensions.m
trunk/bibdesk/NSScanner_BDSKExtensions.m
trunk/bibdesk/NSURL_BDSKExtensions.m
trunk/bibdesk/NSWorkspace_BDSKExtensions.m
Modified: trunk/bibdesk/BDSKAppController.m
===================================================================
--- trunk/bibdesk/BDSKAppController.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKAppController.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -369,7 +369,7 @@
[history loadFromURL:historyURL error:NULL];
[WebHistory setOptionalSharedHistory:history];
- NSString *appName = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey];
+ NSString *appName = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey];
NSUInteger i = 0;
NSArray *colors = [NSColor labelColors];
NSArray *names = [NSColor labelNames];
@@ -393,7 +393,7 @@
Boolean result = false;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- if (CFURLGetFSRef((CFURLRef)fileURL, &fileRef)) {
+ if (CFURLGetFSRef((__bridge CFURLRef)fileURL, &fileRef)) {
FSDetermineIfRefIsEnclosedByFolder(0, kTrashFolderType, &fileRef,
&result);
if (result == false)
FSDetermineIfRefIsEnclosedByFolder(0, kSystemTrashFolderType,
&fileRef, &result);
Modified: trunk/bibdesk/BDSKAsynchronousWebParser.m
===================================================================
--- trunk/bibdesk/BDSKAsynchronousWebParser.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/BDSKAsynchronousWebParser.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -219,7 +219,7 @@
NSStringEncoding encoding = kCFStringEncodingInvalidId;
if (nil != encodingName)
- encoding =
CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)encodingName));
+ encoding =
CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((__bridge
CFStringRef)encodingName));
if (encoding != kCFStringEncodingInvalidId)
string = [[NSString alloc] initWithData:data encoding:encoding];
if (nil == string && encoding != NSUTF8StringEncoding)
Modified: trunk/bibdesk/BDSKBibDeskProtocol.m
===================================================================
--- trunk/bibdesk/BDSKBibDeskProtocol.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKBibDeskProtocol.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -130,7 +130,7 @@
if (path) {
NSData *data = [NSData dataWithContentsOfFile:path];
NSString *theUTI = [[NSWorkspace sharedWorkspace] typeOfFile:path
error:NULL];
- NSString *MIMEType = (NSString
*)UTTypeCopyPreferredTagWithClass((CFStringRef)theUTI, kUTTagClassMIMEType);
+ NSString *MIMEType = (NSString
*)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)theUTI,
kUTTagClassMIMEType);
[self loadData:data MIMEType:MIMEType];
[MIMEType release];
} else {
Modified: trunk/bibdesk/BDSKBibTeXParser.m
===================================================================
--- trunk/bibdesk/BDSKBibTeXParser.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKBibTeXParser.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -396,7 +396,7 @@
if(endOfValue == NO)
break;
- CFStringTrimWhitespace((CFMutableStringRef)value);
+ CFStringTrimWhitespace((__bridge CFMutableStringRef)value);
key = [key stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceAndNewlineCharacterSet]];
if ((s = [[NSString alloc] initWithBibTeXString:value
macroResolver:macroResolver error:&error])) {
@@ -483,7 +483,7 @@
if(nesting > 0)
continue;
- CFStringTrimWhitespace((CFMutableStringRef)value);
+ CFStringTrimWhitespace((__bridge CFMutableStringRef)value);
key = [key stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceAndNewlineCharacterSet]];
if ((s = [[NSString alloc] initWithBibTeXString:value
macroResolver:macroResolver error:&error])) {
@@ -567,7 +567,7 @@
// This is equivalent to btparse's bt_split_list(str, "and", "BibTex
Name", 0, ""), but avoids UTF8String conversion
// check brace depth; corporate authors such as {Someone and Someone Else,
Inc} use braces, so this parsing is BibTeX-specific, rather than general string
handling
- CFArrayRef names = __BDCreateArrayOfNames((CFStringRef)aString);
+ CFArrayRef names = __BDCreateArrayOfNames((__bridge CFStringRef)aString);
// shouldn't ever see this case as far as I know, as long as we're using
btparse
if(names == NULL){
@@ -582,7 +582,7 @@
CFIndex i = 0, iMax = CFArrayGetCount(names);
for(i = 0; i < iMax; i++){
- NSString *name = (id)CFArrayGetValueAtIndex(names, i);
+ NSString *name = (__bridge NSString *)CFArrayGetValueAtIndex(names, i);
BibAuthor *anAuthor = nil;
for (anAuthor in oldAuthors) {
if ([[anAuthor originalName] isEqualToString:name]) {
@@ -591,7 +591,7 @@
}
}
if (anAuthor == nil)
- anAuthor = [[BibAuthor alloc]
initWithName:(id)CFArrayGetValueAtIndex(names, i) publication:pub
forField:field];
+ anAuthor = [[BibAuthor alloc] initWithName:(__bridge NSString
*)CFArrayGetValueAtIndex(names, i) publication:pub forField:field];
[authors addObject:anAuthor];
[anAuthor release];
}
@@ -631,11 +631,11 @@
CFAllocatorRef alloc = CFAllocatorGetDefault();
// we need to remove newlines and collapse whitespace before using
bt_split_name
- aName = (NSString
*)BDStringCreateByCollapsingAndTrimmingCharactersInSet(alloc,
(CFStringRef)aName, (CFCharacterSetRef)[NSCharacterSet
whitespaceAndNewlineCharacterSet]);
+ aName = (NSString
*)BDStringCreateByCollapsingAndTrimmingCharactersInSet(alloc, (__bridge
CFStringRef)aName, (__bridge CFCharacterSetRef)[NSCharacterSet
whitespaceAndNewlineCharacterSet]);
// get the fastest encoding, since it usually allows us to get a pointer
to the contents
// the main reason for using CFString here is that it offers cString
create/get for any encoding
- CFStringEncoding encoding =
CFStringGetFastestEncoding((CFStringRef)aName);
+ CFStringEncoding encoding = CFStringGetFastestEncoding((__bridge
CFStringRef)aName);
// if it's Unicode, switch to UTF-8 to avoid data loss (btparse doesn't
like unichars)
if(encoding >= kCFStringEncodingUnicode)
@@ -642,9 +642,9 @@
encoding = kCFStringEncodingUTF8;
const char *name_cstring = NULL;
- name_cstring = CFStringGetCStringPtr((CFStringRef)aName, encoding);
+ name_cstring = CFStringGetCStringPtr((__bridge CFStringRef)aName,
encoding);
BOOL shouldFree = NO;
- CFIndex fullLength = CFStringGetLength((CFStringRef)aName);
+ CFIndex fullLength = CFStringGetLength((__bridge CFStringRef)aName);
// CFStringGetCStringPtr will probably always fail for UTF-8, but it may
fail regardless
if(NULL == name_cstring){
@@ -668,7 +668,7 @@
relative to that overhead.
*/
char *buffer = (char *)CFAllocatorAllocate(alloc, requiredLength, 0);
- if(CFStringGetCString((CFStringRef)aName, buffer, requiredLength,
encoding)){
+ if(CFStringGetCString((__bridge CFStringRef)aName, buffer,
requiredLength, encoding)){
name_cstring = buffer;
} else {
[NSException raise:NSInternalInconsistencyException
format:@"Unable to convert string %@ to encoding %@", aName,
CFStringGetNameOfEncoding(encoding)];
Modified: trunk/bibdesk/BDSKConverter.m
===================================================================
--- trunk/bibdesk/BDSKConverter.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKConverter.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -145,7 +145,7 @@
// we expect to find composed accented characters, as this is also what we
use in the CharacterConversion plist
NSMutableString *precomposedString = [s mutableCopy];
- CFStringNormalize((CFMutableStringRef)precomposedString,
kCFStringNormalizationFormC);
+ CFStringNormalize((__bridge CFMutableStringRef)precomposedString,
kCFStringNormalizationFormC);
NSMutableString *tmpConv = nil;
NSMutableString *convertedSoFar = nil;
@@ -154,10 +154,10 @@
NSString *TEXString = nil;
UniChar ch;
- CFIndex idx, numberOfCharacters =
CFStringGetLength((CFStringRef)precomposedString);
+ CFIndex idx, numberOfCharacters = CFStringGetLength((__bridge
CFStringRef)precomposedString);
NSRange r;
CFStringInlineBuffer inlineBuffer;
- CFStringInitInlineBuffer((CFStringRef)precomposedString, &inlineBuffer,
CFRangeMake(0, numberOfCharacters));
+ CFStringInitInlineBuffer((__bridge CFStringRef)precomposedString,
&inlineBuffer, CFRangeMake(0, numberOfCharacters));
for (idx = 0; (idx < numberOfCharacters); idx++) {
@@ -205,7 +205,7 @@
static BOOL convertComposedCharacterToTeX(NSMutableString *charString,
NSCharacterSet *baseCharacterSetForTeX, NSCharacterSet *accentCharSet,
NSDictionary *texifyAccents)
{
// decompose to canonical form
- CFStringNormalize((CFMutableStringRef)charString,
kCFStringNormalizationFormD);
+ CFStringNormalize((__bridge CFMutableStringRef)charString,
kCFStringNormalizationFormD);
NSUInteger decomposedLength = [charString length];
// first check if we can convert this, we should have a base character +
an accent we know
@@ -220,12 +220,12 @@
CFAllocatorRef alloc = CFGetAllocator(charString);
// isolate accent
- NSString *accentChar = (NSString *)CFStringCreateWithSubstring(alloc,
(CFStringRef)charString, CFRangeMake(1, 1));
+ NSString *accentChar = (NSString *)CFStringCreateWithSubstring(alloc,
(__bridge CFStringRef)charString, CFRangeMake(1, 1));
NSString *accent = [texifyAccents objectForKey:accentChar];
[accentChar release];
// isolate character
- NSString *character = (NSString *)CFStringCreateWithSubstring(alloc,
(CFStringRef)charString, CFRangeMake(0, 1));
+ NSString *character = (NSString *)CFStringCreateWithSubstring(alloc,
(__bridge CFStringRef)charString, CFRangeMake(0, 1));
// handle i and j (others as well?)
if (([character isEqualToString:@"i"] || [character isEqualToString:@"j"])
&&
@@ -273,8 +273,8 @@
if (closingRange.length) {
replaceRange = NSMakeRange(range.location, closingRange.location -
range.location + 1);
- CFStringRef tmpString = CFStringCreateWithSubstring(NULL,
(CFStringRef)convertedSoFar, CFRangeMake(replaceRange.location,
replaceRange.length));
- tmpConv = [(NSString *)tmpString mutableCopy];
+ CFStringRef tmpString = CFStringCreateWithSubstring(NULL,
(__bridge CFStringRef)convertedSoFar, CFRangeMake(replaceRange.location,
replaceRange.length));
+ tmpConv = [(__bridge NSString *)tmpString mutableCopy];
CFRelease(tmpString);
// see if the dictionary has a conversion, or try Unicode
composition
@@ -318,7 +318,7 @@
CFIndex idx = 0, length = [texString length];
CFStringInlineBuffer inlineBuffer;
- CFStringInitInlineBuffer((CFStringRef)texString, &inlineBuffer,
CFRangeMake(0, length));
+ CFStringInitInlineBuffer((__bridge CFStringRef)texString, &inlineBuffer,
CFRangeMake(0, length));
// check for {\ prefix
if (CFStringGetCharacterFromInlineBuffer(&inlineBuffer, idx++) != '{' ||
@@ -354,7 +354,7 @@
if (ch == '}') {
CFAllocatorRef alloc = CFGetAllocator(texString);
- character = (NSString *)CFStringCreateWithSubstring(alloc,
(CFStringRef)texString, CFRangeMake(letterStart, idx - letterStart));
+ character = (NSString *)CFStringCreateWithSubstring(alloc,
(__bridge CFStringRef)texString, CFRangeMake(letterStart, idx - letterStart));
// special cases for old style i, j
if ([character isEqualToString:@"\\i"]) {
@@ -366,12 +366,12 @@
}
if ([character length] == 1) {
- CFMutableStringRef mutableCharacter =
CFStringCreateMutableCopy(alloc, 0, (CFStringRef)character);
- CFStringAppend(mutableCharacter, (CFStringRef)accent);
+ CFMutableStringRef mutableCharacter =
CFStringCreateMutableCopy(alloc, 0, (__bridge CFStringRef)character);
+ CFStringAppend(mutableCharacter, (__bridge CFStringRef)accent);
CFStringNormalize(mutableCharacter,
kCFStringNormalizationFormC);
if (CFStringGetLength(mutableCharacter) == 1) {
- [texString setString:(NSString *)mutableCharacter];
+ [texString setString:(__bridge NSString
*)mutableCharacter];
} else {
// if it can't be composed to a single character, we won't
be able to convert it back
[character release];
Modified: trunk/bibdesk/BDSKDOIParser.m
===================================================================
--- trunk/bibdesk/BDSKDOIParser.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKDOIParser.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -84,7 +84,7 @@
NSString *bibtexString = nil;
NSStringEncoding encoding = kCFStringEncodingInvalidId;
if (encodingName)
- encoding =
CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)encodingName));
+ encoding =
CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((__bridge
CFStringRef)encodingName));
if (encoding == kCFStringEncodingInvalidId)
encoding = NSUTF8StringEncoding;
bibtexString = [[[[NSString alloc] initWithData:data
encoding:encoding] autorelease] stringByRemovingSurroundingWhitespace];
Modified: trunk/bibdesk/BDSKErrorEditor.m
===================================================================
--- trunk/bibdesk/BDSKErrorEditor.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKErrorEditor.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -430,7 +430,7 @@
NSCharacterSet *newlineSet = [NSCharacterSet newlineCharacterSet];
NSTextStorage *textStorage = [notification object];
- CFStringRef string = (CFStringRef)[textStorage string];
+ CFStringRef string = (__bridge CFStringRef)[textStorage string];
CFIndex length;
NSRange editedRange = [textStorage editedRange];
Modified: trunk/bibdesk/BDSKMARCParser.m
===================================================================
--- trunk/bibdesk/BDSKMARCParser.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKMARCParser.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -487,7 +487,7 @@
if(range.location != NSNotFound){
NSMutableString *mutString = [string mutableCopy];
[mutString deleteCharactersInRange:NSMakeRange(start,
NSMaxRange(range) - start)];
- CFStringTrimWhitespace((CFMutableStringRef)mutString);
+ CFStringTrimWhitespace((__bridge CFMutableStringRef)mutString);
string = [mutString autorelease];
length = [string length];
}
Modified: trunk/bibdesk/BDSKMODSParser.m
===================================================================
--- trunk/bibdesk/BDSKMODSParser.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKMODSParser.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -75,7 +75,7 @@
NSString *encodingName = [marcDoc characterEncoding];
NSStringEncoding encoding = 0;
if (encodingName) {
- CFStringEncoding cfEnc =
CFStringConvertIANACharSetNameToEncoding((CFStringRef)encodingName);
+ CFStringEncoding cfEnc =
CFStringConvertIANACharSetNameToEncoding((__bridge CFStringRef)encodingName);
if (kCFStringEncodingInvalidId == cfEnc)
encoding = NSUTF8StringEncoding;
else
Modified: trunk/bibdesk/BDSKPreferenceController.m
===================================================================
--- trunk/bibdesk/BDSKPreferenceController.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/BDSKPreferenceController.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -857,7 +857,7 @@
}
CGImageRef image = [self
createSpotlightImageForIdentifiers:identifiers];
- [spotlightLayer setContents:(id)image];
+ [spotlightLayer setContents:(__bridge id)image];
CGImageRelease(image);
}
Modified: trunk/bibdesk/BDSKPubMedParser.m
===================================================================
--- trunk/bibdesk/BDSKPubMedParser.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKPubMedParser.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -196,7 +196,7 @@
if(isAuthor){
newString = [[NSString alloc] initWithFormat:@"%@ and %@",
oldString, value];
// This next step isn't strictly necessary for splitting the
names, since the name parsing will do it for us, but you still see duplicate
whitespace when editing the author field
- NSString *collapsedWhitespaceString = (NSString
*)BDStringCreateByCollapsingAndTrimmingCharactersInSet(NULL,
(CFStringRef)newString, (CFCharacterSetRef)[NSCharacterSet
whitespaceCharacterSet]);
+ NSString *collapsedWhitespaceString = (NSString
*)BDStringCreateByCollapsingAndTrimmingCharactersInSet(NULL, (__bridge
CFStringRef)newString, (__bridge CFCharacterSetRef)[NSCharacterSet
whitespaceCharacterSet]);
[newString release];
newString = collapsedWhitespaceString;
} else if(([key isSingleValuedField] || [key isURLField]) && [key
isEqualToString:BDSKAddressString] == NO) {
Modified: trunk/bibdesk/BDSKRISParser.m
===================================================================
--- trunk/bibdesk/BDSKRISParser.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKRISParser.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -177,7 +177,7 @@
}else{
newString = [[NSString alloc]
initWithFormat:@"%@ and %@", oldString, value];
// This next step isn't strictly necessary for splitting the
names, since the name parsing will do it for us, but you still see duplicate
whitespace when editing the author field
- NSString *collapsedWhitespaceString = (NSString
*)BDStringCreateByCollapsingAndTrimmingCharactersInSet(NULL,
(CFStringRef)newString, (CFCharacterSetRef)[NSCharacterSet
whitespaceCharacterSet]);
+ NSString *collapsedWhitespaceString = (NSString
*)BDStringCreateByCollapsingAndTrimmingCharactersInSet(NULL, (__bridge
CFStringRef)newString, (__bridge CFCharacterSetRef)[NSCharacterSet
whitespaceCharacterSet]);
[newString release];
newString = collapsedWhitespaceString;
}
Modified: trunk/bibdesk/BDSKReferParser.m
===================================================================
--- trunk/bibdesk/BDSKReferParser.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKReferParser.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -101,7 +101,7 @@
if (isAuthor) {
newString = [[NSString alloc] initWithFormat:@"%@ and %@",
oldString, value];
// This next step isn't strictly necessary for splitting the
names, since the name parsing will do it for us, but you still see duplicate
whitespace when editing the author field
- NSString *collapsedWhitespaceString = (NSString
*)BDStringCreateByCollapsingAndTrimmingCharactersInSet(NULL,
(CFStringRef)newString, (CFCharacterSetRef)[NSCharacterSet
whitespaceCharacterSet]);
+ NSString *collapsedWhitespaceString = (NSString
*)BDStringCreateByCollapsingAndTrimmingCharactersInSet(NULL, (__bridge
CFStringRef)newString, (__bridge CFCharacterSetRef)[NSCharacterSet
whitespaceCharacterSet]);
[newString release];
newString = collapsedWhitespaceString;
} else if(([key isSingleValuedField] || [key isURLField]) && [key
isEqualToString:BDSKAddressString] == NO) {
Modified: trunk/bibdesk/BDSKSciFinderParser.m
===================================================================
--- trunk/bibdesk/BDSKSciFinderParser.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKSciFinderParser.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -55,11 +55,11 @@
NSRange r = [line rangeOfString:@":"];
NSUInteger len = [line length];
if (r.location != NSNotFound && (r.location + 1) < len) {
- CFAllocatorRef alloc = CFGetAllocator((CFStringRef)line);
- *key = (id)CFStringCreateWithSubstring(alloc, (CFStringRef)line,
CFRangeMake(0, r.location));
+ CFAllocatorRef alloc = CFGetAllocator((__bridge CFStringRef)line);
+ *key = (id)CFStringCreateWithSubstring(alloc, (__bridge
CFStringRef)line, CFRangeMake(0, r.location));
// advance range past the ":"
r.location += 1;
- *value = (id)CFStringCreateWithSubstring(alloc, (CFStringRef)line,
CFRangeMake(r.location, len - r.location));
+ *value = (id)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)
Modified: trunk/bibdesk/BDSKScriptMenu.m
===================================================================
--- trunk/bibdesk/BDSKScriptMenu.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKScriptMenu.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -86,7 +86,7 @@
}
static NSArray *scriptFolderPaths() {
- NSString *appSupportDirectory = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey];
+ NSString *appSupportDirectory = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey];
NSMutableArray *paths = [NSMutableArray array];
for (NSString *library in
NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,
NSAllDomainsMask, YES))
@@ -96,7 +96,7 @@
}
static void fsevents_callback(FSEventStreamRef streamRef, void
*clientCallBackInfo, int numEvents, const char *const eventPaths[], const
FSEventStreamEventFlags *eventMasks, const uint64_t *eventIDs) {
- [(id)clientCallBackInfo setMenuNeedsUpdate:YES];
+ [(__bridge id)clientCallBackInfo setMenuNeedsUpdate:YES];
}
- (void)handleApplicationWillTerminateNotification:(NSNotification
*)notification {
@@ -141,7 +141,7 @@
streamRef = FSEventStreamCreate(kCFAllocatorDefault,
(FSEventStreamCallback)&fsevents_callback, // callback
&context, // context
- (CFArrayRef)scriptFolders, //
pathsToWatch
+ (__bridge
CFArrayRef)scriptFolders, // pathsToWatch
kFSEventStreamEventIdSinceNow,
// sinceWhen
1.0, // latency
kFSEventStreamCreateFlagWatchRoot); // flags
Modified: trunk/bibdesk/BDSKSoapBinding.m
===================================================================
--- trunk/bibdesk/BDSKSoapBinding.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BDSKSoapBinding.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -100,7 +100,7 @@
NSMutableURLRequest *request = [NSMutableURLRequest
requestWithURL:self.address
cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
timeoutInterval:self.defaultTimeout];
NSData *bodyData = [outputBody dataUsingEncoding:NSUTF8StringEncoding];
NSBundle *bundle = [NSBundle mainBundle];
- NSString *userAgent = [NSString stringWithFormat:@"%@/%@", [bundle
objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey], [bundle
objectForInfoDictionaryKey:@"CFBundleShortVersionString"]];
+ NSString *userAgent = [NSString stringWithFormat:@"%@/%@", [bundle
objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey], [bundle
objectForInfoDictionaryKey:@"CFBundleShortVersionString"]];
if(cookies != nil) {
[request setAllHTTPHeaderFields:[NSHTTPCookie
requestHeaderFieldsWithCookies:cookies]];
Modified: trunk/bibdesk/BDSKWebOfScienceParser.m
===================================================================
--- trunk/bibdesk/BDSKWebOfScienceParser.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/BDSKWebOfScienceParser.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -127,7 +127,7 @@
// use CF so we can transform it in place
CFLocaleRef locale = CFLocaleCopyCurrent();
- CFStringCapitalize((CFMutableStringRef)mutableDateStr, locale);
+ CFStringCapitalize((__bridge CFMutableStringRef)mutableDateStr,
locale);
CFRelease(locale);
[pubDict setObject:mutableDateStr forKey:BDSKMonthString];
Modified: trunk/bibdesk/BibDocument_Groups.m
===================================================================
--- trunk/bibdesk/BibDocument_Groups.m 2024-01-02 00:29:30 UTC (rev 28510)
+++ trunk/bibdesk/BibDocument_Groups.m 2024-01-02 16:03:03 UTC (rev 28511)
@@ -486,7 +486,7 @@
if([tmpSet count]) {
for (id object in tmpSet) {
[hashTable addObject:object];
- CFBagAddValue(bag, object);
+ CFBagAddValue(bag, (__bridge void *)object);
}
} else {
emptyCount++;
@@ -506,7 +506,7 @@
[group retain];
else
group = [[BDSKCategoryGroup alloc] initWithName:groupName
key:groupField];
- [group setCount:CFBagGetCountOfValue(bag, groupName)];
+ [group setCount:CFBagGetCountOfValue(bag, (__bridge void *)groupName)];
[mutableGroups addObject:group];
[group release];
}
Modified: trunk/bibdesk/NSAttributedString_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSAttributedString_BDSKExtensions.m 2024-01-02 00:29:30 UTC
(rev 28510)
+++ trunk/bibdesk/NSAttributedString_BDSKExtensions.m 2024-01-02 16:03:03 UTC
(rev 28511)
@@ -68,7 +68,7 @@
while( (cmdRange = [mutableString
rangeOfTeXCommandInRange:searchRange]).location != NSNotFound){
// copy the command
- texStyle = (NSString *)CFStringCreateWithSubstring(alloc,
(CFStringRef)mutableString, CFRangeMake(cmdRange.location, cmdRange.length));
+ texStyle = (NSString *)CFStringCreateWithSubstring(alloc, (__bridge
CFStringRef)mutableString, CFRangeMake(cmdRange.location, cmdRange.length));
// delete the command, now that we know what it was
[mutableString deleteCharactersInRange:cmdRange];
Modified: trunk/bibdesk/NSData_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSData_BDSKExtensions.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/NSData_BDSKExtensions.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -455,12 +455,12 @@
CFDataRef data = nil;
// try this first; generally locale-specific, but it's really fast if it
works
- const char *cstringPtr = CFStringGetCStringPtr((CFStringRef)string,
cfEncoding);
+ const char *cstringPtr = CFStringGetCStringPtr((__bridge
CFStringRef)string, cfEncoding);
if (cstringPtr) {
// Omni uses strlen, but it returns incorrect length for some strings
with strange Unicode characters (bug #1558548)
- CFIndex length = CFStringGetLength((CFStringRef)string);
+ CFIndex length = CFStringGetLength((__bridge CFStringRef)string);
CFIndex bufLen;
- CFIndex convertedLength = CFStringGetBytes((CFStringRef)string,
CFRangeMake(0, length), cfEncoding, 0, FALSE, NULL, INT_MAX, &bufLen);
+ CFIndex convertedLength = CFStringGetBytes((__bridge
CFStringRef)string, CFRangeMake(0, length), cfEncoding, 0, FALSE, NULL,
INT_MAX, &bufLen);
if (convertedLength != length){
if(error != NULL){
*error = [NSError
mutableLocalErrorWithCode:kBDSKStringEncodingError
localizedDescription:[NSString stringWithFormat:NSLocalizedString(@"Unable to
convert string to encoding %@", @"Error description"), [NSString
localizedNameOfStringEncoding:encoding]]];
@@ -469,8 +469,8 @@
return NO;
}
[self appendBytes:cstringPtr length:bufLen];
- } else if(data =
CFStringCreateExternalRepresentation(CFAllocatorGetDefault(),
(CFStringRef)string, cfEncoding, 0)){
- [self appendData:(NSData *)data];
+ } else if(data =
CFStringCreateExternalRepresentation(CFAllocatorGetDefault(), (__bridge
CFStringRef)string, cfEncoding, 0)){
+ [self appendData:(__bridge NSData *)data];
CFRelease(data);
}else if([string canBeConvertedToEncoding:encoding]){
// sometimes CFStringCreateExternalRepresentationreturns NULL even
though the string can be converted
Modified: trunk/bibdesk/NSFileManager_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSFileManager_BDSKExtensions.m 2024-01-02 00:29:30 UTC
(rev 28510)
+++ trunk/bibdesk/NSFileManager_BDSKExtensions.m 2024-01-02 16:03:03 UTC
(rev 28511)
@@ -94,7 +94,7 @@
if(applicationSupportDirectoryURL == nil){
NSString *path =
[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,
NSUserDomainMask, YES) firstObject];
- NSString *appName = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey];
+ NSString *appName = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey];
if(appName == nil)
[NSException raise:NSObjectNotAvailableException
format:NSLocalizedString(@"Unable to find CFBundleIdentifier for %@",
@"Exception message"), [NSApp description]];
@@ -147,7 +147,7 @@
if (noErr == FSFindFolder(kUserDomain, kChewableItemsFolderType, TRUE,
&chewableRef)) {
NSURL *chewableURL = (NSURL
*)CFURLCreateFromFSRef(kCFAllocatorDefault, &chewableRef);
#pragma clang diagnostic pop
- NSString *appName = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey];
+ NSString *appName = [[NSBundle mainBundle]
objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey];
chewableItemsFolderURL = [[chewableURL
URLByAppendingPathComponent:appName isDirectory:YES] copy];
if ([chewableItemsFolderURL
checkResourceIsReachableAndReturnError:NULL] == NO)
[self createDirectoryAtPath:[chewableItemsFolderURL path]
withIntermediateDirectories:NO attributes:nil error:NULL];
@@ -425,7 +425,7 @@
nsEncoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding);
}
else if ([array count] > 0) {
- CFStringRef name = (CFStringRef)[array objectAtIndex:0];
+ CFStringRef name = (__bridge CFStringRef)[array objectAtIndex:0];
CFStringEncoding cfEncoding =
CFStringConvertIANACharSetNameToEncoding(name);
nsEncoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding);
}
Modified: trunk/bibdesk/NSImage_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSImage_BDSKExtensions.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/NSImage_BDSKExtensions.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -145,7 +145,7 @@
CGPDFContextEndPage(context);
CGPDFContextClose(context);
CGContextRelease(context);
- self = [self initWithData:(NSData *)pdfData];
+ self = [self initWithData:(__bridge NSData *)pdfData];
CFRelease(pdfData);
} else {
self = [self initWithSize:size];
Modified: trunk/bibdesk/NSMenu_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSMenu_BDSKExtensions.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/NSMenu_BDSKExtensions.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -200,7 +200,7 @@
Boolean result = false;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- if (CFURLGetFSRef((CFURLRef)fileURL, &fileRef)) {
+ if (CFURLGetFSRef((__bridge CFURLRef)fileURL, &fileRef)) {
FSDetermineIfRefIsEnclosedByFolder(0, kApplicationsFolderType,
&fileRef, &result);
if (result == false)
FSDetermineIfRefIsEnclosedByFolder(0, kSystemFolderType, &fileRef,
&result);
Modified: trunk/bibdesk/NSPasteboard_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSPasteboard_BDSKExtensions.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/NSPasteboard_BDSKExtensions.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -191,7 +191,7 @@
pasteLocationURL = [NSURL URLWithString:pasteLocation];
} else {
PasteboardRef pboardRef = NULL;
- if (noErr == PasteboardCreate((CFStringRef)[self name], &pboardRef)) {
+ if (noErr == PasteboardCreate((__bridge CFStringRef)[self name],
&pboardRef)) {
PasteboardSynchronize(pboardRef);
CFURLRef urlRef = NULL;
if (noErr == PasteboardCopyPasteLocation(pboardRef, &urlRef))
Modified: trunk/bibdesk/NSPointerFunctions_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSPointerFunctions_BDSKExtensions.m 2024-01-02 00:29:30 UTC
(rev 28510)
+++ trunk/bibdesk/NSPointerFunctions_BDSKExtensions.m 2024-01-02 16:03:03 UTC
(rev 28511)
@@ -74,33 +74,33 @@
static NSUInteger BibAuthorFuzzyHash(const void *item, NSUInteger
(*size)(const void *item))
{
- BDSKASSERT([(id)item isKindOfClass:[BibAuthor class]]);
- return [(BibAuthor *)item fuzzyHash];
+ BDSKASSERT([(__bridge id)item isKindOfClass:[BibAuthor class]]);
+ return [(__bridge BibAuthor *)item fuzzyHash];
}
static BOOL BibAuthorFuzzyEqual(const void *value1, const void *value2,
NSUInteger (*size)(const void *item))
{
- BDSKASSERT([(id)value1 isKindOfClass:[BibAuthor class]] && [(id)value2
isKindOfClass:[BibAuthor class]]);
- return [(BibAuthor *)value1 fuzzyEqual:(BibAuthor *)value2];
+ BDSKASSERT([(__bridge id)value1 isKindOfClass:[BibAuthor class]] &&
[(__bridge id)value2 isKindOfClass:[BibAuthor class]]);
+ return [(__bridge BibAuthor *)value1 fuzzyEqual:(__bridge BibAuthor
*)value2];
}
static NSUInteger BibItemEqualityHash(const void *item, NSUInteger
(*size)(const void *item))
{
- BDSKASSERT([(id)item isKindOfClass:[BibItem class]]);
- return BDCaseInsensitiveStringHash([(BibItem *)item citeKey]);
+ BDSKASSERT([(__bridge id)item isKindOfClass:[BibItem class]]);
+ return BDCaseInsensitiveStringHash([(__bridge BibItem *)item citeKey]);
}
static BOOL BibItemEqual(const void *value1, const void *value2, NSUInteger
(*size)(const void *item))
{
- BDSKASSERT([(id)value1 isKindOfClass:[BibItem class]] && [(id)value2
isKindOfClass:[BibItem class]]);
- return ([(BibItem *)value1 isEqualToItem:(BibItem *)value2]);
+ BDSKASSERT([(__bridge id)value1 isKindOfClass:[BibItem class]] &&
[(__bridge id)value2 isKindOfClass:[BibItem class]]);
+ return ([(__bridge BibItem *)value1 isEqualToItem:(__bridge BibItem
*)value2]);
}
static NSUInteger BibItemEquivalenceHash(const void *item, NSUInteger
(*size)(const void *item))
{
- BDSKASSERT([(id)item isKindOfClass:[BibItem class]]);
+ BDSKASSERT([(__bridge id)item isKindOfClass:[BibItem class]]);
- NSString *type = [(BibItem *)item pubType] ?: @"";
+ NSString *type = [(__bridge BibItem *)item pubType] ?: @"";
CFHashCode hash = BDCaseInsensitiveStringHash(type);
NSUInteger prime = 31;
NSUInteger factor = 1;
@@ -113,7 +113,7 @@
[keys removeObject:BDSKLocalUrlString];
for (NSString *key in keys) {
factor *= prime;
- hash += factor * [[(BibItem *)item stringValueOfField:key inherit:NO]
?: @"" hash];
+ hash += factor * [[(__bridge BibItem *)item stringValueOfField:key
inherit:NO] ?: @"" hash];
}
[keys release];
@@ -122,8 +122,8 @@
static BOOL BibItemEquivalent(const void *value1, const void *value2,
NSUInteger (*size)(const void *item))
{
- BDSKASSERT([(id)value1 isKindOfClass:[BibItem class]] && [(id)value2
isKindOfClass:[BibItem class]]);
- return ([(BibItem *)value1 isEquivalentToItem:(BibItem *)value2]);
+ BDSKASSERT([(__bridge id)value1 isKindOfClass:[BibItem class]] &&
[(__bridge id)value2 isKindOfClass:[BibItem class]]);
+ return ([(__bridge BibItem *)value1 isEquivalentToItem:(BibItem *)value2]);
}
@implementation NSPointerFunctions (BDSKExtensions)
Modified: trunk/bibdesk/NSScanner_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSScanner_BDSKExtensions.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/NSScanner_BDSKExtensions.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -118,7 +118,7 @@
else // or should we raise an exception?
[tmpString appendFormat:@"%C", ch];
} else if (ch == '"') {
- CFStringTrimWhitespace((CFMutableStringRef)tmpString);
+ CFStringTrimWhitespace((__bridge CFMutableStringRef)tmpString);
tmpObject = tmpString;
break;
}
Modified: trunk/bibdesk/NSURL_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSURL_BDSKExtensions.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/NSURL_BDSKExtensions.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -54,7 +54,7 @@
- (NSURL *)fileURLByResolvingAliasesStrictly:(BOOL)strict {
NSCParameterAssert([self isFileURL]);
- CFURLRef fileURL = (CFURLRef)self;
+ CFURLRef fileURL = (__bridge CFURLRef)self;
CFAllocatorRef allocator = CFGetAllocator(self);
// make sure we have a file path URL, make sure we have ownership
@@ -119,7 +119,7 @@
if (isSymLink) {
oldURL = fileURL;
- fileURL = (CFURLRef)[[(NSURL *)fileURL
URLByResolvingSymlinksInPath] retain];
+ fileURL = (CFURLRef)[[(__bridge NSURL *)fileURL
URLByResolvingSymlinksInPath] retain];
// avoid being stuck in a loop when the symlink does not resolve
didResolve = fileURL != NULL && FALSE == CFEqual(fileURL, oldURL);
CFRelease(oldURL);
@@ -186,13 +186,13 @@
NSURLBookmarkResolutionOptions options = allowUI ? 0 :
NSURLBookmarkResolutionWithoutUI | NSURLBookmarkResolutionWithoutMounting;
fileURL = [[NSURL URLByResolvingBookmarkData:bmData options:options
relativeToURL:nil bookmarkDataIsStale:NULL error:NULL] filePathURL];
} else if ([aliasData length]) {
- CFIndex len = CFDataGetLength((CFDataRef)aliasData);
+ CFIndex len = CFDataGetLength((__bridge CFDataRef)aliasData);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
Handle handle = NewHandle(len);
if (handle != NULL && len > 0) {
HLock(handle);
- memmove((void *)*handle, (const void
*)CFDataGetBytePtr((CFDataRef)aliasData), len);
+ memmove((void *)*handle, (const void *)CFDataGetBytePtr((__bridge
CFDataRef)aliasData), len);
HUnlock(handle);
FSRef fileRef;
Boolean wasChanged;
@@ -219,7 +219,7 @@
FSRef fileRef;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- if (CFURLGetFSRef((CFURLRef)self, &fileRef))
+ if (CFURLGetFSRef((__bridge CFURLRef)self, &fileRef))
FSNewAlias(NULL, &fileRef, &aliasHandle);
if (aliasHandle) {
Handle handle = (Handle)aliasHandle;
@@ -273,7 +273,7 @@
// @@ Deprecated API
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- CFNetDiagnosticRef diagnostic =
CFNetDiagnosticCreateWithURL(kCFAllocatorDefault, (CFURLRef)self);
+ CFNetDiagnosticRef diagnostic =
CFNetDiagnosticCreateWithURL(kCFAllocatorDefault, (__bridge CFURLRef)self);
NSString *details;
CFNetDiagnosticStatus status =
CFNetDiagnosticCopyNetworkStatusPassively(diagnostic, (CFStringRef *)&details);
Modified: trunk/bibdesk/NSWorkspace_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSWorkspace_BDSKExtensions.m 2024-01-02 00:29:30 UTC (rev
28510)
+++ trunk/bibdesk/NSWorkspace_BDSKExtensions.m 2024-01-02 16:03:03 UTC (rev
28511)
@@ -185,7 +185,7 @@
{
NSParameterAssert(aURL);
- NSArray *applications = (NSArray
*)LSCopyApplicationURLsForURL((CFURLRef)aURL, kLSRolesEditor | kLSRolesViewer);
+ NSArray *applications = (NSArray *)LSCopyApplicationURLsForURL((__bridge
CFURLRef)aURL, kLSRolesEditor | kLSRolesViewer);
if(nil != applications){
// LS seems to return duplicates (same full path), so we'll remove
those to avoid confusion
@@ -206,7 +206,7 @@
{
NSParameterAssert(fileType);
- NSArray *bundleIDs = (NSArray
*)LSCopyAllRoleHandlersForContentType((CFStringRef)fileType, kLSRolesEditor |
kLSRolesViewer);
+ NSArray *bundleIDs = (NSArray
*)LSCopyAllRoleHandlersForContentType((__bridge CFStringRef)fileType,
kLSRolesEditor | kLSRolesViewer);
NSMutableSet *set = [[NSMutableSet alloc] init];
NSMutableArray *applications = [NSMutableArray array];
@@ -381,7 +381,7 @@
- (BOOL)isEqualToUTI:(NSString *)UTIString;
{
- return (UTIString == nil || UTTypeEqual((CFStringRef)self,
(CFStringRef)UTIString) == FALSE) ? NO : YES;
+ return (UTIString == nil || UTTypeEqual((__bridge CFStringRef)self,
(__bridge CFStringRef)UTIString) == FALSE) ? NO : YES;
}
@end
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