Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid potential uninitialzed variables
Reported-by clang: src/linux/btop_collect.cpp:489:10: error: variable 'high' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] 489 | if (high < 1) high = 80; | ^~~~ src/linux/btop_collect.cpp:482:18: note: initialize the variable 'high' to silence this warning 482 | int64_t high, crit; | ^ | = 0 src/linux/btop_collect.cpp:490:10: error: variable 'crit' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] 490 | if (crit < 1) crit = 95; | ^~~~ src/linux/btop_collect.cpp:482:24: note: initialize the variable 'crit' to silence this warning 482 | int64_t high, crit; | ^ | = 0 src/linux/btop_collect.cpp:1648:29: error: variable 'totalMem' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] 1648 | if (not meminfo.good() or totalMem == 0) | ^~~~~~~~ src/linux/btop_collect.cpp:1642:19: note: initialize the variable 'totalMem' to silence this warning 1642 | int64_t totalMem; | ^ | = 0
- Loading branch information