diff --git a/src/add-ons/kernel/cpu/x86/generic_x86.cpp b/src/add-ons/kernel/cpu/x86/generic_x86.cpp index 10d667d24a..1bd3b23b7a 100644 --- a/src/add-ons/kernel/cpu/x86/generic_x86.cpp +++ b/src/add-ons/kernel/cpu/x86/generic_x86.cpp @@ -139,7 +139,7 @@ generic_mtrr_compute_physical_mask(void) cpuid_info cpuInfo; if (get_current_cpuid(&cpuInfo, 0x80000000) == B_OK - && cpuInfo.eax_0.max_eax & 0xff >= 8) { + && (cpuInfo.eax_0.max_eax & 0xff) >= 8) { get_current_cpuid(&cpuInfo, 0x80000008); bits = cpuInfo.regs.eax & 0xff; diff --git a/src/add-ons/kernel/drivers/audio/echo/multi.cpp b/src/add-ons/kernel/drivers/audio/echo/multi.cpp index 0fbfb093f6..ebd5ee852b 100644 --- a/src/add-ons/kernel/drivers/audio/echo/multi.cpp +++ b/src/add-ons/kernel/drivers/audio/echo/multi.cpp @@ -740,7 +740,7 @@ echo_buffer_exchange(echo_dev *card, multi_buffer_info *data) if ((stream->state & ECHO_STATE_STARTED) != 0) continue; echo_stream_start(stream, - (stream->use & ECHO_USE_PLAY == 0) ? echo_record_inth : echo_play_inth, stream); + ((stream->use & ECHO_USE_PLAY) == 0) ? echo_record_inth : echo_play_inth, stream); } if (acquire_sem_etc(card->buffer_ready_sem, 1, B_RELATIVE_TIMEOUT | B_CAN_INTERRUPT, 50000) diff --git a/src/add-ons/kernel/network/protocols/udp/udp.cpp b/src/add-ons/kernel/network/protocols/udp/udp.cpp index 17c9d7691c..62d665a579 100644 --- a/src/add-ons/kernel/network/protocols/udp/udp.cpp +++ b/src/add-ons/kernel/network/protocols/udp/udp.cpp @@ -389,14 +389,14 @@ UdpDomainSupport::_Bind(UdpEndpoint *endpoint, const sockaddr *address) if (otherEndpoint->LocalAddress().EqualPorts(address)) { // port is already bound, SO_REUSEADDR or SO_REUSEPORT is required: - if (otherEndpoint->Socket()->options & (SO_REUSEADDR | SO_REUSEPORT) == 0 - || socketOptions & (SO_REUSEADDR | SO_REUSEPORT) == 0) + if ((otherEndpoint->Socket()->options & (SO_REUSEADDR | SO_REUSEPORT)) == 0 + || (socketOptions & (SO_REUSEADDR | SO_REUSEPORT)) == 0) return EADDRINUSE; // if both addresses are the same, SO_REUSEPORT is required: if (otherEndpoint->LocalAddress().EqualTo(address, false) - && (otherEndpoint->Socket()->options & SO_REUSEPORT == 0 - || socketOptions & SO_REUSEPORT == 0)) + && ((otherEndpoint->Socket()->options & SO_REUSEPORT) == 0 + || (socketOptions & SO_REUSEPORT) == 0)) return EADDRINUSE; } } diff --git a/src/add-ons/print/drivers/pdf/source/PDFWriter.cpp b/src/add-ons/print/drivers/pdf/source/PDFWriter.cpp index 81a64f0c23..0f0647f7e6 100644 --- a/src/add-ons/print/drivers/pdf/source/PDFWriter.cpp +++ b/src/add-ons/print/drivers/pdf/source/PDFWriter.cpp @@ -746,7 +746,7 @@ PDFWriter::CreatePattern() for (int8 y = 0; y <= 7; y ++, data ++) { uint8 d = *data; for (int8 x = 0; x <= 7; x ++, d >>= 1) { - if (d & 1 == 1) { // foreground + if ((d & 1) == 1) { // foreground if (pass != kPassForeground) continue; } else { // background if (pass != kPassBackground) continue; @@ -1059,7 +1059,7 @@ PDFWriter::IsTransparentRGBA15(uint8* in) // 01234567 01234567 // 01201234 00123434 // GGGBBBBB ARRRRRGG - return in[1] & 1 == 0 || IsTransparentRGB15(in); + return (in[1] & 1) == 0 || IsTransparentRGB15(in); } @@ -1070,7 +1070,7 @@ PDFWriter::IsTransparentRGBA15_BIG(uint8* in) // 01234567 01234567 // 00123434 01201234 // ARRRRRGG GGGBBBBB - return in[0] & 1 == 0 || IsTransparentRGB15_BIG(in); + return (in[0] & 1) == 0 || IsTransparentRGB15_BIG(in); } diff --git a/src/add-ons/translators/tga/TGATranslator.cpp b/src/add-ons/translators/tga/TGATranslator.cpp index 7b0a97756c..bf0111dcfa 100644 --- a/src/add-ons/translators/tga/TGATranslator.cpp +++ b/src/add-ons/translators/tga/TGATranslator.cpp @@ -328,7 +328,7 @@ identify_tga_header(BPositionIO *inSource, translator_info *outInfo, imagespec.descriptor = buf[17]; // images ordered from Right to Left (rather than Left to Right) // are not supported - if (imagespec.descriptor & TGA_ORIGIN_HORZ_BIT == TGA_ORIGIN_RIGHT) + if ((imagespec.descriptor & TGA_ORIGIN_HORZ_BIT) == TGA_ORIGIN_RIGHT) return B_NO_TRANSLATOR; // unused descriptor bits, these bits must be zero if (imagespec.descriptor & TGA_DESC_BITS76) @@ -336,23 +336,23 @@ identify_tga_header(BPositionIO *inSource, translator_info *outInfo, if ((fileheader.imagetype == TGA_NOCOMP_TRUECOLOR || fileheader.imagetype == TGA_RLE_TRUECOLOR) && imagespec.depth == 32 && - imagespec.descriptor & TGA_DESC_ALPHABITS != 8 && - imagespec.descriptor & TGA_DESC_ALPHABITS != 0) + (imagespec.descriptor & TGA_DESC_ALPHABITS) != 8 && + (imagespec.descriptor & TGA_DESC_ALPHABITS) != 0) return B_NO_TRANSLATOR; if ((fileheader.imagetype == TGA_NOCOMP_TRUECOLOR || fileheader.imagetype == TGA_RLE_TRUECOLOR) && imagespec.depth == 24 && - imagespec.descriptor & TGA_DESC_ALPHABITS != 0) + (imagespec.descriptor & TGA_DESC_ALPHABITS) != 0) return B_NO_TRANSLATOR; if ((fileheader.imagetype == TGA_NOCOMP_TRUECOLOR || fileheader.imagetype == TGA_RLE_TRUECOLOR) && imagespec.depth == 16 && - imagespec.descriptor & TGA_DESC_ALPHABITS != 1 && - imagespec.descriptor & TGA_DESC_ALPHABITS != 0) + (imagespec.descriptor & TGA_DESC_ALPHABITS) != 1 && + (imagespec.descriptor & TGA_DESC_ALPHABITS) != 0) if ((fileheader.imagetype == TGA_NOCOMP_TRUECOLOR || fileheader.imagetype == TGA_RLE_TRUECOLOR) && imagespec.depth == 15 && - imagespec.descriptor & TGA_DESC_ALPHABITS != 0) + (imagespec.descriptor & TGA_DESC_ALPHABITS) != 0) return B_NO_TRANSLATOR; // Fill in headers passed to this function diff --git a/src/apps/deskcalc/CalcView.cpp b/src/apps/deskcalc/CalcView.cpp index 450689b207..b6634595a8 100644 --- a/src/apps/deskcalc/CalcView.cpp +++ b/src/apps/deskcalc/CalcView.cpp @@ -335,7 +335,7 @@ CalcView::Draw(BRect updateRect) FillRect(updateRect & keypadRect); // render key main grid - BeginLineArray((fColums + fRows) << 1 + 1); + BeginLineArray(((fColums + fRows) << 1) + 1); // render cols AddLine(BPoint(0.0, sizeDisp), diff --git a/src/bin/screen_blanker/ScreenBlanker.cpp b/src/bin/screen_blanker/ScreenBlanker.cpp index af8acb8389..ea3c45985a 100644 --- a/src/bin/screen_blanker/ScreenBlanker.cpp +++ b/src/bin/screen_blanker/ScreenBlanker.cpp @@ -172,10 +172,10 @@ ScreenBlanker::_QueueTurnOffScreen() return; if (fSettings.OffTime() == fSettings.SuspendTime() - && (flags & (ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND)) == ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND) + && (flags & (ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND)) == (ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND)) flags &= ~ENABLE_DPMS_SUSPEND; if (fSettings.SuspendTime() == fSettings.StandByTime() - && (flags & (ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY)) == ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY) + && (flags & (ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY)) == (ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY)) flags &= ~ENABLE_DPMS_STAND_BY; // start them off again diff --git a/src/preferences/screen/ScreenMode.cpp b/src/preferences/screen/ScreenMode.cpp index 8a1bedd20d..99cfcf8df2 100644 --- a/src/preferences/screen/ScreenMode.cpp +++ b/src/preferences/screen/ScreenMode.cpp @@ -31,7 +31,7 @@ static combine_mode get_combine_mode(display_mode& mode) { - if (mode.flags & B_SCROLL == 0) + if ((mode.flags & B_SCROLL) == 0) return kCombineDisable; if (mode.virtual_width == mode.timing.h_display * 2) diff --git a/src/system/boot/loader/file_systems/fat/Directory.cpp b/src/system/boot/loader/file_systems/fat/Directory.cpp index b1e59969e4..fbadb5181c 100644 --- a/src/system/boot/loader/file_systems/fat/Directory.cpp +++ b/src/system/boot/loader/file_systems/fat/Directory.cpp @@ -282,7 +282,7 @@ Directory::GetNextEntry(void *cookie, uint8 mask, uint8 match) continue; if (c->entry.Flags() == 0x0f) // LFN entry continue; - if (c->entry.Flags() & (FAT_VOLUME|FAT_SUBDIR) == FAT_VOLUME) { + if ((c->entry.Flags() & (FAT_VOLUME|FAT_SUBDIR)) == FAT_VOLUME) { // TODO handle Volume name (set fVolume's name) continue; } diff --git a/src/system/boot/loader/file_systems/fat/Volume.cpp b/src/system/boot/loader/file_systems/fat/Volume.cpp index 198f7601b9..83190f9590 100644 --- a/src/system/boot/loader/file_systems/fat/Volume.cpp +++ b/src/system/boot/loader/file_systems/fat/Volume.cpp @@ -253,7 +253,7 @@ Volume::IsValidCluster(uint32 cluster) const bool Volume::IsLastCluster(uint32 cluster) const { - if (cluster >= fTotalClusters && (cluster & 0xff8 == 0xff8)) + if (cluster >= fTotalClusters && ((cluster & 0xff8) == 0xff8)) return true; return false; }