aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-03-02 02:25:08 +0000
committerrowanbeentje <rowan@beent.je>2011-03-02 02:25:08 +0000
commit4422810afa93d3cbce76812cc50e45ef8634180b (patch)
tree0d7cf391cdf495a6bef8c6970407e2e081c9d877 /Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
parent64919b03fa59c8d93c81a8e3893934c04a3cac91 (diff)
downloadsequelpro-4422810afa93d3cbce76812cc50e45ef8634180b.tar.gz
sequelpro-4422810afa93d3cbce76812cc50e45ef8634180b.tar.bz2
sequelpro-4422810afa93d3cbce76812cc50e45ef8634180b.zip
- Fix compiler warnings for MCPKit - largely typecast related
- Fix further compiler warnings, including a couple of bugs - Disable the -wselector warnings (Multiple definition types for selector) as they're currently unsupported in LLVM - Disable the -wconversion warnings (Prototype conversion) warnings as we usually can't affect protocol declaration - Disable the -wstrict-selector-match (Strict selector matching) due to too many false positives
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m')
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m16
1 files changed, 8 insertions, 8 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
index c15db6c6..465221fe 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
@@ -164,7 +164,7 @@ void _bytes2bin(Byte *n, NSUInteger nbytes, NSUInteger len, char *buf);
MYSQL_ROW theRow;
char *theRowData, *buf;
unsigned long *fieldLengths;
- NSInteger i, copiedDataLength;
+ NSUInteger i, copiedDataLength;
NSMutableArray *returnArray;
// Retrieve the next row according to the mode this result set is in.
@@ -290,7 +290,7 @@ void _bytes2bin(Byte *n, NSUInteger nbytes, NSUInteger len, char *buf);
// Get a binary representation of the data
buf = malloc(fieldDefinitions[i].length + 1);
- _bytes2bin(theData, fieldLengths[i], fieldDefinitions[i].length, buf);
+ _bytes2bin((Byte *)theData, fieldLengths[i], fieldDefinitions[i].length, buf);
cellData = (theData != NULL) ? [NSString stringWithUTF8String:buf] : @"";
@@ -323,7 +323,7 @@ void _bytes2bin(Byte *n, NSUInteger nbytes, NSUInteger len, char *buf);
break;
default:
- NSLog(@"in fetchNextRowAsArray : Unknown type : %ld for column %ld, sending back a NSData object", (NSInteger)fieldDefinitions[i].type, (NSInteger)i);
+ NSLog(@"in fetchNextRowAsArray : Unknown type : %d for column %lu, sending back a NSData object", (int)fieldDefinitions[i].type, (unsigned long)i);
cellData = [NSData dataWithBytes:theData length:fieldLengths[i]];
break;
}
@@ -435,10 +435,10 @@ void _bytes2bin(Byte *n, NSUInteger nbytes, NSUInteger len, char *buf);
void _bytes2bin(Byte *n, NSUInteger nbytes, NSUInteger len, char *buf)
{
- int i = 0;
+ NSUInteger i = 0;
nbytes--;
- while (i < len)
- buf[len - ++i] = ( (n[nbytes - (i >> 3)] >> (i & 0x7)) & 1 ) ? '1' : '0';
+ while (++i <= len)
+ buf[len - i] = ( (n[nbytes - (i >> 3)] >> (i & 0x7)) & 1 ) ? '1' : '0';
buf[len] = '\0';
}
@@ -451,14 +451,14 @@ void _bytes2bin(Byte *n, NSUInteger nbytes, NSUInteger len, char *buf)
NSAutoreleasePool *downloadPool = [[NSAutoreleasePool alloc] init];
MYSQL_ROW theRow;
unsigned long *fieldLengths;
- NSInteger i, dataCopiedLength, rowDataLength;
+ NSUInteger i, dataCopiedLength, rowDataLength;
LOCAL_ROW_DATA *newRowStore;
size_t sizeOfLocalRowData = sizeof(LOCAL_ROW_DATA);
size_t sizeOfDataLengths = (size_t)(sizeof(unsigned long) * mNumOfFields);
// Loop through the rows until the end of the data is reached - indicated via a NULL
- while ( (BOOL)(*isConnectedPtr)(parentConnection, isConnectedSEL) && (theRow = mysql_fetch_row(mResult))) {
+ while ((*isConnectedPtr)(parentConnection, isConnectedSEL) && (theRow = mysql_fetch_row(mResult))) {
// Retrieve the lengths of the returned data
fieldLengths = mysql_fetch_lengths(mResult);