summarylogtreecommitdiffstats
path: root/htop-temperature.patch
diff options
context:
space:
mode:
authorDX372020-09-05 12:40:35 +0700
committerDX372020-09-05 12:40:35 +0700
commite55e3150599e43d0307d392cd22e590fcbda044b (patch)
tree599e55bca0bd5bce79de9e04d4483cd80a3aa85f /htop-temperature.patch
parentcd610bbc5ae1edc34bcd9f72fe8b1d5bb29d9b29 (diff)
downloadaur-e55e3150599e43d0307d392cd22e590fcbda044b.tar.gz
fixes
- remove unused patch - apply some fixes to temperature patch - add myself as contributor
Diffstat (limited to 'htop-temperature.patch')
-rw-r--r--htop-temperature.patch24
1 files changed, 13 insertions, 11 deletions
diff --git a/htop-temperature.patch b/htop-temperature.patch
index 76670e31f11..979b5aaf251 100644
--- a/htop-temperature.patch
+++ b/htop-temperature.patch
@@ -109,14 +109,15 @@ index d455b4d..2f6dd75 100644
diff --git a/TemperatureMeter.c b/TemperatureMeter.c
new file mode 100644
-index 0000000..d28169d
+index 0000000..8c45854
--- /dev/null
+++ b/TemperatureMeter.c
-@@ -0,0 +1,102 @@
+@@ -0,0 +1,103 @@
+/*
+htop - TemperatureMeter.c
+(C) 2013 Ralf Stemmer
+(C) 2014 Blair Bonnett
++(C) 2020 Maxim Kurnosenko
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
@@ -164,7 +165,7 @@ index 0000000..d28169d
+ char *line = NULL;
+ char *entry = NULL;
+ char *tstart = NULL, *tend = NULL;
-+ int temperature;
++ long temperature;
+ while ((read = getline(&line, &len, p)) != -1) {
+ // contains this line a core-temperature?
+ entry = strstr(line, "Core ");
@@ -181,18 +182,18 @@ index 0000000..d28169d
+
+ // convert the string into an integer, this is necessary for further steps
+ temperature = strtol(tstart, &tend, 10);
-+ if (temperature == INT_MAX || temperature == INT_MIN) continue;
++ if (temperature == LONG_MAX || temperature == LONG_MIN) continue;
+ if (tstart == tend) continue;
+
+ // choose the color for the temperature
+ int tempColor;
-+ if (temperature < 60) tempColor = coolColor;
-+ else if (temperature >= 60 && temperature < 70) tempColor = mediumColor;
-+ else tempColor = hotColor;
++ if (temperature < 60) tempColor = coolColor;
++ else if (temperature < 70) tempColor = mediumColor;
++ else tempColor = hotColor;
+
+ // output the temperature
-+ char buffer[20];
-+ sprintf(buffer, "%d", temperature);
++ char buffer[30];
++ sprintf(buffer, "%ld", temperature);
+ RichString_append(out, tempColor, buffer);
+ RichString_append(out, textColor, "°C ");
+ }
@@ -217,10 +218,10 @@ index 0000000..d28169d
+};
diff --git a/TemperatureMeter.h b/TemperatureMeter.h
new file mode 100644
-index 0000000..b86ddd8
+index 0000000..b158147
--- /dev/null
+++ b/TemperatureMeter.h
-@@ -0,0 +1,19 @@
+@@ -0,0 +1,20 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_TemperatureMeter
@@ -229,6 +230,7 @@ index 0000000..b86ddd8
+htop - TemperatureMeter.h
+(C) 2013 Ralf Stemmer
+(C) 2014 Blair Bonnett
++(C) 2020 Maxim Kurnosenko
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/