Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -49,12 +49,11 @@ AC_SUBST(OFPLUGINS_DEF, "-DOF_PLUGINS") fi AC_C_BIGENDIAN([ AC_DEFINE(OF_BIG_ENDIAN, 1, [Whether we are big endian]) - AC_SUBST(ENDIANESS_DEF, "-DOF_BIG_ENDIAN") - ]) + AC_SUBST(ENDIANESS_DEF, "-DOF_BIG_ENDIAN")]) AC_MSG_CHECKING(for SIZE_MAX) AC_EGREP_CPP(yes, [ #include #include Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -1,9 +1,8 @@ ASPRINTF_M = @ASPRINTF_M@ OBJC_SYNC_M = @OBJC_SYNC_M@ OFPLUGIN_M = @OFPLUGIN_M@ OFTHREAD_M = @OFTHREAD_M@ TESTPLUGIN = @TESTPLUGIN@ -WS2_LIBS = @WS2_LIBS@ TESTS = @TESTS@ TEST_LAUNCHER = @TEST_LAUNCHER@ THREADING_H = @THREADING_H@ Index: generators/TableGenerator.h ================================================================== --- generators/TableGenerator.h +++ generators/TableGenerator.h @@ -14,10 +14,13 @@ @interface TableGenerator: OFObject { of_unichar_t upper[0x110000]; of_unichar_t lower[0x110000]; of_unichar_t casefolding[0x110000]; + BOOL upper_table_used[0x1100]; + BOOL lower_table_used[0x1100]; + BOOL casefolding_table_used[0x1100]; size_t upper_size; size_t lower_size; size_t casefolding_size; } Index: generators/TableGenerator.m ================================================================== --- generators/TableGenerator.m +++ generators/TableGenerator.m @@ -103,24 +103,13 @@ - (void)writeTablesToFile: (OFString*)file { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2; of_unichar_t i, j; - BOOL *upper_table_used; - BOOL *lower_table_used; - char *casefolding_table_used; OFFile *f = [OFFile fileWithPath: file mode: @"wb"]; - upper_table_used = [self allocMemoryWithSize: 0x1100]; - lower_table_used = [self allocMemoryWithSize: 0x1100]; - casefolding_table_used = [self allocMemoryWithSize: 0x1100]; - - memset(upper_table_used, 0, 0x1100); - memset(lower_table_used, 0, 0x1100); - memset(casefolding_table_used, 0, 0x1100); - [f writeString: COPYRIGHT @"#include \"config.h\"\n" @"\n" @"#import \"OFString.h\"\n\n" @"static const of_unichar_t nop_page[0x100] = {};\n\n"]; @@ -303,14 +292,10 @@ [f writeString: @", "]; } [f writeString: @"\n};\n"]; - [self freeMemory: upper_table_used]; - [self freeMemory: lower_table_used]; - [self freeMemory: casefolding_table_used]; - [pool release]; } - (void)writeHeaderToFile: (OFString*)file { Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -15,11 +15,11 @@ #import "OFDataArray.h" @class OFString; /** - * The OFArray class provides a class for storing objects in an array. + * The OFArray class is a class for storing objects in an array. */ @interface OFArray: OFObject { OFDataArray *array; } @@ -28,22 +28,28 @@ * \return A new autoreleased OFArray */ + array; /** + * Creates a new OFArray with the specified object. + * * \param obj An object * \return A new autoreleased OFArray */ + arrayWithObject: (OFObject*)obj; /** + * Creates a new OFArray with the specified objects, terminated by nil. + * * \param first The first object in the array * \return A new autoreleased OFArray */ + arrayWithObjects: (OFObject*)first, ...; /** + * Creates a new OFArray with the objects from the specified C array. + * * \param objs A C array of objects. * \return A new autoreleased OFArray */ + arrayWithCArray: (OFObject**)objs; @@ -80,21 +86,21 @@ * \return An initialized OFArray */ - initWithCArray: (OFObject**)objs; /** - * \return The number of objects in the OFArray + * \return The number of objects in the array */ - (size_t)count; /** * \return The objects of the array as a C array */ - (id*)cArray; /** - * Returns a specific object of the OFArray. + * Returns a specific object of the array. * * \param index The number of the object to return * \return The specified object of the OFArray */ - (id)objectAtIndex: (size_t)index; @@ -117,16 +123,16 @@ * the specified object */ - (size_t)indexOfObjectIdenticalTo: (OFObject*)obj; /** - * \return The first object of the OFArray or nil + * \return The first object of the array or nil */ - (id)firstObject; /** - * \return The last object of the OFArray or nil + * \return The last object of the array or nil */ - (id)lastObject; /** * Creates a string by joining all objects of the array. Index: src/OFAutoreleasePool.h ================================================================== --- src/OFAutoreleasePool.h +++ src/OFAutoreleasePool.h @@ -12,12 +12,13 @@ #import "OFObject.h" #import "OFArray.h" #import "OFList.h" /** - * The OFAutoreleasePool class provides a class that keeps track of objects - * that will be released when the autorelease pool is released. + * The OFAutoreleasePool class is a class that keeps track of objects that will + * be released when the autorelease pool is released. + * * Every thread has its own stack of autorelease pools. */ @interface OFAutoreleasePool: OFObject { OFArray *objects; Index: src/OFConstString.h ================================================================== --- src/OFConstString.h +++ src/OFConstString.h @@ -14,9 +14,9 @@ #ifdef OF_APPLE_RUNTIME extern void *_OFConstStringClassReference; #endif /** - * A class for storing static strings using the @"" literal. + * A class for storing constant strings using the @"" literal. */ @interface OFConstString: OFString {} @end Index: src/OFConstString.m ================================================================== --- src/OFConstString.m +++ src/OFConstString.m @@ -149,8 +149,8 @@ - (void)dealloc { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; - [super dealloc]; /* Get rid of stupid warning */ + [super dealloc]; /* Get rid of a stupid warning */ } @end Index: src/OFDataArray.h ================================================================== --- src/OFDataArray.h +++ src/OFDataArray.h @@ -10,12 +10,11 @@ */ #import "OFObject.h" /** - * The OFDataArray class provides a class for storing arbitrary data in an - * array. + * The OFDataArray class is a class for storing arbitrary data in an array. * * If you plan to store large hunks of data, you should consider using * OFBigDataArray, which allocates the memory in pages rather than in bytes. */ @interface OFDataArray: OFObject @@ -142,14 +141,14 @@ - removeNItems: (size_t)nitems atIndex: (size_t)index; @end /** - * The OFBigDataArray class provides a class for storing arbitrary data in an - * array and is designed to store large hunks of data. Therefore, it allocates + * The OFBigDataArray class is a class for storing arbitrary data in an array + * and is designed to store large hunks of data. Therefore, it allocates * memory in pages rather than a chunk of memory for each item. */ @interface OFBigDataArray: OFDataArray { size_t size; } @end Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -20,11 +20,11 @@ OFObject *object; uint32_t hash; }; /** - * The OFDictionary class provides a class for using hash tables. + * The OFDictionary class is a class for using hash tables. */ @interface OFDictionary: OFObject { struct of_dictionary_bucket *data; size_t size; Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -133,12 +133,12 @@ } @try { [dict->data[i].object retain]; } @catch (OFException *e) { - [self dealloc]; [key release]; + [self dealloc]; @throw e; } data[i].key = key; data[i].object = dict->data[i].object; @@ -161,12 +161,12 @@ } @try { [obj retain]; } @catch (OFException *e) { - [self dealloc]; [key release]; + [self dealloc]; @throw e; } data[0].key = key; data[0].object = obj; @@ -244,12 +244,12 @@ } @try { [objs_carray[i] retain]; } @catch (OFException *e) { - [self dealloc]; [key release]; + [self dealloc]; @throw e; } data[j].key = key; data[j].object = objs_carray[i]; @@ -271,12 +271,12 @@ } @try { [data[j].object release]; } @catch (OFException *e) { - [self dealloc]; [objs_carray[i] release]; + [self dealloc]; @throw e; } data[j].object = objs_carray[i]; } @@ -355,12 +355,12 @@ } @try { [obj retain]; } @catch (OFException *e) { - [self dealloc]; [key release]; + [self dealloc]; @throw e; } data[j].key = key; data[j].object = obj; @@ -410,12 +410,12 @@ } @try { [obj retain]; } @catch (OFException *e) { - [self dealloc]; [key release]; + [self dealloc]; @throw e; } data[j].key = key; data[j].object = obj; @@ -437,12 +437,12 @@ } @try { [data[j].object release]; } @catch (OFException *e) { - [self dealloc]; [obj release]; + [self dealloc]; @throw e; } data[j].object = obj; } Index: src/OFExceptions.h ================================================================== --- src/OFExceptions.h +++ src/OFExceptions.h @@ -310,11 +310,11 @@ */ - (size_t)requestedSize; @end /** - * An OFException indicating a read to the file failed. + * An OFException indicating a read on the file failed. */ @interface OFReadFailedException: OFReadOrWriteFailedException {} @end /** Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -129,11 +129,11 @@ @end @interface OFFileSingleton: OFFile @end -/// An OFFile object for stdin. +/// An OFFile object for stdin extern OFFile *of_stdin; -/// An OFFile object for stdout. +/// An OFFile object for stdout extern OFFile *of_stdout; -/// An OFFile object for stderr. +/// An OFFile object for stderr extern OFFile *of_stderr; Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -90,10 +90,13 @@ if (chown([path cString], owner, group)) @throw [OFChangeFileOwnerFailedException newWithClass: self path: path owner: owner group: group]; +#else + @throw [OFNotImplementedException newWithClass: self + selector: _cmd]; #endif } + (void)rename: (OFString*)from to: (OFString*)to Index: src/OFHashes.h ================================================================== --- src/OFHashes.h +++ src/OFHashes.h @@ -32,12 +32,10 @@ /** * \return A new autoreleased MD5 Hash */ + md5Hash; -- init; - /** * Adds a buffer to the hash to be calculated. * * \param buf The buffer which should be included into calculation. * \param size The size of the buffer @@ -68,12 +66,10 @@ /** * \return A new autoreleased SHA1 Hash */ + sha1Hash; -- init; - /** * Adds a buffer to the hash to be calculated. * * \param buf The buffer which should be included into calculation. * \param size The size of the buffer Index: src/OFMutableArray.h ================================================================== --- src/OFMutableArray.h +++ src/OFMutableArray.h @@ -10,12 +10,12 @@ */ #import "OFArray.h" /** - * The OFMutableArray class provides a class for storing, adding and removing - * objects in an array. + * The OFMutableArray class is a class for storing, adding and removing objects + * in an array. */ @interface OFMutableArray: OFArray {} /** * Adds an object to the OFArray. * Index: src/OFMutableDictionary.h ================================================================== --- src/OFMutableDictionary.h +++ src/OFMutableDictionary.h @@ -10,11 +10,11 @@ */ #import "OFDictionary.h" /** - * The OFMutableDictionary class provides a class for using mutable hash tables. + * The OFMutableDictionary class is a class for using mutable hash tables. */ @interface OFMutableDictionary: OFDictionary {} /** * Sets a key to an object. A key can be any object. * Index: src/OFThread.h ================================================================== --- src/OFThread.h +++ src/OFThread.h @@ -57,11 +57,11 @@ * To use it, you should create a new class derived from it and reimplement * main. */ @interface OFThread: OFObject { - OFObject *object; + id object; of_thread_t thread; BOOL running; @public id retval; Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -16,11 +16,11 @@ main.m IPHONE_USER = mobile IPHONE_TMP = /tmp/objfw-test -.PHONY: run run-tests +.PHONY: run run-tests run-on-iphone run: all if [ -z "${DONT_RUN_TESTS}" ]; then ${MAKE} ${MFLAGS} run-tests; fi run-tests: rm -f libobjfw.so.0 libobjfw.so.0.1 libobjfw.dll libobjfw.dylib Index: tests/objc_sync/Makefile ================================================================== --- tests/objc_sync/Makefile +++ tests/objc_sync/Makefile @@ -22,5 +22,6 @@ include ../../buildsys.mk CPPFLAGS += -I../../src -I../.. LIBS := -L../../src -lobjfw ${LIBS} +LD = ${OBJC}