aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2023-03-16 20:35:33 -0400
committerAnthony Wang2023-03-16 20:35:33 -0400
commitdb559aa991de805e2a22ecfe2613c5687a85eee0 (patch)
tree971fa3a71e8b4df9bef036554c1c36fd990c90da
parentb1b2e1c5219ebade519ae36a0af2d922c1dd3729 (diff)
Fix some compiler warnings
-rw-r--r--segmenttree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/segmenttree.c b/segmenttree.c
index e9f38da..efd2fb7 100644
--- a/segmenttree.c
+++ b/segmenttree.c
@@ -9,7 +9,7 @@ void build(sqlite3_stmt *stmt, int l, int r, int n) {
seg[n] = sqlite3_column_int(stmt, 0);
return;
}
- int m = l + r >> 1;
+ int m = (l + r) >> 1;
build(stmt, l, m, n << 1);
build(stmt, m + 1, r, n << 1 | 1);
seg[n] = seg[n << 1] + seg[n << 1 | 1];
@@ -21,7 +21,7 @@ void update(int x, int v, int l, int r, int n) {
seg[n] = v;
return;
}
- int m = l + r >> 1;
+ int m = (l + r) >> 1;
if (x <= m) {
update(x, v, l, m, n<<1);
}
@@ -38,7 +38,7 @@ void query(int *res, int v, int l, int r, int n) {
res[1] = l;
return;
}
- int m = l + r >> 1;
+ int m = (l + r) >> 1;
if (seg[n << 1] > v) {
query(res, v, l, m, n << 1);
}