Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Panel Plugins
xfce4-cpufreq-plugin
Commits
f3b4f06c
Verified
Commit
f3b4f06c
authored
Mar 02, 2021
by
Jan Ziak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup: Fix percentile variable names
parent
81c79cb8
Pipeline
#7171
passed with stages
in 1 minute and 4 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
panel-plugin/xfce4-cpufreq-plugin.c
panel-plugin/xfce4-cpufreq-plugin.c
+6
-6
No files found.
panel-plugin/xfce4-cpufreq-plugin.c
View file @
f3b4f06c
...
...
@@ -465,7 +465,7 @@ static void
cpufreq_update_pixmap
(
CpuInfo
*
cpu
)
{
const
gdouble
min_range
=
100
*
1000
;
/* frequency in kHz */
gdouble
freq_9
8
,
normalized_freq
,
range
;
gdouble
freq_9
9
,
normalized_freq
,
range
;
gint
i
,
index
,
total_count
;
GdkPixbuf
*
pixmap
;
...
...
@@ -496,7 +496,7 @@ cpufreq_update_pixmap (CpuInfo *cpu)
{
/* Not enough data to reliably compute the percentile,
* resort to a value that isn't based on statistics */
freq_9
8
=
MAX
(
cpu
->
max_freq_nominal
,
cpu
->
max_freq_measured
);
freq_9
9
=
MAX
(
cpu
->
max_freq_nominal
,
cpu
->
max_freq_measured
);
}
else
{
...
...
@@ -508,15 +508,15 @@ cpufreq_update_pixmap (CpuInfo *cpu)
percentile_2
-=
count
;
else
{
freq_9
8
=
FREQ_HIST_MIN
+
i
*
((
gdouble
)
(
FREQ_HIST_MAX
-
FREQ_HIST_MIN
)
/
FREQ_HIST_BINS
);
freq_9
9
=
FREQ_HIST_MIN
+
i
*
((
gdouble
)
(
FREQ_HIST_MAX
-
FREQ_HIST_MIN
)
/
FREQ_HIST_BINS
);
break
;
}
}
if
(
G_UNLIKELY
(
i
==
-
1
))
freq_9
8
=
cpu
->
max_freq_measured
;
freq_9
9
=
cpu
->
max_freq_measured
;
}
range
=
freq_9
8
-
cpu
->
min_freq
;
range
=
freq_9
9
-
cpu
->
min_freq
;
if
(
cpu
->
cur_freq
>
cpu
->
min_freq
&&
range
>=
min_range
)
normalized_freq
=
(
cpu
->
cur_freq
-
cpu
->
min_freq
)
/
range
;
else
...
...
@@ -525,7 +525,7 @@ cpufreq_update_pixmap (CpuInfo *cpu)
if
(
G_UNLIKELY
(
index
<
0
))
index
=
0
;
if
(
index
>=
(
gint
)
G_N_ELEMENTS
(
cpuFreq
->
icon_pixmaps
))
/* This codepath is expected to be reached in
2
% of cases */
/* This codepath is expected to be reached in
100-99=1
% of cases */
index
=
G_N_ELEMENTS
(
cpuFreq
->
icon_pixmaps
)
-
1
;
pixmap
=
cpuFreq
->
icon_pixmaps
[
index
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment