Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add explicit return types to some blocks.

Trying to get everything to compile on clang 4. These blocks sometimes
return nil, so we have to declare the return type as nil is considered a
void * and the compiler doesn't want to infer the return type as a
result.
  • Loading branch information...
commit 5f8dd18c49ab95d1e6f731bdde5764d813bab2c8 1 parent 8d439fb
@Shadowfiend Shadowfiend authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 app/ViSFTPURLHandler.m
View
18 app/ViSFTPURLHandler.m
@@ -49,7 +49,7 @@ - (NSString *)stringByAbbreviatingWithTildeInPath:(NSURL *)aURL
{
DEBUG(@"url = %@", aURL);
- return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL onConnect:^(SFTPConnection *conn, NSError *error) {
+ return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL onConnect:^SFTPRequest *(SFTPConnection *conn, NSError *error) {
if (!error)
return [conn attributesOfItemAtURL:aURL onResponse:aBlock];
aBlock(nil, nil, error);
@@ -62,7 +62,7 @@ - (NSString *)stringByAbbreviatingWithTildeInPath:(NSURL *)aURL
{
DEBUG(@"url = %@", aURL);
- return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL onConnect:^(SFTPConnection *conn, NSError *error) {
+ return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL onConnect:^SFTPRequest *(SFTPConnection *conn, NSError *error) {
if (!error)
return [conn fileExistsAtURL:aURL onResponse:aBlock];
aBlock(nil, NO, error);
@@ -75,7 +75,7 @@ - (NSString *)stringByAbbreviatingWithTildeInPath:(NSURL *)aURL
{
DEBUG(@"url = %@", aURL);
- return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL onConnect:^(SFTPConnection *conn, NSError *error) {
+ return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL onConnect:^SFTPRequest *(SFTPConnection *conn, NSError *error) {
if (!error)
return [conn contentsOfDirectoryAtURL:aURL onResponse:aBlock];
aBlock(nil, error);
@@ -88,7 +88,7 @@ - (NSString *)stringByAbbreviatingWithTildeInPath:(NSURL *)aURL
{
DEBUG(@"url = %@", aURL);
- return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL onConnect:^(SFTPConnection *conn, NSError *error) {
+ return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL onConnect:^SFTPRequest *(SFTPConnection *conn, NSError *error) {
if (!error)
return [conn createDirectory:[aURL path] onResponse:aBlock];
aBlock(error);
@@ -103,7 +103,7 @@ - (NSString *)stringByAbbreviatingWithTildeInPath:(NSURL *)aURL
DEBUG(@"%@ -> %@", srcURL, dstURL);
return [[SFTPConnectionPool sharedPool] connectionWithURL:srcURL
- onConnect:^(SFTPConnection *conn, NSError *error) {
+ onConnect:^SFTPRequest *(SFTPConnection *conn, NSError *error) {
if (!error)
return [conn moveItemAtURL:srcURL
toURL:dstURL
@@ -119,7 +119,7 @@ - (NSString *)stringByAbbreviatingWithTildeInPath:(NSURL *)aURL
DEBUG(@"url = %@", aURL);
return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL
- onConnect:^(SFTPConnection *conn, NSError *error) {
+ onConnect:^SFTPRequest *(SFTPConnection *conn, NSError *error) {
if (!error)
return [conn removeItemAtPath:[aURL path] onResponse:aBlock];
aBlock(error);
@@ -131,7 +131,7 @@ - (NSString *)stringByAbbreviatingWithTildeInPath:(NSURL *)aURL
onCompletion:(void (^)(NSError *))aBlock
{
return [[SFTPConnectionPool sharedPool] connectionWithURL:[urls objectAtIndex:0]
- onConnect:^(SFTPConnection *conn, NSError *error) {
+ onConnect:^SFTPRequest *(SFTPConnection *conn, NSError *error) {
if (!error)
return [conn removeItemsAtURLs:urls onResponse:aBlock];
aBlock(error);
@@ -146,7 +146,7 @@ - (NSString *)stringByAbbreviatingWithTildeInPath:(NSURL *)aURL
DEBUG(@"url = %@", aURL);
return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL
- onConnect:^(SFTPConnection *conn, NSError *error) {
+ onConnect:^SFTPRequest *(SFTPConnection *conn, NSError *error) {
if (!error)
return [conn dataWithContentsOfURL:aURL
onData:dataCallback
@@ -163,7 +163,7 @@ - (NSString *)stringByAbbreviatingWithTildeInPath:(NSURL *)aURL
DEBUG(@"url = %@", aURL);
return [[SFTPConnectionPool sharedPool] connectionWithURL:aURL
- onConnect:^(SFTPConnection *conn, NSError *error) {
+ onConnect:^SFTPRequest *(SFTPConnection *conn, NSError *error) {
if (!error)
return [conn writeDataSafely:data toURL:aURL onResponse:aBlock];
aBlock(nil, nil, error);
Please sign in to comment.
Something went wrong with that request. Please try again.