@@ -1,8 +1,8 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 - * Jonathan Schleifer + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 + * Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -282,22 +282,15 @@ + (instancetype)streamWithStream: (OFStream*)stream { return [[[self alloc] initWithStream: stream] autorelease]; } -- init -{ - OF_INVALID_INIT_METHOD -} - - initWithStream: (OFStream*)stream { - self = [super init]; + self = [self init]; _stream = [stream retain]; - _bitIndex = 8; /* 0-7 address the bit, 8 means fetch next byte */ - _slidingWindowMask = 0x7FFF; return self; } - (void)dealloc @@ -305,10 +298,24 @@ [_stream release]; [super dealloc]; } #endif + +- init +{ + self = [super init]; + + _bitIndex = 8; /* 0-7 address the bit, 8 means fetch next byte */ +#ifdef DEFLATE64 + _slidingWindowMask = 0xFFFF; +#else + _slidingWindowMask = 0x7FFF; +#endif + + return self; +} - (size_t)lowlevelReadIntoBuffer: (void*)buffer_ length: (size_t)length { uint8_t *buffer = buffer_;