Skip to content

Commit

Permalink
Fixes for C++. Bug report by Lubos Dolezel.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/corebase/trunk@35857 72102866-910b-0410-8b05-ffd578937521
  • Loading branch information
stefanbidi committed Dec 6, 2012
1 parent 5563d25 commit e69a99b
Show file tree
Hide file tree
Showing 22 changed files with 115 additions and 167 deletions.
11 changes: 5 additions & 6 deletions Headers/CoreFoundation/CFBase.h
Expand Up @@ -14,7 +14,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
Expand Down Expand Up @@ -223,13 +223,12 @@ CFRangeMake(CFIndex location, CFIndex length)
}

/* Returned by comparison functions */
typedef CFIndex CFComparisonResult;
enum
typedef enum
{
kCFCompareLessThan = -1,
kCFCompareEqualTo = 0,
kCFCompareGreaterThan = 1
};
} CFComparisonResult;

/* Return when a value is not found */
enum
Expand Down Expand Up @@ -331,7 +330,7 @@ typedef CFIndex (*CFAllocatorPreferredSizeCallBack)(CFIndex size,
CFOptionFlags hint, void *info);
typedef const void* (*CFAllocatorRetainCallBack)(const void *info);
typedef void (*CFAllocatorReleaseCallBack)(const void *info);
typedef CFStringRef (*CFAllocatorCopyDescriptionCallBack)(const void *info);
typedef CFStringRef (*CFAllocatorCopyDescriptionCallBack)(const void *info);

struct _CFAllocatorContext
{
Expand All @@ -342,7 +341,7 @@ struct _CFAllocatorContext
CFAllocatorCopyDescriptionCallBack copyDescription;
CFAllocatorAllocateCallBack allocate;
CFAllocatorReallocateCallBack reallocate;
CFAllocatorDeallocateCallBack deallocate;
CFAllocatorDeallocateCallBack deallocate;
CFAllocatorPreferredSizeCallBack preferredSize;
};
typedef struct _CFAllocatorContext CFAllocatorContext;
Expand Down
7 changes: 3 additions & 4 deletions Headers/CoreFoundation/CFCharacterSet.h
Expand Up @@ -14,7 +14,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
Expand All @@ -35,8 +35,7 @@ CF_EXTERN_C_BEGIN
typedef const struct __CFCharacterSet * CFCharacterSetRef;
typedef struct __CFCharacterSet * CFMutableCharacterSetRef;

typedef CFIndex CFCharacterSetPredefinedSet;
enum
typedef enum
{
kCFCharacterSetControl = 1,
kCFCharacterSetWhitespace,
Expand All @@ -59,7 +58,7 @@ enum
kCFCharacterSetNewline = 15,
#endif
kCFCharacterSetIllegal = 12
};
} CFCharacterSetPredefinedSet;



Expand Down
5 changes: 2 additions & 3 deletions Headers/CoreFoundation/CFDate.h
Expand Up @@ -66,7 +66,7 @@ struct CFGregorianUnits
double seconds;
};

enum CFGregorianUnitFlags
typedef enum
{
kCFGregorianUnitsYears = (1 << 0),
kCFGregorianUnitsMonths = (1 << 1),
Expand All @@ -75,8 +75,7 @@ enum CFGregorianUnitFlags
kCFGregorianUnitsMinutes = (1 << 4),
kCFGregorianUnitsSeconds = (1 << 5),
kCFGregorianAllUnits = 0x00FFFFFF
};
typedef enum CFGregorianUnitFlags CFGregorianUnitFlags;
} CFGregorianUnitFlags;

CF_EXPORT const CFTimeInterval kCFAbsoluteTimeIntervalSince1970;
CF_EXPORT const CFTimeInterval kCFAbsoluteTimeIntervalSince1904;
Expand Down
7 changes: 3 additions & 4 deletions Headers/CoreFoundation/CFDateFormatter.h
Expand Up @@ -14,7 +14,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
Expand All @@ -37,15 +37,14 @@ CF_EXTERN_C_BEGIN

typedef struct __CFDateFormatter *CFDateFormatterRef;

typedef enum _CFDateFormatterStyle CFDateFormatterStyle;
enum _CFDateFormatterStyle
typedef enum _CFDateFormatterStyle
{
kCFDateFormatterNoStyle = 0,
kCFDateFormatterShortStyle = 1,
kCFDateFormatterMediumStyle = 2,
kCFDateFormatterLongStyle = 3,
kCFDateFormatterFullStyle = 4
};
} CFDateFormatterStyle;

