@@ -31,17 +31,17 @@ madvise((void*)str, len, MADV_SEQUENTIAL); for (i = 0; i < len; i++) { /* No sign of UTF-8 here */ - if (OF_LIKELY(~str[i] & 0x80)) + if (OF_LIKELY(!(str[i] & 0x80))) continue; utf8 = YES; /* We're missing a start byte here */ - if (OF_UNLIKELY(~str[i] & 0x40)) { + if (OF_UNLIKELY(!(str[i] & 0x40))) { madvise((void*)str, len, MADV_NORMAL); return -1; } /* We have at minimum a 2 byte character -> check next byte */ @@ -49,11 +49,11 @@ madvise((void*)str, len, MADV_NORMAL); return -1; } /* Check if we have at minimum a 3 byte character */ - if (OF_LIKELY(~str[i] & 0x20)) { + if (OF_LIKELY(!(str[i] & 0x20))) { i++; continue; } /* We have at minimum a 3 byte char -> check second next byte */ @@ -61,11 +61,11 @@ madvise((void*)str, len, MADV_NORMAL); return -1; } /* Check if we have a 4 byte character */ - if (OF_LIKELY(~str[i] & 0x10)) { + if (OF_LIKELY(!(str[i] & 0x10))) { i += 2; continue; } /* We have a 4 byte character -> check third next byte */ @@ -216,21 +216,21 @@ return self; } for (i = 0; i < length; i++) { /* ASCII */ - if (OF_LIKELY(~string[i] & 0x80)) + if (OF_LIKELY(!(string[i] & 0x80))) 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 newWithObject: self]; } /* Next byte must not be ASCII */ - if (OF_UNLIKELY(length < i + 1 || ~string[i + 1] & 0x80)) { + if (OF_UNLIKELY(length < i + 1 || !(string[i + 1] & 0x80))) { madvise(string, len, MADV_NORMAL); @throw [OFInvalidEncodingException newWithObject: self]; } /* Next byte is the start byte */ @@ -242,11 +242,11 @@ i++; continue; } /* Second next byte must not be ASCII */ - if (OF_UNLIKELY(length < i + 2 || ~string[i + 2] & 0x80)) { + if (OF_UNLIKELY(length < i + 2 || !(string[i + 2] & 0x80))) { madvise(string, len, MADV_NORMAL); @throw [OFInvalidEncodingException newWithObject: self]; } /* Second next byte is the start byte */ @@ -258,11 +258,11 @@ i += 2; continue; } /* Third next byte must not be ASCII */ - if (OF_UNLIKELY(length < i + 3 || ~string[i + 3] & 0x80)) { + if (OF_UNLIKELY(length < i + 3 || !(string[i + 3] & 0x80))) { madvise(string, len, MADV_NORMAL); @throw [OFInvalidEncodingException newWithObject: self]; } /* Third next byte is the start byte */