[65314] users/toby/objcports/MPIndex.m

toby at macports.org toby at macports.org
Wed Mar 24 21:40:39 PDT 2010


Revision: 65314
          http://trac.macports.org/changeset/65314
Author:   toby at macports.org
Date:     2010-03-24 21:40:38 -0700 (Wed, 24 Mar 2010)
Log Message:
-----------
fix warnings

Modified Paths:
--------------
    users/toby/objcports/MPIndex.m

Modified: users/toby/objcports/MPIndex.m
===================================================================
--- users/toby/objcports/MPIndex.m	2010-03-25 04:37:54 UTC (rev 65313)
+++ users/toby/objcports/MPIndex.m	2010-03-25 04:40:38 UTC (rev 65314)
@@ -21,14 +21,17 @@
 }
 
 static int
-datainput(ClientData instanceData, char *buf, int bufSize, int *errorCodePtr)
+datainput(ClientData instanceData, char *buf, int bufSize, int *errorCodePtr __unused)
 {
 	struct NSData_channel_ctx *ctx = (struct NSData_channel_ctx *)instanceData;
 	size_t bytes;
 
-	bytes = MIN([ctx->data length] - ctx->offset, bufSize);
+	bytes = [ctx->data length] - ctx->offset;
+	if ((size_t)bufSize < bytes) {
+		bytes = bufSize;
+	}
 
-	memcpy(buf, [ctx->data bytes] + ctx->offset, bytes);
+	memcpy(buf, (char *)[ctx->data bytes] + ctx->offset, bytes);
 	ctx->offset += bytes;
 
 	return (int)bytes;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100324/7e117ecd/attachment.html>


More information about the macports-changes mailing list