//
// The top constructor.
//
-CFTypeRef CFMake::make()
+CFTypeRef CF_RETURNS_RETAINED CFMake::make()
{
while (next() == '@')
parameter();
}
-CFTypeRef CFMake::makeformat()
+CFTypeRef CF_RETURNS_RETAINED CFMake::makeformat()
{
++format;
switch (*format++) {
// Embedded strings can either be alphanumeric (only), or delimited with single quotes ''.
// No escapes are processed within such quotes. If you want arbitrary string values, use %s.
//
-CFTypeRef CFMake::makestring()
+CFTypeRef CF_RETURNS_RETAINED CFMake::makestring()
{
const char *start, *end;
if (*format == '\'') {
//
// Construct a CFDictionary
//
-CFTypeRef CFMake::makedictionary()
+CFTypeRef CF_RETURNS_RETAINED CFMake::makedictionary()
{
++format; // next '{'
next('!'); // indicates mutable (currently always true)
return dict;
} else
return NULL; // bad syntax
- } else
+ } else {
dict = CFDictionaryCreateMutable(allocator, 0,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- if (dict == NULL)
+ }
+
+ if (dict == NULL) {
return dict;
- if (add(dict))
- return dict;
- else {
- CFReleaseSafe(dict);
- return NULL;
- }
+ }
+
+ if (add(dict)) {
+ return dict;
+ } else {
+ CFReleaseSafe(dict);
+ return NULL;
+ }
}
CFDictionaryRef CFMake::add(CFMutableDictionaryRef dict)
//
// Construct a CFArray
//
-CFTypeRef CFMake::makearray()
+CFTypeRef CF_RETURNS_RETAINED CFMake::makearray()
{
++format; // next '['
next('!'); // indicates mutable (currently always)
//
// The public functions
//
-CFTypeRef cfmake(const char *format, ...)
+CFTypeRef CF_RETURNS_RETAINED cfmake(const char *format, ...)
{
va_list args;
va_start(args, format);
return result;
}
-CFTypeRef vcfmake(const char *format, va_list *args)
+CFTypeRef CF_RETURNS_RETAINED vcfmake(const char *format, va_list *args)
{
return CFMake(format, args).make();
}