فهرست منبع

Fixed more build warnings

Pierre-Olivier Latour 11 سال پیش
والد
کامیت
120f6fc864
2فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 1 1
      CGDWebServer/GCDWebServerConnection.m
  2. 4 4
      CGDWebServer/GCDWebServerResponse.m

+ 1 - 1
CGDWebServer/GCDWebServerConnection.m

@@ -506,7 +506,7 @@ static dispatch_queue_t _formatterQueue = NULL;
 }
 
 - (GCDWebServerResponse*)processRequest:(GCDWebServerRequest*)request withBlock:(GCDWebServerProcessBlock)block {
-  LOG_DEBUG(@"Connection on socket %i processing %@ request for \"%@\" (%lu bytes body)", _socket, _request.method, _request.path, _request.contentLength);
+  LOG_DEBUG(@"Connection on socket %i processing %@ request for \"%@\" (%lu bytes body)", _socket, _request.method, _request.path, (unsigned long)_request.contentLength);
   GCDWebServerResponse* response = nil;
   @try {
     response = block(request);

+ 4 - 4
CGDWebServer/GCDWebServerResponse.m

@@ -283,10 +283,10 @@
   if ((range.location != NSNotFound) || (range.length > 0)) {
     if (range.location != NSNotFound) {
       range.location = MIN(range.location, (NSUInteger)info.st_size);
-      range.length = MIN(range.length, info.st_size - range.location);
+      range.length = MIN(range.length, (NSUInteger)info.st_size - range.location);
     } else {
       range.length = MIN(range.length, (NSUInteger)info.st_size);
-      range.location = info.st_size - range.length;
+      range.location = (NSUInteger)info.st_size - range.length;
     }
     if (range.length == 0) {
       ARC_RELEASE(self);
@@ -298,7 +298,7 @@
     type = kGCDWebServerDefaultMimeType;
   }
   
-  if ((self = [super initWithContentType:type contentLength:(range.location != NSNotFound ? range.length : info.st_size)])) {
+  if ((self = [super initWithContentType:type contentLength:(range.location != NSNotFound ? range.length : (NSUInteger)info.st_size)])) {
     _path = [path copy];
     if (range.location != NSNotFound) {
       _offset = range.location;
@@ -308,7 +308,7 @@
       LOG_DEBUG(@"Using content bytes range [%i-%i] for file \"%@\"", (int)range.location, (int)(range.location + range.length - 1), path);
     } else {
       _offset = 0;
-      _size = info.st_size;
+      _size = (NSUInteger)info.st_size;
     }
     if (attachment) {  // TODO: Use http://tools.ietf.org/html/rfc5987 to encode file names with special characters instead of using lossy conversion to ISO 8859-1
       NSData* data = [[path lastPathComponent] dataUsingEncoding:NSISOLatin1StringEncoding allowLossyConversion:YES];