CF_EXPORT const CFStringRef kCFDateFormatterIsLenient; /* CFBoolean */
CF_EXPORT const CFStringRef kCFDateFormatterTimeZone; /* CFTimeZone */
Expand Down
7 changes: 3 additions & 4 deletions Headers/CoreFoundation/CFNumber.h
Expand Up @@ -14,7 +14,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
Expand Down Expand Up @@ -50,7 +50,7 @@ CF_EXPORT const CFNumberRef kCFNumberNaN;
CF_EXPORT const CFNumberRef kCFNumberNegativeInfinity;
CF_EXPORT const CFNumberRef kCFNumberPositiveInfinity;

enum CFNumberType
typedef enum
{
kCFNumberSInt8Type = 1,
kCFNumberSInt16Type = 2,
Expand All @@ -73,8 +73,7 @@ enum CFNumberType
#else
kCFNumberMaxType = 14
#endif
};
typedef enum CFNumberType CFNumberType;
} CFNumberType;



Expand Down
129 changes: 49 additions & 80 deletions Headers/CoreFoundation/CFNumberFormatter.h
Expand Up @@ -14,7 +14,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
Expand Down Expand Up @@ -62,8 +62,7 @@ enum
kCFNumberFormatterPadAfterSuffix = 3
};

typedef CFIndex CFNumberFormatterRoundingMode;
enum
typedef enum
{
kCFNumberFormatterRoundCeiling = 0,
kCFNumberFormatterRoundFloor = 1,
Expand All @@ -72,98 +71,68 @@ enum
kCFNumberFormatterRoundHalfEven = 4,
kCFNumberFormatterRoundHalfDown = 5,
kCFNumberFormatterRoundHalfUp = 6
};
} CFNumberFormatterRoundingMode;

typedef CFIndex CFNumberFormatterStyle;
enum
typedef enum
{
kCFNumberFormatterNoStyle = 0,
kCFNumberFormatterDecimalStyle = 1,
kCFNumberFormatterCurrencyStyle = 2,
kCFNumberFormatterPercentStyle = 3,
kCFNumberFormatterScientificStyle = 4,
kCFNumberFormatterSpellOutStyle = 5
};

CF_EXPORT const CFStringRef
kCFNumberFormatterCurrencyCode; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterDecimalSeparator; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterCurrencyDecimalSeparator; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterAlwaysShowDecimalSeparator; /* CFBoolean */
CF_EXPORT const CFStringRef
kCFNumberFormatterGroupingSeparator; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterUseGroupingSeparator; /* CFBoolean */
CF_EXPORT const CFStringRef
kCFNumberFormatterPercentSymbol; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterZeroSymbol; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterNaNSymbol; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterInfinitySymbol; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterMinusSign; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterPlusSign; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterCurrencySymbol; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterExponentSymbol; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterMinIntegerDigits; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterMaxIntegerDigits; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterMinFractionDigits; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterMaxFractionDigits; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterGroupingSize; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterSecondaryGroupingSize; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterRoundingMode; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterRoundingIncrement; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterFormatWidth; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterPaddingPosition; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterPaddingCharacter; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterDefaultFormat; /* CFString */
} CFNumberFormatterStyle;

