From db559aa991de805e2a22ecfe2613c5687a85eee0 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Thu, 16 Mar 2023 20:35:33 -0400 Subject: Fix some compiler warnings --- segmenttree.c | 6 +++--- 1 file 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); } -- cgit v1.2.3-70-g09d2