Index: src/OFDeflateStream.m ================================================================== --- src/OFDeflateStream.m +++ src/OFDeflateStream.m @@ -48,11 +48,11 @@ #define AWAIT_DISTANCE OF_DEFLATE_STREAM_AWAIT_DISTANCE #define AWAIT_DISTANCE_EXTRA_BITS OF_DEFLATE_STREAM_AWAIT_DISTANCE_EXTRA_BITS #define PROCESS_PAIR OF_DEFLATE_STREAM_PROCESS_PAIR #define BUFFER_SIZE OF_DEFLATE_STREAM_BUFFER_SIZE -#define MAX_BITS 15 +#define MAX_BITS 15 struct huffman_tree { struct huffman_tree *leafs[2]; uint16_t value; }; Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -173,31 +173,31 @@ + (void)sleepForTimeInterval: (double)seconds { if (seconds < 0) @throw [OFOutOfRangeException exception]; -#if defined(HAVE_NANOSLEEP) +#if defined(_WIN32) + if (seconds * 1000 > UINT_MAX) + @throw [OFOutOfRangeException exception]; + + Sleep((unsigned int)(seconds * 1000)); +#elif defined(HAVE_NANOSLEEP) struct timespec rqtp; rqtp.tv_sec = (time_t)seconds; rqtp.tv_nsec = lrint((seconds - rqtp.tv_sec) * 1000000000); if (rqtp.tv_sec != floor(seconds)) @throw [OFOutOfRangeException exception]; nanosleep(&rqtp, NULL); -#elif !defined(_WIN32) +#else if (seconds > UINT_MAX) @throw [OFOutOfRangeException exception]; sleep((unsigned int)seconds); usleep((useconds_t)lrint((seconds - floor(seconds)) * 1000000)); -#else - if (seconds * 1000 > UINT_MAX) - @throw [OFOutOfRangeException exception]; - - Sleep((unsigned int)(seconds * 1000)); #endif } + (void)sleepUntilDate: (OFDate*)date { Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -344,11 +344,11 @@ ((value) >> (sizeof(value) * 8 - ((bits) % (sizeof(value) * 8))))) #define OF_ROR(value, bits) \ (((value) >> ((bits) % (sizeof(value) * 8))) | \ ((value) << (sizeof(value) * 8 - ((bits) % (sizeof(value) * 8))))) -#define OF_HASH_INIT(hash) hash = of_hash_seed +#define OF_HASH_INIT(hash) hash = of_hash_seed; #define OF_HASH_ADD(hash, byte) \ { \ hash += (uint8_t)(byte); \ hash += (hash << 10); \ hash ^= (hash >> 6); \