pokeb/asi-http-request — pull request #342 by jweyrich (2012-08-20 18:27:05+00:00)
Title: Fix warnings when compiling with some -W options.

Some people (like me) have a need to enable a few extra warnings that are not enabled by default. Many projects even enforce some of these warnings flags.

The two commits in thus pull request avoid (or fix, if you will) a bunch of warnings caused by both `-Wno-implicit-atomic-properties` and `-Wsign-conversion`.

Commit 9ee1ff3 also adds an extra condition (and changes another) to check whether an `NSInputStream` did fail a read operation.

+ NSInteger bytesRead = [stream read:buffer maxLength:sizeof(buffer)];
if (bytesRead == 0) {
+ // 0 indicates that the end of the buffer was reached.
+ break;
+ } else if (bytesRead < 0) {
+ // A negative number means that the operation failed.
break;
}

and

NSInteger len = [(NSInputStream *)stream read:buf maxLength:16384];
- if (len) {
- [[self PACFileData] appendBytes:(const void *)buf length:len];
+ // Append only if something was actually read.
+ if (len > 0) {
+ [[self PACFileData] appendBytes:(const void *)buf length:(NSUInteger)len];
}

Thank you for sharing this great project! :)