summaryrefslogtreecommitdiff
path: root/cpufreq
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-09-05 19:48:03 +0200
committerZenWalker <[email protected]>2019-09-10 14:43:33 +0200
commitd839dfb7516dcc88f3766b3af572d52b04d8bc5c (patch)
treeafb0e105e918a39fc312d73f73409113f7daed81 /cpufreq
parent4a3dcc61aeaa31b1403288a65c9074e7d24a8dfe (diff)
downloadmate-applets-d839dfb7516dcc88f3766b3af572d52b04d8bc5c.tar.bz2
mate-applets-d839dfb7516dcc88f3766b3af572d52b04d8bc5c.tar.xz
cpufreq: remove -Wabsolute-value warning
cpufreq-selector-sysfs.c:244:18: warning: taking the absolute value of unsigned type ‘guint’ {aka ‘unsigned int’} has no effect [-Wabsolute-value] 244 | current_dist = abs (frequency - f); | ^~~ -- cpufreq-selector-procfs.c:187:7: warning: taking the absolute value of unsigned type ‘guint’ {aka ‘unsigned int’} has no effect [-Wabsolute-value] 187 | if (abs (sc_max - frequency) < abs (frequency - sc_min)) | ^~~ cpufreq-selector-procfs.c:187:34: warning: taking the absolute value of unsigned type ‘guint’ {aka ‘unsigned int’} has no effect [-Wabsolute-value] 187 | if (abs (sc_max - frequency) < abs (frequency - sc_min)) | ^~~ -- cpufreq-selector-libcpufreq.c:109:18: warning: taking the absolute value of unsigned type ‘long unsigned int’ has no effect [-Wabsolute-value] 109 | current_dist = abs (freq->frequency - frequency); | ^~~
Diffstat (limited to 'cpufreq')
-rw-r--r--cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c2
-rw-r--r--cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c2
-rw-r--r--cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c b/cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c
index d2fda2bf..d56364b5 100644
--- a/cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c
+++ b/cpufreq/src/cpufreq-selector/cpufreq-selector-libcpufreq.c
@@ -106,7 +106,7 @@ cpufreq_selector_libcpufreq_get_valid_frequency (CPUFreqSelectorLibcpufreq *sele
return frequency;
}
- current_dist = abs (freq->frequency - frequency);
+ current_dist = abs ((int)freq->frequency - (int)frequency);
if (current_dist < dist) {
dist = current_dist;
retval = freq->frequency;
diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c b/cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c
index 3ee43c47..69ecaf77 100644
--- a/cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c
+++ b/cpufreq/src/cpufreq-selector/cpufreq-selector-procfs.c
@@ -184,7 +184,7 @@ cpufreq_selector_procfs_set_frequency (CPUFreqSelector *selector,
}
if (frequency != sc_max && frequency != sc_min) {
- if (abs (sc_max - frequency) < abs (frequency - sc_min))
+ if (abs ((int)sc_max - (int)frequency) < abs ((int)frequency - (int)sc_min))
freq = sc_max;
else
freq = sc_min;
diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
index 1cb87660..c1b0850c 100644
--- a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
+++ b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
@@ -241,7 +241,7 @@ cpufreq_selector_sysfs_get_valid_frequency (CPUFreqSelectorSysfs *selector,
if (f == frequency)
return freq;
- current_dist = abs (frequency - f);
+ current_dist = abs ((int)frequency - (int)f);
if (current_dist < dist) {
dist = current_dist;
retval = freq;