Author: stefanbidi
Date: Thu Feb 19 18:04:52 2015
New Revision: 38347

URL: http://svn.gna.org/viewcvs/gnustep?rev=38347&view=rev
Log:
* Headers/CoreFoundation/CFArray.h,
* Headers/CoreFoundation/CFBag.h,
* Headers/CoreFoundation/CFData.h,
* Headers/CoreFoundation/CFDate.h,
* Headers/CoreFoundation/CFDictionary.h,
* Headers/CoreFoundation/CFSet.h,
* Headers/CoreFoundation/CFURL.h: Do not define CF types as Objective C objects.
* Headers/CoreFoundation/GSCharacter.h: Fix bug in UTF-8 conversion function.
* Source/NSCFArray.m,
* Source/NSCFData.m,
* Source/NSCFError.m: Explicitly cast NS to CF objects.

Modified:
    libs/corebase/trunk/ChangeLog
    libs/corebase/trunk/Headers/CoreFoundation/CFArray.h
    libs/corebase/trunk/Headers/CoreFoundation/CFBag.h
    libs/corebase/trunk/Headers/CoreFoundation/CFData.h
    libs/corebase/trunk/Headers/CoreFoundation/CFDate.h
    libs/corebase/trunk/Headers/CoreFoundation/CFDictionary.h
    libs/corebase/trunk/Headers/CoreFoundation/CFSet.h
    libs/corebase/trunk/Headers/CoreFoundation/CFURL.h
    libs/corebase/trunk/Headers/CoreFoundation/GSCharacter.h
    libs/corebase/trunk/Source/NSCFArray.m
    libs/corebase/trunk/Source/NSCFData.m
    libs/corebase/trunk/Source/NSCFError.m

Modified: libs/corebase/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/ChangeLog?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/ChangeLog       (original)
+++ libs/corebase/trunk/ChangeLog       Thu Feb 19 18:04:52 2015
@@ -1,3 +1,18 @@
+2014-02-19 Stefan Bidigaray <[email protected]>
+       * Headers/CoreFoundation/CFArray.h,
+       * Headers/CoreFoundation/CFBag.h,
+       * Headers/CoreFoundation/CFData.h,
+       * Headers/CoreFoundation/CFDate.h,
+       * Headers/CoreFoundation/CFDictionary.h,
+       * Headers/CoreFoundation/CFSet.h,
+       * Headers/CoreFoundation/CFURL.h: Do not define CF types as Objective C
+       objects.
+       * Headers/CoreFoundation/GSCharacter.h: Fix bug in UTF-8 conversion
+       function.
+       * Source/NSCFArray.m,
+       * Source/NSCFData.m,
+       * Source/NSCFError.m: Explicitly cast NS to CF objects.
+
 2014-02-16 Stefan Bidigaray <[email protected]>
        * Source/NSCFDictionary.m: Add category to match class definition.
        * Source/NSCFType.m: Use correct number of classes to register.

Modified: libs/corebase/trunk/Headers/CoreFoundation/CFArray.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Headers/CoreFoundation/CFArray.h?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Headers/CoreFoundation/CFArray.h        (original)
+++ libs/corebase/trunk/Headers/CoreFoundation/CFArray.h        Thu Feb 19 
18:04:52 2015
@@ -32,15 +32,8 @@
 
 CF_EXTERN_C_BEGIN
 
-#ifdef __OBJC__
-@class NSArray;
-@class NSMutableArray;
-typedef NSArray* CFArrayRef;
-typedef NSMutableArray* CFMutableArrayRef;
-#else
 typedef const struct __CFArray * CFArrayRef;
 typedef struct __CFArray * CFMutableArrayRef;
-#endif
 
 typedef void (*CFArrayApplierFunction) (const void *value, void *context);
 typedef CFStringRef (*CFArrayCopyDescriptionCallBack) (const void *value);

