Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -505,11 +505,11 @@ ${COMPILE_PLUGIN_OK}; \ else \ ${COMPILE_PLUGIN_FAILED}; \ fi -install: ${SHARED_LIB} ${STATIC_LIB} ${STATIC_PIC_LIB} ${PLUGIN} ${PROG} install-extra +install: all install-extra for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} install || exit $$?; \ ${DIR_LEAVE}; \ done Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -85,11 +85,11 @@ * * \param objects A C array of objects * \param length The length of the C array * \return A new autoreleased OFArray */ -+ arrayWithObjects: (id*)objects ++ arrayWithObjects: (id const*)objects count: (size_t)count; /** * \brief Initializes an OFArray with the specified object. * @@ -130,11 +130,11 @@ * * \param objects A C array of objects * \param length The length of the C array * \return An initialized OFArray */ -- initWithObjects: (id*)objects +- initWithObjects: (id const*)objects count: (size_t)count; /** * \brief Returns a specified object of the array. * Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -73,11 +73,11 @@ - initWithArray: (OFArray*)array { return (id)[[OFArray_adjacent alloc] initWithArray: array]; } -- initWithObjects: (id*)objects +- initWithObjects: (id const*)objects count: (size_t)count { return (id)[[OFArray_adjacent alloc] initWithObjects: objects count: count]; } @@ -150,11 +150,11 @@ + arrayWithArray: (OFArray*)array { return [[[self alloc] initWithArray: array] autorelease]; } -+ arrayWithObjects: (id*)objects ++ arrayWithObjects: (id const*)objects count: (size_t)count { return [[[self alloc] initWithObjects: objects count: count] autorelease]; } @@ -204,11 +204,11 @@ [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } -- initWithObjects: (id*)objects +- initWithObjects: (id const*)objects count: (size_t)count { Class c = isa; [self release]; @throw [OFNotImplementedException exceptionWithClass: c Index: src/OFArray_adjacent.m ================================================================== --- src/OFArray_adjacent.m +++ src/OFArray_adjacent.m @@ -119,11 +119,11 @@ } return self; } -- initWithObjects: (id*)objects +- initWithObjects: (id const*)objects count: (size_t)count { self = [self init]; @try { Index: src/OFCountedSet.m ================================================================== --- src/OFCountedSet.m +++ src/OFCountedSet.m @@ -58,10 +58,17 @@ arguments: arguments]; va_end(arguments); return ret; } + +- initWithObjects: (id const*)objects + count: (size_t)count +{ + return (id)[[OFCountedSet_hashtable alloc] initWithObjects: objects + count: count]; +} - initWithObject: (id)firstObject arguments: (va_list)arguments { return (id)[[OFCountedSet_hashtable alloc] initWithObject: firstObject Index: src/OFCountedSet_hashtable.m ================================================================== --- src/OFCountedSet_hashtable.m +++ src/OFCountedSet_hashtable.m @@ -81,10 +81,28 @@ self = [self init]; @try { id *objects = [array objects]; size_t i, count = [array count]; + + for (i = 0; i < count; i++) + [self addObject: objects[i]]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- initWithObjects: (id const*)objects + count: (size_t)count +{ + self = [self init]; + + @try { + size_t i; for (i = 0; i < count; i++) [self addObject: objects[i]]; } @catch (id e) { [self release]; Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -89,12 +89,12 @@ * \param keys An array of keys * \param objects An array of objects * \param count The number of objects in the arrays * \return A new autoreleased OFDictionary */ -+ dictionaryWithObjects: (id*)objects - forKeys: (id*)keys ++ dictionaryWithObjects: (id const*)objects + forKeys: (id const*)keys count: (size_t)count; /** * \brief Creates a new OFDictionary with the specified keys objects. * @@ -148,12 +148,12 @@ * \param keys An array of keys * \param objects An array of objects * \param count The number of objects in the arrays * \return A new initialized OFDictionary */ -- initWithObjects: (id*)objects - forKeys: (id*)keys +- initWithObjects: (id const*)objects + forKeys: (id const*)keys count: (size_t)count; /** * \brief Initializes an already allocated OFDictionary with the specified keys * and objects. Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -58,12 +58,12 @@ { return (id)[[OFDictionary_hashtable alloc] initWithObjects: objects forKeys: keys]; } -- initWithObjects: (id*)objects - forKeys: (id*)keys +- initWithObjects: (id const*)objects + forKeys: (id const*)keys count: (size_t)count { return (id)[[OFDictionary_hashtable alloc] initWithObjects: objects forKeys: keys count: count]; @@ -154,12 +154,12 @@ { return [[[self alloc] initWithObjects: objects forKeys: keys] autorelease]; } -+ dictionaryWithObjects: (id*)objects - forKeys: (id*)keys ++ dictionaryWithObjects: (id const*)objects + forKeys: (id const*)keys count: (size_t)count { return [[[self alloc] initWithObjects: objects forKeys: keys count: count] autorelease]; @@ -211,12 +211,12 @@ [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } -- initWithObjects: (id*)objects - forKeys: (id*)keys +- initWithObjects: (id const*)objects + forKeys: (id const*)keys count: (size_t)count { Class c = isa; [self release]; @throw [OFNotImplementedException exceptionWithClass: c Index: src/OFDictionary_hashtable.m ================================================================== --- src/OFDictionary_hashtable.m +++ src/OFDictionary_hashtable.m @@ -251,12 +251,12 @@ } return ret; } -- initWithObjects: (id*)objects - forKeys: (id*)keys +- initWithObjects: (id const*)objects + forKeys: (id const*)keys count: (size_t)count_ { self = [super init]; @try { Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -106,11 +106,11 @@ - initWithArray: (OFArray*)array { return (id)[[OFMutableArray_adjacent alloc] initWithArray: array]; } -- initWithObjects: (id*)objects +- initWithObjects: (id const*)objects count: (size_t)count { return (id)[[OFMutableArray_adjacent alloc] initWithObjects: objects count: count]; } Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -53,12 +53,12 @@ return (id)[[OFMutableDictionary_hashtable alloc] initWithObjects: objects forKeys: keys]; } -- initWithObjects: (id*)objects - forKeys: (id*)keys +- initWithObjects: (id const*)objects + forKeys: (id const*)keys count: (size_t)count { return (id)[[OFMutableDictionary_hashtable alloc] initWithObjects: objects forKeys: keys Index: src/OFMutableSet.m ================================================================== --- src/OFMutableSet.m +++ src/OFMutableSet.m @@ -57,10 +57,17 @@ arguments: arguments]; va_end(arguments); return ret; } + +- initWithObjects: (id const*)objects + count: (size_t)count +{ + return (id)[[OFMutableSet_hashtable alloc] initWithObjects: objects + count: count]; +} - initWithObject: (id)firstObject arguments: (va_list)arguments { return (id)[[OFMutableSet_hashtable alloc] initWithObject: firstObject Index: src/OFSet.h ================================================================== --- src/OFSet.h +++ src/OFSet.h @@ -68,10 +68,20 @@ * \param firstObject The first object for the set * \return A new, autoreleased set with the specified objects */ + setWithObjects: (id)firstObject, ...; +/** + * \brief Creates a new set with the specified objects. + * + * \param objects An array of objects for the set + * \param count The number of objects in the specified array + * \return A new, autoreleased set with the specified objects + */ ++ setWithObjects: (id const*)objects + count: (size_t)count; + /** * \brief Initializes an already allocated set with the specified set. * * \param set The set to initialize the set with * \return An initialized set with the specified set @@ -92,10 +102,20 @@ * \param firstObject The first object for the set * \return An initialized set with the specified objects */ - initWithObjects: (id)firstObject, ...; +/** + * \brief Initializes an already allocated set with the specified objects. + * + * \param objects An array of objects for the set + * \param count The number of objects in the specified array + * \return An initialized set with the specified objects + */ +- initWithObjects: (id const*)objects + count: (size_t)count; + /** * \brief Initializes an already allocated set with the specified object and * va_list. * * \param firstObject The first object for the set Index: src/OFSet.m ================================================================== --- src/OFSet.m +++ src/OFSet.m @@ -57,10 +57,17 @@ arguments: arguments]; va_end(arguments); return ret; } + +- initWithObjects: (id const*)objects + count: (size_t)count +{ + return (id)[[OFSet_hashtable alloc] initWithObjects: objects + count: count]; +} - initWithObject: (id)firstObject arguments: (va_list)arguments { return (id)[[OFSet_hashtable alloc] initWithObject: firstObject @@ -134,10 +141,17 @@ arguments: arguments] autorelease]; va_end(arguments); return ret; } + ++ setWithObjects: (id const*)objects + count: (size_t)count +{ + return [[[self alloc] initWithObjects: objects + count: count] autorelease]; +} - init { if (isa == [OFSet class]) { Class c = isa; @@ -163,11 +177,11 @@ [self release]; @throw [OFNotImplementedException exceptionWithClass: c selector: _cmd]; } -- (id)initWithObjects:(id)firstObject, ... +- (id)initWithObjects: (id)firstObject, ... { id ret; va_list arguments; va_start(arguments, firstObject); @@ -175,10 +189,19 @@ arguments: arguments]; va_end(arguments); return ret; } + +- initWithObjects: (id const*)objects + count: (size_t)count +{ + Class c = isa; + [self release]; + @throw [OFNotImplementedException exceptionWithClass: c + selector: _cmd]; +} - initWithObject: (id)firstObject arguments: (va_list)arguments { Class c = isa; Index: src/OFSet_hashtable.m ================================================================== --- src/OFSet_hashtable.m +++ src/OFSet_hashtable.m @@ -80,10 +80,34 @@ @try { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFNumber *one = [OFNumber numberWithSize: 1]; id *objects = [array objects]; size_t i, count = [array count]; + + for (i = 0; i < count; i++) + [dictionary _setObject: one + forKey: objects[i] + copyKey: NO]; + + [pool release]; + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- initWithObjects: (id const*)objects + count: (size_t)count +{ + self = [self init]; + + @try { + OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + OFNumber *one = [OFNumber numberWithSize: 1]; + size_t i; for (i = 0; i < count; i++) [dictionary _setObject: one forKey: objects[i] copyKey: NO]; Index: src/OFString_UTF8.h ================================================================== --- src/OFString_UTF8.h +++ src/OFString_UTF8.h @@ -17,11 +17,11 @@ #import "OFString.h" @interface OFString_UTF8: OFString { @public - /* + /** * A pointer to the actual data. * * Since constant strings don't have s_store, they have to malloc it on * the first access. Strings created at runtime just set the pointer to * &s_store. Index: src/OFThreadPool.m ================================================================== --- src/OFThreadPool.m +++ src/OFThreadPool.m @@ -117,11 +117,11 @@ } - (void)perform { #ifdef OF_HAVE_BLOCKS - if (block != nil) + if (block != NULL) block(object); else #endif [object performSelector: selector withObject: object]; Index: src/of_asprintf.m ================================================================== --- src/of_asprintf.m +++ src/of_asprintf.m @@ -15,10 +15,11 @@ */ #include "config.h" #define _GNU_SOURCE +#include #include #include #include #include #include Index: utils/objfw-config.in ================================================================== --- utils/objfw-config.in +++ utils/objfw-config.in @@ -24,11 +24,11 @@ OBJC="@OBJC@" OBJCFLAGS="@GNU_RUNTIME@ -fexceptions -fobjc-exceptions" OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstantString" OBJCFLAGS="$OBJCFLAGS @NO_CONST_CFSTRINGS@ @BLOCKS_FLAGS@ @NO_WARN_UNUSED@" LIB_CFLAGS="@LIB_CFLAGS@" -LIB_LDFLAGS='@LIB_LDFLAGS@' +LIB_LDFLAGS="@LIB_LDFLAGS@" LIB_PREFIX="@LIB_PREFIX@" LIB_SUFFIX="@LIB_SUFFIX@" LDFLAGS="" LDFLAGS_REEXPORT="@LDFLAGS_REEXPORT@" LDFLAGS_RPATH="@LDFLAGS_RPATH@" @@ -106,12 +106,11 @@ printf "SHARED_LIB, LIB_MAJOR and " 2>&1 echo "and LIB_MINOR to be set!" 1>&2 exit 1 fi - eval "printf '%s' \"$(echo $LIB_LDFLAGS | \ - sed 's/\$\$/$/g')\"" + printf "%s" "$LIB_LDFLAGS" ;; --lib-prefix) if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then echo "LIB_MAJOR and LIB_MINOR need to be set!" \ 1>&2