summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/OFDNSResolver.m2
-rw-r--r--src/OFKernelEventObserver.m2
-rw-r--r--src/OFLHADecompressingStream.m4
-rw-r--r--src/OFSelectKernelEventObserver.m4
-rw-r--r--src/OFSystemInfo.m18
-rw-r--r--src/OFZIPArchive.m6
-rw-r--r--src/OFZIPArchiveEntry.m2
-rw-r--r--src/condition_amiga.m4
-rw-r--r--src/huffman_tree.m2
-rw-r--r--src/macros.h6
-rw-r--r--src/runtime/exception.m4
-rw-r--r--src/thread_amiga.m2
12 files changed, 28 insertions, 28 deletions
diff --git a/src/OFDNSResolver.m b/src/OFDNSResolver.m
index 4190d12f..a65ef79a 100644
--- a/src/OFDNSResolver.m
+++ b/src/OFDNSResolver.m
@@ -746,7 +746,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
count: 2];
/* RD */
- tmp = OF_BSWAP16_IF_LE(1 << 8);
+ tmp = OF_BSWAP16_IF_LE(1u << 8);
[queryData addItems: &tmp
count: 2];
diff --git a/src/OFKernelEventObserver.m b/src/OFKernelEventObserver.m
index 1cdb0d03..91a1952f 100644
--- a/src/OFKernelEventObserver.m
+++ b/src/OFKernelEventObserver.m
@@ -430,7 +430,7 @@ enum {
Forbid();
if (_waitingTask != NULL) {
- Signal(_waitingTask, (1 << _cancelSignal));
+ Signal(_waitingTask, (1ul << _cancelSignal));
_waitingTask = NULL;
}
diff --git a/src/OFLHADecompressingStream.m b/src/OFLHADecompressingStream.m
index ec533cde..1cb88f4e 100644
--- a/src/OFLHADecompressingStream.m
+++ b/src/OFLHADecompressingStream.m
@@ -107,7 +107,7 @@ tryReadBits(OFLHADecompressingStream *stream, uint16_t *bits, uint8_t count)
_distanceBits = distanceBits;
_dictionaryBits = dictionaryBits;
- _slidingWindowMask = (1 << dictionaryBits) - 1;
+ _slidingWindowMask = (1u << dictionaryBits) - 1;
_slidingWindow = [self allocMemoryWithSize:
_slidingWindowMask + 1];
memset(_slidingWindow, ' ', _slidingWindowMask + 1);
@@ -456,7 +456,7 @@ start:
if OF_UNLIKELY (!tryReadBits(self, &bits, _distance - 1))
return bytesWritten;
- _distance = bits + (1 << (_distance - 1));
+ _distance = bits + (1u << (_distance - 1));
_state = STATE_BLOCK_LEN_DIST_PAIR;
goto start;
diff --git a/src/OFSelectKernelEventObserver.m b/src/OFSelectKernelEventObserver.m
index 6429a2f8..6617e7bd 100644
--- a/src/OFSelectKernelEventObserver.m
+++ b/src/OFSelectKernelEventObserver.m
@@ -187,7 +187,7 @@
@throw [OFObserveFailedException exceptionWithObserver: self
errNo: EAGAIN];
- execSignalMask = _execSignalMask | (1 << cancelSignal);
+ execSignalMask = _execSignalMask | (1ul << cancelSignal);
Forbid();
@@ -197,7 +197,7 @@
events = WaitSelect(_maxFD + 1, &readFDs, &writeFDs, NULL,
(void *)(timeInterval != -1 ? &timeout : NULL), &execSignalMask);
- execSignalMask &= ~(1 << cancelSignal);
+ execSignalMask &= ~(1ul << cancelSignal);
_waitingTask = NULL;
FreeSignal(_cancelSignal);
diff --git a/src/OFSystemInfo.m b/src/OFSystemInfo.m
index 39e9b54c..f3263622 100644
--- a/src/OFSystemInfo.m
+++ b/src/OFSystemInfo.m
@@ -584,47 +584,47 @@ x86_cpuid(uint32_t eax, uint32_t ecx)
#if defined(OF_X86_64) || defined(OF_X86)
+ (bool)supportsMMX
{
- return (x86_cpuid(1, 0).edx & (1 << 23));
+ return (x86_cpuid(1, 0).edx & (1u << 23));
}
+ (bool)supportsSSE
{
- return (x86_cpuid(1, 0).edx & (1 << 25));
+ return (x86_cpuid(1, 0).edx & (1u << 25));
}
+ (bool)supportsSSE2
{
- return (x86_cpuid(1, 0).edx & (1 << 26));
+ return (x86_cpuid(1, 0).edx & (1u << 26));
}
+ (bool)supportsSSE3
{
- return (x86_cpuid(1, 0).ecx & (1 << 0));
+ return (x86_cpuid(1, 0).ecx & (1u << 0));
}
+ (bool)supportsSSSE3
{
- return (x86_cpuid(1, 0).ecx & (1 << 9));
+ return (x86_cpuid(1, 0).ecx & (1u << 9));
}
+ (bool)supportsSSE41
{
- return (x86_cpuid(1, 0).ecx & (1 << 19));
+ return (x86_cpuid(1, 0).ecx & (1u << 19));
}
+ (bool)supportsSSE42
{
- return (x86_cpuid(1, 0).ecx & (1 << 20));
+ return (x86_cpuid(1, 0).ecx & (1u << 20));
}
+ (bool)supportsAVX
{
- return (x86_cpuid(1, 0).ecx & (1 << 28));
+ return (x86_cpuid(1, 0).ecx & (1u << 28));
}
+ (bool)supportsAVX2
{
- return x86_cpuid(0, 0).eax >= 7 && (x86_cpuid(7, 0).ebx & (1 << 5));
+ return x86_cpuid(0, 0).eax >= 7 && (x86_cpuid(7, 0).ebx & (1u << 5));
}
#endif
diff --git a/src/OFZIPArchive.m b/src/OFZIPArchive.m
index 35d77316..1dbb012b 100644
--- a/src/OFZIPArchive.m
+++ b/src/OFZIPArchive.m
@@ -518,7 +518,7 @@ seekOrThrowInvalidFormat(OFSeekableStream *stream,
entry.compressedSize = 0;
entry.uncompressedSize = 0;
entry.CRC32 = 0;
- entry.generalPurposeBitFlag |= (1 << 3) | (1 << 11);
+ entry.generalPurposeBitFlag |= (1u << 3) | (1u << 11);
entry.of_localFileHeaderOffset = _offset;
[_stream writeLittleEndianInt32: 0x04034B50];
@@ -656,7 +656,7 @@ seekOrThrowInvalidFormat(OFSeekableStream *stream,
_uncompressedSize = [stream readLittleEndianInt32];
fileNameLength = [stream readLittleEndianInt16];
extraFieldLength = [stream readLittleEndianInt16];
- encoding = (_generalPurposeBitFlag & (1 << 11)
+ encoding = (_generalPurposeBitFlag & (1u << 11)
? OF_STRING_ENCODING_UTF_8
: OF_STRING_ENCODING_CODEPAGE_437);
@@ -717,7 +717,7 @@ seekOrThrowInvalidFormat(OFSeekableStream *stream,
_lastModifiedFileDate != entry.of_lastModifiedFileDate)
return false;
- if (!(_generalPurposeBitFlag & (1 << 3)))
+ if (!(_generalPurposeBitFlag & (1u << 3)))
if (_CRC32 != entry.CRC32 ||
_compressedSize != entry.compressedSize ||
_uncompressedSize != entry.uncompressedSize)
diff --git a/src/OFZIPArchiveEntry.m b/src/OFZIPArchiveEntry.m
index a7b6196b..1e7fdda7 100644
--- a/src/OFZIPArchiveEntry.m
+++ b/src/OFZIPArchiveEntry.m
@@ -239,7 +239,7 @@ of_zip_archive_entry_extra_field_find(OFData *extraField, uint16_t tag,
_versionSpecificAttributes = [stream readLittleEndianInt32];
_localFileHeaderOffset = [stream readLittleEndianInt32];
- encoding = (_generalPurposeBitFlag & (1 << 11)
+ encoding = (_generalPurposeBitFlag & (1u << 11)
? OF_STRING_ENCODING_UTF_8
: OF_STRING_ENCODING_CODEPAGE_437);
diff --git a/src/condition_amiga.m b/src/condition_amiga.m
index ed21c756..bacb352a 100644
--- a/src/condition_amiga.m
+++ b/src/condition_amiga.m
@@ -40,7 +40,7 @@ of_condition_signal(of_condition_t *condition)
return true;
Signal(condition->waitingTasks->task,
- 1 << condition->waitingTasks->sigBit);
+ (1ul << condition->waitingTasks->sigBit));
condition->waitingTasks = condition->waitingTasks->next;
} @finally {
@@ -60,7 +60,7 @@ of_condition_broadcast(of_condition_t *condition)
while (condition->waitingTasks != NULL) {
Signal(condition->waitingTasks->task,
- 1 << condition->waitingTasks->sigBit);
+ (1ul << condition->waitingTasks->sigBit));
condition->waitingTasks = condition->waitingTasks->next;
}
diff --git a/src/huffman_tree.m b/src/huffman_tree.m
index 51be4249..b88614d9 100644
--- a/src/huffman_tree.m
+++ b/src/huffman_tree.m
@@ -48,7 +48,7 @@ insertTree(struct of_huffman_tree *tree, uint16_t code, uint8_t length,
uint8_t bit;
length--;
- bit = (code & (1 << length)) >> length;
+ bit = (code & (1u << length)) >> length;
if (tree->leaves[bit] == NULL)
tree->leaves[bit] = newTree();
diff --git a/src/macros.h b/src/macros.h
index 903b681e..2b0a067b 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -781,19 +781,19 @@ of_le_double_ptr_write(void *_Nonnull ptr, double value)
static OF_INLINE bool
of_bitset_isset(unsigned char *_Nonnull storage, size_t idx)
{
- return storage[idx / 8] & (1 << (idx % 8));
+ return storage[idx / 8] & (1u << (idx % 8));
}
static OF_INLINE void
of_bitset_set(unsigned char *_Nonnull storage, size_t idx)
{
- storage[idx / 8] |= (1 << (idx % 8));
+ storage[idx / 8] |= (1u << (idx % 8));
}
static OF_INLINE void
of_bitset_clear(unsigned char *_Nonnull storage, size_t idx)
{
- storage[idx / 8] &= ~(1 << (idx % 8));
+ storage[idx / 8] &= ~(1u << (idx % 8));
}
static OF_INLINE char *_Nullable
diff --git a/src/runtime/exception.m b/src/runtime/exception.m
index 10cf517e..2f2617a6 100644
--- a/src/runtime/exception.m
+++ b/src/runtime/exception.m
@@ -278,8 +278,8 @@ readSLEB128(const uint8_t **ptr)
value = readULEB128(ptr);
bits = (*ptr - oldPtr) * 7;
- if (bits < 64 && value & (1 << (bits - 1)))
- value |= -(1 << bits);
+ if (bits < 64 && value & (INT64_C(1) << (bits - 1)))
+ value |= -(INT64_C(1) << bits);
return value;
}
diff --git a/src/thread_amiga.m b/src/thread_amiga.m
index 1b4ed864..06f99b5f 100644
--- a/src/thread_amiga.m
+++ b/src/thread_amiga.m
@@ -53,7 +53,7 @@ functionWrapper(void)
if (thread->detached)
detached = true;
else if (thread->joinTask != NULL)
- Signal(thread->joinTask, 1 << thread->joinSigBit);
+ Signal(thread->joinTask, (1ul << thread->joinSigBit));
} @finally {
ReleaseSemaphore(&thread->semaphore);
}