Browse Source

Fixed more build warnings

Pierre-Olivier Latour 11 năm trước cách đây
mục cha
commit
36658278f8

+ 1 - 1
CGDWebServer/GCDWebServer.m

@@ -314,7 +314,7 @@ static void _NetServiceClientCallBack(CFNetServiceRef service, CFStreamError* er
 - (BOOL)runWithPort:(NSUInteger)port {
   BOOL success = NO;
   _run = YES;
-  void* handler = signal(SIGINT, _SignalHandler);
+  void (*handler)(int) = signal(SIGINT, _SignalHandler);
   if (handler != SIG_ERR) {
     if ([self startWithPort:port bonjourName:@""]) {
       while (_run) {

+ 1 - 0
CGDWebServer/GCDWebServerPrivate.h

@@ -26,6 +26,7 @@
  */
 
 #import <TargetConditionals.h>
+#import <AvailabilityMacros.h>
 
 #if __has_feature(objc_arc)
 #define ARC_BRIDGE __bridge

+ 1 - 1
CGDWebServer/GCDWebServerResponse.m

@@ -243,7 +243,7 @@
     type = kGCDWebServerDefaultMimeType;
   }
   
-  if ((self = [super initWithContentType:type contentLength:info.st_size])) {
+  if ((self = [super initWithContentType:type contentLength:(NSUInteger)info.st_size])) {
     _path = [path copy];
     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];

+ 2 - 0
iOS/AppDelegate.m

@@ -29,6 +29,8 @@
 
 @implementation AppDelegate
 
+@synthesize window=_window;
+
 #if !__has_feature(objc_arc)
 
 - (void)dealloc {