View | Details | Raw Unified | Return to bug 266070
Collapse All | Expand All

(-)b/sysutils/upower/Makefile (-1 / +1 lines)
Lines 1-5 Link Here
1
PORTNAME=	upower
1
PORTNAME=	upower
2
PORTVERSION=	0.99.20
2
PORTVERSION=	1.90.0
3
DISTVERSIONPREFIX=	v
3
DISTVERSIONPREFIX=	v
4
CATEGORIES=	sysutils
4
CATEGORIES=	sysutils
5
MASTER_SITES=	https://gitlab.freedesktop.org/upower/upower/-/archive/${DISTVERSIONFULL}/
5
MASTER_SITES=	https://gitlab.freedesktop.org/upower/upower/-/archive/${DISTVERSIONFULL}/
(-)b/sysutils/upower/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1657781987
1
TIMESTAMP = 1661608460
2
SHA256 (upower-v0.99.20.tar.bz2) = 6b11baeb4e9273def260ca86f2ed482ab4e56e8f4e999b2632d6ba0ea2bccd9a
2
SHA256 (upower-v1.90.0.tar.bz2) = eafa0a367dc0417390984eeb81e9d1a2b449999ba6ad20ed39bf270d0b4e5e77
3
SIZE (upower-v0.99.20.tar.bz2) = 126098
3
SIZE (upower-v1.90.0.tar.bz2) = 129505
(-)b/sysutils/upower/files/patch-src_up-device-battery.c (+28 lines)
Added Link Here
1
--- src/up-device-battery.c.orig	2022-07-21 09:06:49 UTC
2
+++ src/up-device-battery.c
3
@@ -19,6 +19,7 @@
4
  */
5
 
6
 #include <string.h>
7
+#include <math.h>
8
 
9
 #include "up-constants.h"
10
 #include "up-config.h"
11
@@ -125,7 +126,7 @@ up_device_battery_estimate_power (UpDeviceBattery *sel
12
 			continue;
13
 
14
 		/* Stop searching if the new reference is further away from the long timeout. */
15
-		if (abs(UP_DAEMON_LONG_TIMEOUT * G_USEC_PER_SEC - abs (td)) > abs(UP_DAEMON_SHORT_TIMEOUT * G_USEC_PER_SEC - ref_td))
16
+		if (labs(UP_DAEMON_LONG_TIMEOUT * G_USEC_PER_SEC - labs (td)) > labs(UP_DAEMON_SHORT_TIMEOUT * G_USEC_PER_SEC - ref_td))
17
 			break;
18
 
19
 		ref_td = td;
20
@@ -155,7 +156,7 @@ up_device_battery_estimate_power (UpDeviceBattery *sel
21
 	 */
22
 	if (cur->state == UP_DEVICE_STATE_UNKNOWN) {
23
 		/* Consider a rate of 0.5W as "no change", otherwise set CHARGING/DISCHARGING */
24
-		if (abs(energy_rate) < 0.5)
25
+		if (fabs(energy_rate) < 0.5)
26
 			return;
27
 		else if (energy_rate < 0.0)
28
 			cur->state = UP_DEVICE_STATE_DISCHARGING;

Return to bug 266070