Author: thebeing
Date: Wed Jul 27 14:39:59 2016
New Revision: 40039

URL: http://svn.gna.org/viewcvs/gnustep?rev=40039&view=rev
Log:
Fix warnings for compilers without blocks support.

Modified:
    libs/base/trunk/Source/NSData.m

Modified: libs/base/trunk/Source/NSData.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSData.m?rev=40039&r1=40038&r2=40039&view=diff
==============================================================================
--- libs/base/trunk/Source/NSData.m     (original)
+++ libs/base/trunk/Source/NSData.m     Wed Jul 27 14:39:59 2016
@@ -385,7 +385,11 @@
 {
   NSUInteger   length;
   __strong void        *bytes;
-  GSDataDeallocatorBlock deallocator;
+  /**
+   * This is a GSDataDeallocatorBlock instance, stored as an id for backwards
+   * compatibility.
+   */
+  id            deallocator;
 }
 @end
 
@@ -402,7 +406,11 @@
 {
   NSUInteger   length;
   __strong void        *bytes;
-  GSDataDeallocatorBlock deallocator;
+  /**
+   * This is a GSDataDeallocatorBlock instance, stored as an id for backwards
+   * compatibility.
+   */
+  id            deallocator;
   NSZone       *zone;
   NSUInteger   capacity;
   NSUInteger   growth;
@@ -3343,7 +3351,7 @@
     }
 
   GSClassSwizzle(self, dataBlock);
-  ASSIGN(deallocator, deallocBlock);
+  ASSIGN(deallocator, (id)deallocBlock);
   return self;
 }
 
@@ -3375,7 +3383,7 @@
 
   bytes = buf;
   length = len;
-  ASSIGN(deallocator, deallocBlock);
+  ASSIGN(deallocator, (id)deallocBlock);
   return self;
 }
 
@@ -3383,7 +3391,7 @@
 {
   if (deallocator != NULL)
     {
-      CALL_BLOCK(deallocator, bytes, length);
+      CALL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, length);
       DESTROY(deallocator);
     }
   // Clear out the ivars so that super doesn't double free.
@@ -3718,7 +3726,7 @@
     {
       return nil;
     }
-  ASSIGN(deallocator, deallocBlock);
+  ASSIGN(deallocator, (id)deallocBlock);
   return self;
 }
 
@@ -4250,7 +4258,7 @@
     {
       return nil;
     }
-  ASSIGN(deallocator, deallocBlock);
+  ASSIGN(deallocator, (id)deallocBlock);
   return self;
 }
 
@@ -4258,7 +4266,7 @@
 {
   if (deallocator != NULL)
     {
-      CALL_BLOCK(deallocator, bytes, capacity);
+      CALL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, capacity);
       // Clear out the ivars so that super doesn't double free.
       bytes = NULL;
       length = 0;
@@ -4288,7 +4296,7 @@
          memcpy(tmp, bytes, capacity < size ? capacity : size);
          if (deallocator != NULL)
            {
-          CALL_BLOCK(deallocator, bytes, capacity);
+          CALL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, capacity);
           DESTROY(deallocator);
              zone = NSDefaultMallocZone();
            }
@@ -4299,7 +4307,7 @@
        }
       else if (deallocator != NULL)
        {
-      CALL_BLOCK(deallocator, bytes, capacity);
+      CALL_BLOCK(((GSDataDeallocatorBlock)deallocator), bytes, capacity);
       DESTROY(deallocator);
          zone = NSDefaultMallocZone();
        }


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to