summaryrefslogtreecommitdiff
path: root/lisp/battery.el
diff options
context:
space:
mode:
authorBasil L. Contovounesios <contovob@tcd.ie>2022-08-17 20:11:25 +0300
committerBasil L. Contovounesios <contovob@tcd.ie>2022-08-17 20:11:25 +0300
commit31f289625cb3f72d167f1f9cac246269eeb5c716 (patch)
treea5199c885941be40be25bb9328407378700c5855 /lisp/battery.el
parent78460500c75ab3f36ea646a1266ac6803f2d16e6 (diff)
downloademacs-31f289625cb3f72d167f1f9cac246269eeb5c716.tar.gz
emacs-31f289625cb3f72d167f1f9cac246269eeb5c716.tar.bz2
emacs-31f289625cb3f72d167f1f9cac246269eeb5c716.zip
Fix Linux APM BIOS flag testing in battery.el
Original sin detected by recent byte-compiler improvements; see: https://lists.gnu.org/r/emacs-devel/2022-08/msg00611.html * lisp/battery.el (battery-linux-proc-apm): Treat result of logand as a number, not boolean.
Diffstat (limited to 'lisp/battery.el')
-rw-r--r--lisp/battery.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/battery.el b/lisp/battery.el
index 93f4070e4bc..72b3dfdae7c 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -369,11 +369,11 @@ The following %-sequences are provided:
(setq driver-version (match-string 1))
(setq bios-version (match-string 2))
(setq tem (string-to-number (match-string 3) 16))
- (if (not (logand tem 2))
+ (if (zerop (logand tem 2))
(setq bios-interface "not supported")
(setq bios-interface "enabled")
- (cond ((logand tem 16) (setq bios-interface "disabled"))
- ((logand tem 32) (setq bios-interface "disengaged")))
+ (cond ((/= (logand tem 16) 0) (setq bios-interface "disabled"))
+ ((/= (logand tem 32) 0) (setq bios-interface "disengaged")))
(setq tem (string-to-number (match-string 4) 16))
(cond ((= tem 0) (setq line-status "off-line"))
((= tem 1) (setq line-status "on-line"))