Skip to content

Commit

Permalink
Merge pull request #14 from naan/FixCompilerWarning
Browse files Browse the repository at this point in the history
Remove compiler warning
  • Loading branch information
rsms committed Mar 14, 2015
2 parents 789a3cd + 26f7fdf commit 0d1e580
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions peertalk/PTProtocol.m
Expand Up @@ -350,6 +350,9 @@ - (void)dealloc {

@implementation NSData (PTProtocol)

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-getter-return-value"

- (dispatch_data_t)createReferencingDispatchData {
// Note: The queue is used to submit the destructor. Since we only perform an
// atomic release of self, it doesn't really matter which queue is used, thus
Expand All @@ -360,6 +363,8 @@ - (dispatch_data_t)createReferencingDispatchData {
});
}

#pragma clang diagnostic pop

+ (NSData *)dataWithContentsOfDispatchData:(dispatch_data_t)data {
if (!data) {
return nil;
Expand Down
3 changes: 3 additions & 0 deletions peertalk/PTUSBHub.m
Expand Up @@ -589,6 +589,8 @@ - (void)sendDispatchData:(dispatch_data_t)data callback:(void(^)(NSError*))callb
#endif
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-getter-return-value"

- (void)sendData:(NSData*)data callback:(void(^)(NSError*))callback {
dispatch_data_t ddata = dispatch_data_create((const void*)data.bytes, data.length, queue_, ^{
Expand All @@ -598,6 +600,7 @@ - (void)sendData:(NSData*)data callback:(void(^)(NSError*))callback {
[self sendDispatchData:ddata callback:callback];
}

#pragma clang diagnostic pop

- (void)readFromOffset:(off_t)offset length:(size_t)length callback:(void(^)(NSError *error, dispatch_data_t data))callback {
dispatch_io_read(channel_, offset, length, queue_, ^(bool done, dispatch_data_t data, int _errno) {
Expand Down

0 comments on commit 0d1e580

Please sign in to comment.