@@ -156,11 +156,11 @@ switch (check_utf8(str, length)) { case 1: is_utf8 = YES; break; case -1: - c = [self class]; + c = isa; [super free]; @throw [OFInvalidEncodingException newWithClass: c]; } @@ -196,17 +196,17 @@ int t; Class c; if ((self = [super init])) { if (fmt == NULL) { - c = [self class]; + c = isa; [super free]; @throw [OFInvalidFormatException newWithClass: c]; } if ((t = vasprintf(&string, fmt, args)) == -1) { - c = [self class]; + c = isa; [super free]; @throw [OFInitializationFailedException newWithClass: c]; } length = t; @@ -215,11 +215,11 @@ case 1: is_utf8 = YES; break; case -1: free(string); - c = [self class]; + c = isa; [super free]; @throw [OFInvalidEncodingException newWithClass: c]; } @try { @@ -264,11 +264,11 @@ case -1: string = NULL; length = 0; is_utf8 = NO; - @throw [OFInvalidEncodingException newWithClass: [self class]]; + @throw [OFInvalidEncodingException newWithClass: isa]; } length = len; string = [self getMemWithSize: length + 1]; memcpy(string, str, length + 1); @@ -289,11 +289,11 @@ - (int)compare: (id)obj { if (![obj isKindOf: [OFString class]] && ![obj isKindOf: [OFConstString class]]) - @throw [OFInvalidArgumentException newWithClass: [self class]]; + @throw [OFInvalidArgumentException newWithClass: isa]; return strcmp(string, [obj cString]); } - (uint32_t)hash @@ -324,11 +324,11 @@ switch (check_utf8(str, strlength)) { case 1: is_utf8 = YES; break; case -1: - @throw [OFInvalidEncodingException newWithClass: [self class]]; + @throw [OFInvalidEncodingException newWithClass: isa]; } newlen = length + strlength; newstr = [self resizeMem: string toSize: newlen + 1]; @@ -358,19 +358,19 @@ andArguments: (va_list)args { char *t; if (fmt == NULL) - @throw [OFInvalidFormatException newWithClass: [self class]]; + @throw [OFInvalidFormatException newWithClass: isa]; if ((vasprintf(&t, fmt, args)) == -1) /* * This is only the most likely error to happen. * Unfortunately, as errno isn't always thread-safe, there's * no good way for us to find out what really happened. */ - @throw [OFNoMemException newWithClass: [self class]]; + @throw [OFNoMemException newWithClass: isa]; @try { [self appendCString: t]; } @finally { free(t); @@ -403,19 +403,17 @@ continue; /* A start byte can't happen first as we reversed everything */ if (OF_UNLIKELY(string[i] & 0x40)) { madvise(string, len, MADV_NORMAL); - @throw [OFInvalidEncodingException - newWithClass: [self class]]; + @throw [OFInvalidEncodingException newWithClass: isa]; } /* Next byte must not be ASCII */ if (OF_UNLIKELY(length < i + 1 || !(string[i + 1] & 0x80))) { madvise(string, len, MADV_NORMAL); - @throw [OFInvalidEncodingException - newWithClass: [self class]]; + @throw [OFInvalidEncodingException newWithClass: isa]; } /* Next byte is the start byte */ if (OF_LIKELY(string[i + 1] & 0x40)) { string[i] ^= string[i + 1]; @@ -427,12 +425,11 @@ } /* Second next byte must not be ASCII */ if (OF_UNLIKELY(length < i + 2 || !(string[i + 2] & 0x80))) { madvise(string, len, MADV_NORMAL); - @throw [OFInvalidEncodingException - newWithClass: [self class]]; + @throw [OFInvalidEncodingException newWithClass: isa]; } /* Second next byte is the start byte */ if (OF_LIKELY(string[i + 2] & 0x40)) { string[i] ^= string[i + 2]; @@ -444,12 +441,11 @@ } /* Third next byte must not be ASCII */ if (OF_UNLIKELY(length < i + 3 || !(string[i + 3] & 0x80))) { madvise(string, len, MADV_NORMAL); - @throw [OFInvalidEncodingException - newWithClass: [self class]]; + @throw [OFInvalidEncodingException newWithClass: isa]; } /* Third next byte is the start byte */ if (OF_LIKELY(string[i + 3] & 0x40)) { string[i] ^= string[i + 3]; @@ -464,11 +460,11 @@ continue; } /* UTF-8 does not allow more than 4 bytes per character */ madvise(string, len, MADV_NORMAL); - @throw [OFInvalidEncodingException newWithClass: [self class]]; + @throw [OFInvalidEncodingException newWithClass: isa]; } madvise(string, len, MADV_NORMAL); return self; @@ -477,11 +473,11 @@ - upper { char *p = string + length; if (is_utf8) - @throw [OFInvalidEncodingException newWithClass: [self class]]; + @throw [OFInvalidEncodingException newWithClass: isa]; while (--p >= string) *p = toupper((int)*p); return self; @@ -490,13 +486,13 @@ - lower { char *p = string + length; if (is_utf8) - @throw [OFInvalidEncodingException newWithClass: [self class]]; + @throw [OFInvalidEncodingException newWithClass: isa]; while (--p >= string) *p = tolower((int)*p); return self; } @end