Modified: libs/corebase/trunk/Headers/CoreFoundation/CFBag.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Headers/CoreFoundation/CFBag.h?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Headers/CoreFoundation/CFBag.h  (original)
+++ libs/corebase/trunk/Headers/CoreFoundation/CFBag.h  Thu Feb 19 18:04:52 2015
@@ -31,15 +31,8 @@
 
 CF_EXTERN_C_BEGIN
 
-#ifdef __OBJC__
-@class NSBag;
-@class NSMutableBag;
-typedef NSBag* CFBagRef;
-typedef NSMutableBag* CFMutableBagRef;
-#else
 typedef const struct __CFBag *CFBagRef;
 typedef struct __CFBag *CFMutableBagRef;
-#endif
 
 typedef void (*CFBagApplierFunction) (const void *value, void *context);
 

Modified: libs/corebase/trunk/Headers/CoreFoundation/CFData.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Headers/CoreFoundation/CFData.h?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Headers/CoreFoundation/CFData.h (original)
+++ libs/corebase/trunk/Headers/CoreFoundation/CFData.h Thu Feb 19 18:04:52 2015
@@ -31,16 +31,8 @@
 
 CF_EXTERN_C_BEGIN
 
-#ifdef __OBJC__
-@class NSData;
-@class NSMutableData;
-typedef NSData* CFDataRef;
-typedef NSMutableData* CFMutableDataRef;
-#else
 typedef const struct __CFData * CFDataRef;
 typedef struct __CFData * CFMutableDataRef;
