Skip to content

Commit

Permalink
fix new operator precedence lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ntBre committed Jan 19, 2025
1 parent e8963fd commit 9ca30fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ pub fn drawbar(state: &mut State, m: *mut Monitor) {
let w = textw(&mut state.drw, &text, state.lrpad);
drw::setscheme(
&mut state.drw,
state.scheme[if ((*m).tagset[(*m).seltags as usize] & 1 << i)
state.scheme[if ((*m).tagset[(*m).seltags as usize] & (1 << i))
!= 0
{
Scheme::Sel
Expand All @@ -1486,10 +1486,10 @@ pub fn drawbar(state: &mut State, m: *mut Monitor) {
state.bh as u32,
state.lrpad as u32 / 2,
&text,
(urg as i32) & 1 << i,
(urg as i32) & (1 << i),
);

if (occ & 1 << i) != 0 {
if (occ & (1 << i)) != 0 {
drw::rect(
&mut state.drw,
x + boxs as i32,
Expand All @@ -1498,9 +1498,9 @@ pub fn drawbar(state: &mut State, m: *mut Monitor) {
boxw,
(m == state.selmon
&& !(*state.selmon).sel.is_null()
&& ((*(*state.selmon).sel).tags & 1 << i) != 0)
&& ((*(*state.selmon).sel).tags & (1 << i)) != 0)
as c_int,
(urg & 1 << i) != 0,
(urg & (1 << i)) != 0,
);
}
x += w as i32;
Expand Down
6 changes: 3 additions & 3 deletions src/key_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub(crate) fn view(state: &mut State, arg: *const Arg) {
pertag.curtag = 0;
} else {
let mut i;
cfor!((i = 0; ((*arg).ui() & 1 << i) == 0; i += 1) {});
cfor!((i = 0; ((*arg).ui() & (1 << i)) == 0; i += 1) {});
pertag.curtag = i + 1;
}
} else {
Expand Down Expand Up @@ -442,10 +442,10 @@ pub(crate) fn toggleview(state: &mut State, arg: *const Arg) {
}

// test if the user did not select the same tag
if (newtagset & 1 << ((*state.selmon).pertag.curtag - 1)) == 0 {
if (newtagset & (1 << ((*state.selmon).pertag.curtag - 1))) == 0 {
(*state.selmon).pertag.prevtag = (*state.selmon).pertag.curtag;
let mut i;
cfor!((i = 0; (newtagset & 1 << i) == 0; i += 1) {});
cfor!((i = 0; (newtagset & (1 << i)) == 0; i += 1) {});
(*state.selmon).pertag.curtag = i + 1;
}

Expand Down

0 comments on commit 9ca30fb

Please sign in to comment.