CF_EXPORT const CFStringRef kCFNumberFormatterCurrencyCode; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterDecimalSeparator; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterCurrencyDecimalSeparator; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterAlwaysShowDecimalSeparator; /* CFBoolean */
CF_EXPORT const CFStringRef kCFNumberFormatterGroupingSeparator; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterUseGroupingSeparator; /* CFBoolean */
CF_EXPORT const CFStringRef kCFNumberFormatterPercentSymbol; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterZeroSymbol; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterNaNSymbol; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterInfinitySymbol; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterMinusSign; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterPlusSign; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterCurrencySymbol; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterExponentSymbol; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterMinIntegerDigits; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterMaxIntegerDigits; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterMinFractionDigits; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterMaxFractionDigits; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterGroupingSize; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterSecondaryGroupingSize; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterRoundingMode; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterRoundingIncrement; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterFormatWidth; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterPaddingPosition; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterPaddingCharacter; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterDefaultFormat; /* CFString */
#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED
CF_EXPORT const CFStringRef
kCFNumberFormatterMultiplier; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterPositivePrefix; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterPositiveSuffix; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterNegativePrefix; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterNegativeSuffix; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterPerMillSymbol; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterInternationalCurrencySymbol; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterMultiplier; /* CFNumber */
CF_EXPORT const CFStringRef kCFNumberFormatterPositivePrefix; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterPositiveSuffix; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterNegativePrefix; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterNegativeSuffix; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterPerMillSymbol; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterInternationalCurrencySymbol; /* CFString */
#endif
#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED
CF_EXPORT const CFStringRef
kCFNumberFormatterCurrencyGroupingSeparator; /* CFString */
CF_EXPORT const CFStringRef
kCFNumberFormatterIsLenient; /* CFBoolean */
kCFNumberFormatterCurrencyGroupingSeparator; /* CFString */
CF_EXPORT const CFStringRef kCFNumberFormatterIsLenient; /* CFBoolean */
CF_EXPORT const CFStringRef
kCFNumberFormatterUseSignificantDigits; /* CFBoolean */
kCFNumberFormatterUseSignificantDigits; /* CFBoolean */
CF_EXPORT const CFStringRef
kCFNumberFormatterMinSignificantDigits; /* CFNumber */
kCFNumberFormatterMinSignificantDigits; /* CFNumber */
CF_EXPORT const CFStringRef
kCFNumberFormatterMaxSignificantDigits; /* CFNumber */
kCFNumberFormatterMaxSignificantDigits; /* CFNumber */
#endif


Expand Down
10 changes: 4 additions & 6 deletions Headers/CoreFoundation/CFPropertyList.h
Expand Up @@ -35,22 +35,20 @@
CF_EXTERN_C_BEGIN

#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED
typedef enum CFPropertyListFormat CFPropertyListFormat;
enum CFPropertyListFormat
typedef enum
{
kCFPropertyListOpenStepFormat = 1,
kCFPropertyListXMLFormat_v1_0 = 100,
kCFPropertyListBinaryFormat_v1_0 = 200
};
} CFPropertyListFormat;
#endif

typedef enum CFPropertyListMutabilityOptions CFPropertyListMutabilityOptions;
enum CFPropertyListMutabilityOptions
typedef enum
{
kCFPropertyListImmutable = 0,
kCFPropertyListMutableContainers = 1,
kCFPropertyListMutableContainersAndLeaves = 2
};
} CFPropertyListMutabilityOptions;

#if MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED
enum
Expand Down
5 changes: 2 additions & 3 deletions Headers/CoreFoundation/CFRunLoop.h
Expand Up @@ -39,8 +39,7 @@ typedef struct __CFRunLoopSource * CFRunLoopSourceRef;
typedef struct __CFRunLoopObserver * CFRunLoopObserverRef;
typedef struct __CFRunLoopTimer * CFRunLoopTimerRef;

typedef enum CFRunLoopActivity CFRunLoopActivity;
enum CFRunLoopActivity
typedef enum
{
kCFRunLoopEntry = (1 << 0),
kCFRunLoopBeforeTimers = (1 << 1),
Expand All @@ -49,7 +48,7 @@ enum CFRunLoopActivity
kCFRunLoopAfterWaiting = (1 << 6),
kCFRunLoopExit = (1 << 7),
kCFRunLoopAllActivities = 0x0FFFFFFFU
};
} CFRunLoopActivity;

enum
{
Expand Down
10 changes: 4 additions & 6 deletions Headers/CoreFoundation/CFSocket.h
Expand Up @@ -61,8 +61,7 @@ struct CFSocketSignature
CFDataRef address;
};

typedef enum CFSocketCallBackType CFSocketCallBackType;
enum CFSocketCallBackType
typedef enum
{
kCFSocketNoCallBack = 0,
kCFSocketReadCallBack = 1,
Expand All @@ -73,7 +72,7 @@ enum CFSocketCallBackType
,
kCFSocketWriteCallBack = 8
#endif
};
} CFSocketCallBackType;

#if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED
enum
Expand All @@ -89,13 +88,12 @@ enum
};
#endif

typedef enum CFSocketError CFSocketError;
enum CFSocketError
typedef enum
{
kCFSocketSuccess = 0,
kCFSocketError = -1,
kCFSocketTimeout = -2
};
} CFSocketError;

typedef void (*CFSocketCallBack) (CFSocketRef s,
CFSocketCallBackType callbackType,
Expand Down

0 comments on commit e69a99b

Please sign in to comment.