diff options
author | Sven Weidauer <sven@5sw.de> | 2017-06-05 10:47:34 +0200 |
---|---|---|
committer | Sven Weidauer <sven@5sw.de> | 2017-06-05 10:51:19 +0200 |
commit | 3ee40a10b123c36be3e29602767840a7a71aaafa (patch) | |
tree | 64123d0bf6a6cf5a5a4c1fd8349756db68e09483 /frontends/cocoa/fetch.m | |
parent | ce4e059ea67cee7f35b4b810a4387f343fa74650 (diff) | |
download | netsurf-3ee40a10b123c36be3e29602767840a7a71aaafa.tar.gz netsurf-3ee40a10b123c36be3e29602767840a7a71aaafa.tar.bz2 |
Fix up cocoa frontend.
- Convert to ARC
- Fix crash due to endless responder chain recursion
- Update makefile to find openssl installed via home-brew
- Fix most compiler warnings
Diffstat (limited to 'frontends/cocoa/fetch.m')
-rw-r--r-- | frontends/cocoa/fetch.m | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/frontends/cocoa/fetch.m b/frontends/cocoa/fetch.m index 0bbce09f6..8760d68e3 100644 --- a/frontends/cocoa/fetch.m +++ b/frontends/cocoa/fetch.m @@ -27,8 +27,8 @@ static char cocoafiletype[200]; static const struct mimemap_s { - const char const *extension; - const char const *mimetype; + const char * const extension; + const char * const mimetype; } cocoamimemap[] = { { "css", "text/css" }, { "f79", "text/css" }, @@ -52,7 +52,7 @@ static const char *fetch_filetype(const char *unix_path) uti = [[NSWorkspace sharedWorkspace] typeOfFile: [NSString stringWithUTF8String: unix_path] error:&utiError]; if (nil != uti) { LOG("Looking for mimetype from uti \"%s\"", [uti UTF8String] ); - mimeType = (NSString *)UTTypeCopyPreferredTagWithClass( (CFStringRef)uti, kUTTagClassMIMEType ); + mimeType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass( (__bridge CFStringRef)uti, kUTTagClassMIMEType ); } else { NSAlert *utiAlert = [NSAlert alertWithError:utiError]; [utiAlert runModal]; // Ignore return value. @@ -65,13 +65,12 @@ static const char *fetch_filetype(const char *unix_path) if (nil != mimeType) { strncpy(cocoafiletype, [mimeType UTF8String], sizeof(cocoafiletype)); - [mimeType release]; } else { const char *extension; LOG("mimetype from uti failed"); - extension = [(NSString *)UTTypeCopyPreferredTagWithClass( (CFStringRef)uti, kUTTagClassFilenameExtension) UTF8String]; + extension = [(__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass( (__bridge CFStringRef)uti, kUTTagClassFilenameExtension) UTF8String]; if (extension == NULL) { /* give up and go with default */ |