Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -218,15 +218,15 @@ _itemSize = 1; _count = [string cStringLengthWithEncoding: OF_STRING_ENCODING_ASCII]; - if (_count & 1) + if (_count % 2 != 0) @throw [OFInvalidFormatException exceptionWithClass: [self class]]; - _count >>= 1; + _count /= 2; cString = [string cStringWithEncoding: OF_STRING_ENCODING_ASCII]; _items = [self allocMemoryWithSize: _count]; for (i = 0; i < _count; i++) { Index: src/OFDictionary_hashtable.m ================================================================== --- src/OFDictionary_hashtable.m +++ src/OFDictionary_hashtable.m @@ -211,11 +211,17 @@ exceptionWithClass: [self class] selector: _cmd]; count = 1; for (; va_arg(argumentsCopy, id) != nil; count++); - count >>= 1; + + if (count % 2 != 0) + @throw [OFInvalidArgumentException + exceptionWithClass: [self class] + selector: _cmd]; + + count /= 2; _mapTable = [[OFMapTable alloc] initWithKeyFunctions: keyFunctions valueFunctions: valueFunctions capacity: count]; Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -303,21 +303,20 @@ OFURL *URL = [request URL]; OFTCPSocket *socket; [self close]; - if ([[URL scheme] isEqual: @"http"]) - socket = [OFTCPSocket socket]; - else { + if ([[URL scheme] isEqual: @"https"]) { if (of_tls_socket_class == Nil) @throw [OFUnsupportedProtocolException exceptionWithClass: [self class] URL: URL]; socket = [[[of_tls_socket_class alloc] init] autorelease]; - } + } else + socket = [OFTCPSocket socket]; if ([_delegate respondsToSelector: @selector(client:didCreateSocket:request:)]) [_delegate client: self didCreateSocket: socket Index: src/OFMapTable.m ================================================================== --- src/OFMapTable.m +++ src/OFMapTable.m @@ -138,13 +138,13 @@ capacity > UINT32_MAX / sizeof(*_buckets) || capacity > UINT32_MAX / 8) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; - for (_capacity = 1; _capacity < capacity; _capacity <<= 1); + for (_capacity = 1; _capacity < capacity; _capacity *= 2); if (capacity * 8 / _capacity >= 6) - _capacity <<= 1; + _capacity *= 2; if (_capacity < MIN_CAPACITY) _capacity = MIN_CAPACITY; _buckets = [self allocMemoryWithSize: sizeof(*_buckets) @@ -299,13 +299,13 @@ @throw [OFOutOfRangeException exceptionWithClass: [self class]]; fullness = count * 8 / _capacity; if (fullness >= 6) - capacity = _capacity << 1; + capacity = _capacity * 2; else if (fullness <= 1) - capacity = _capacity >> 1; + capacity = _capacity / 2; else return; /* * Don't downsize if we have an initial capacity or if we would fall Index: src/OFString+XMLUnescaping.m ================================================================== --- src/OFString+XMLUnescaping.m +++ src/OFString+XMLUnescaping.m @@ -48,15 +48,15 @@ entity++; length--; for (i = 0; i < length; i++) { if (entity[i] >= '0' && entity[i] <= '9') - c = (c << 4) + (entity[i] - '0'); + c = (c << 4) | (entity[i] - '0'); else if (entity[i] >= 'A' && entity[i] <= 'F') - c = (c << 4) + (entity[i] - 'A' + 10); + c = (c << 4) | (entity[i] - 'A' + 10); else if (entity[i] >= 'a' && entity[i] <= 'f') - c = (c << 4) + (entity[i] - 'a' + 10); + c = (c << 4) | (entity[i] - 'a' + 10); else return nil; } } else { for (i = 0; i < length; i++) { Index: src/runtime/hashtable.m ================================================================== --- src/runtime/hashtable.m +++ src/runtime/hashtable.m @@ -76,11 +76,11 @@ hash = objc_hash_string(key); assert(h->count + 1 <= UINT32_MAX / 4); if ((h->count + 1) * 4 / (h->last_idx + 1) >= 3) { struct objc_hashtable_bucket **ndata; - uint32_t nsize = (h->last_idx + 1) << 1; + uint32_t nsize = (h->last_idx + 1) * 2; assert(nsize > 0); ndata = malloc(nsize * sizeof(struct objc_hashtable_bucket*)); if (ndata == NULL) Index: src/runtime/sparsearray.m ================================================================== --- src/runtime/sparsearray.m +++ src/runtime/sparsearray.m @@ -127,11 +127,11 @@ void objc_sparsearray_set(struct objc_sparsearray *s, uint32_t idx, const void *obj) { #ifdef OF_SELUID24 uint8_t i = idx >> 16; - uint8_t j = idx >> 8; + uint8_t j = idx >> 8; uint8_t k = idx; #else uint8_t i = idx >> 8; uint8_t j = idx; #endif