-#endif
-
 
 /*
  * Creating a CFData Object

Modified: libs/corebase/trunk/Headers/CoreFoundation/CFDate.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Headers/CoreFoundation/CFDate.h?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Headers/CoreFoundation/CFDate.h (original)
+++ libs/corebase/trunk/Headers/CoreFoundation/CFDate.h Thu Feb 19 18:04:52 2015
@@ -31,15 +31,8 @@
 
 CF_EXTERN_C_BEGIN
 
-#ifdef __OBJC__
-@class NSDate;
-@class NSTimeZone;
-typedef NSDate* CFDateRef;
-typedef NSTimeZone* CFTimeZoneRef;
-#else
 typedef const struct __CFDate *CFDateRef;
 typedef const struct __CFTimeZone *CFTimeZoneRef;
-#endif
 
 typedef double CFTimeInterval;
 typedef CFTimeInterval CFAbsoluteTime;

Modified: libs/corebase/trunk/Headers/CoreFoundation/CFDictionary.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Headers/CoreFoundation/CFDictionary.h?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Headers/CoreFoundation/CFDictionary.h   (original)
+++ libs/corebase/trunk/Headers/CoreFoundation/CFDictionary.h   Thu Feb 19 
18:04:52 2015
@@ -31,15 +31,8 @@
 
 CF_EXTERN_C_BEGIN
 
-#ifdef __OBJC__
-@class NSDictionary;
-@class NSMutableDictionary;
-typedef NSDictionary* CFDictionaryRef;
-typedef NSMutableDictionary* CFMutableDictionaryRef;
-#else
 typedef const struct __CFDictionary * CFDictionaryRef;
 typedef struct __CFDictionary * CFMutableDictionaryRef;
-#endif
 
 typedef void (*CFDictionaryApplierFunction) (const void *key,
   const void *value, void *context);

Modified: libs/corebase/trunk/Headers/CoreFoundation/CFSet.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Headers/CoreFoundation/CFSet.h?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Headers/CoreFoundation/CFSet.h  (original)
+++ libs/corebase/trunk/Headers/CoreFoundation/CFSet.h  Thu Feb 19 18:04:52 2015
@@ -31,15 +31,8 @@
 
 CF_EXTERN_C_BEGIN
 
-#ifdef __OBJC__
-@class NSSet;
-@class NSMutableSet;
-typedef NSSet* CFSetRef;
-typedef NSMutableSet* CFMutableSetRef;
-#else
 typedef const struct __CFSet *CFSetRef;
 typedef struct __CFSet *CFMutableSetRef;
-#endif
 
 typedef void (*CFSetApplierFunction) (const void *value, void *context);
 

Modified: libs/corebase/trunk/Headers/CoreFoundation/CFURL.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Headers/CoreFoundation/CFURL.h?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Headers/CoreFoundation/CFURL.h  (original)
+++ libs/corebase/trunk/Headers/CoreFoundation/CFURL.h  Thu Feb 19 18:04:52 2015
@@ -35,12 +35,7 @@
 
 CF_EXTERN_C_BEGIN
 
-#ifdef __OBJC__
-@class NSURL;
-typedef NSURL *CFURLRef;
-#else
 typedef const struct __CFURL *CFURLRef;
-#endif
 
 #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
 typedef CFOptionFlags CFURLBookmarkCreationOptions;

Modified: libs/corebase/trunk/Headers/CoreFoundation/GSCharacter.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Headers/CoreFoundation/GSCharacter.h?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Headers/CoreFoundation/GSCharacter.h    (original)
+++ libs/corebase/trunk/Headers/CoreFoundation/GSCharacter.h    Thu Feb 19 
18:04:52 2015
@@ -210,7 +210,7 @@
   UTF8Char *p;
 
   p = *d;
-  if (c < 0x80)
+  if (c < 0x80 && (end - p) > 1)
     {
       *p++ = c;
     }
@@ -219,22 +219,22 @@
       *p++ = (c >> 6) | 0xC0;
       *p++ = (c & 0x3F) | 0x80;
     }
-  else if (GSCharacterIsSurrogate (c) || c > 0x10FFFF)
-    {
-      return false;
-    }
-  else if (c < 0x10000 && (end - p) > 3)
+  else if (c > 0xDBFF && c < 0x10000 && (end - p) > 3)
     {
       *p++ = (c >> 12) | 0xE0;
       *p++ = ((c >> 6) & 0x3F) | 0x80;
       *p++ = (c & 0x3F) | 0x80;
     }
-  else if (c >= 0x20000 && (end - p) > 4)
+  else if (c < 0x11000 && (end - p) > 4)
     {
       *p++ = (c >> 18) | 0xF0;
       *p++ = ((c >> 12) & 0x3F) | 0x80;
       *p++ = ((c >> 6) & 0x3F) | 0x80;
       *p++ = (c & 0x3F) | 0x80;
+    }
+  else
+    {
+      return false;
     }
   *d = p;
 

Modified: libs/corebase/trunk/Source/NSCFArray.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Source/NSCFArray.m?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Source/NSCFArray.m      (original)
+++ libs/corebase/trunk/Source/NSCFArray.m      Thu Feb 19 18:04:52 2015
@@ -73,39 +73,41 @@
   va_end(ap);
 
   self = (NSCFArray*) CFArrayCreateCopy(NULL, temp);
-  RELEASE(temp);
+  RELEASE((id)temp);
 
   return self;
 }
 
 - (NSUInteger) count
 {
-  return (NSUInteger)CFArrayGetCount (self);
+  return (NSUInteger)CFArrayGetCount ((CFArrayRef)self);
 }
 
 - (id) objectAtIndex: (NSUInteger) index
 {
-  return (id)CFArrayGetValueAtIndex (self, (CFIndex)index);
+  return (id)CFArrayGetValueAtIndex ((CFArrayRef)self, (CFIndex)index);
 }
 
 -(void) addObject: (id) anObject
 {
-  CFArrayAppendValue (self, (const void*)anObject);
+  CFArrayAppendValue ((CFMutableArrayRef)self, (const void*)anObject);
 }
 
 - (void) replaceObjectAtIndex: (NSUInteger) index withObject: (id) anObject
 {
-  CFArraySetValueAtIndex (self, (CFIndex)index, (const void*)anObject);
+  CFArraySetValueAtIndex ((CFMutableArrayRef)self, (CFIndex)index,
+                          (const void*)anObject);
 }
 
 - (void) insertObject: (id) anObject atIndex: (NSUInteger) index
 {
-  CFArrayInsertValueAtIndex (self, (CFIndex)index, (const void*)anObject);
+  CFArrayInsertValueAtIndex ((CFMutableArrayRef)self, (CFIndex)index,
+                             (const void*)anObject);
 }
 
 - (void) removeObjectAtIndex: (NSUInteger) index
 {
-  CFArrayRemoveValueAtIndex (self, (CFIndex)index);
+  CFArrayRemoveValueAtIndex ((CFMutableArrayRef)self, (CFIndex)index);
 }
 @end
 

Modified: libs/corebase/trunk/Source/NSCFData.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Source/NSCFData.m?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Source/NSCFData.m       (original)
+++ libs/corebase/trunk/Source/NSCFData.m       Thu Feb 19 18:04:52 2015
@@ -54,7 +54,7 @@
 
 - (const void *) bytes
 {
-  return CFDataGetBytePtr (self);
+  return CFDataGetBytePtr ((CFDataRef)self);
 }
 
 - (NSString *) description
@@ -64,45 +64,47 @@
 
 - (void) getBytes: (void *) buffer range: (NSRange) range
 {
-  CFDataGetBytes (self, CFRangeMake(range.location, range.length), buffer);
+  CFDataGetBytes ((CFDataRef)self, CFRangeMake(range.location, range.length),
+                  buffer);
 }
 
 - (BOOL) isEqualToData: (NSData *) other
 {
-  return (BOOL)CFEqual (self, other);
+  return (BOOL)CFEqual ((CFDataRef)self, other);
 }
 
 - (NSUInteger) length
 {
-  return (NSUInteger)CFDataGetLength(self);
+  return (NSUInteger)CFDataGetLength((CFMutableDataRef)self);
 }
 
 - (void) increaseLengthBy: (NSUInteger) extraLength
 {
-  CFDataIncreaseLength (self, (CFIndex)extraLength);
+  CFDataIncreaseLength ((CFMutableDataRef)self, (CFIndex)extraLength);
 }
 
 - (void) setLength: (NSUInteger) length
 {
-  CFDataSetLength (self, (CFIndex)length);
+  CFDataSetLength ((CFMutableDataRef)self, (CFIndex)length);
 }
 
 - (void *) mutableBytes
 {
-  return CFDataGetMutableBytePtr (self);
+  return CFDataGetMutableBytePtr ((CFMutableDataRef)self);
 }
 
 - (void) appendBytes: (const void *) buffer length: (NSUInteger) size
 {
-  CFDataAppendBytes (self, buffer, size);
+  CFDataAppendBytes ((CFMutableDataRef)self, buffer, size);
 }
 
 - (void) replaceBytesInRange: (NSRange) range
                    withBytes: (const void *) bytes
                       length: (NSUInteger) length
 {
-  CFDataReplaceBytes (self, CFRangeMake(range.location, range.length), bytes,
-    (CFIndex)length);
+  CFDataReplaceBytes ((CFMutableDataRef)self,
+                      CFRangeMake(range.location, range.length), bytes,
+                      (CFIndex)length);
 }
 
 @end

Modified: libs/corebase/trunk/Source/NSCFError.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Source/NSCFError.m?rev=38347&r1=38346&r2=38347&view=diff
==============================================================================
--- libs/corebase/trunk/Source/NSCFError.m      (original)
+++ libs/corebase/trunk/Source/NSCFError.m      Thu Feb 19 18:04:52 2015
@@ -56,7 +56,8 @@
 {
   RELEASE(self);
   
-  return (NSCFError*)CFErrorCreate (NULL, domain, code, userInfo);
+  return (NSCFError*)CFErrorCreate (NULL, (CFStringRef)domain, (CFIndex)code,
+                                    (CFDictionaryRef)userInfo);
 }
 
 - (NSString *) localizedDescription
@@ -96,7 +97,7 @@
 
 - (NSDictionary*) userInfo
 {
-  return CFErrorCopyUserInfo (self);
+  return (NSDictionary*)CFErrorCopyUserInfo ((CFErrorRef)self);
 }
 
 @end


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

Reply via email to