summarylogtreecommitdiffstats
path: root/htop-temperature.patch
diff options
context:
space:
mode:
authorDX372020-09-04 17:53:34 +0700
committerDX372020-09-04 17:53:34 +0700
commitcd610bbc5ae1edc34bcd9f72fe8b1d5bb29d9b29 (patch)
tree9eee0aef61da86b125479180272cab4b3017d308 /htop-temperature.patch
parent3af40809f95524c24bd7b8cab61473d2213bfdfc (diff)
downloadaur-cd610bbc5ae1edc34bcd9f72fe8b1d5bb29d9b29.tar.gz
changes
- 3.0.1 - fix all warnings in patch
Diffstat (limited to 'htop-temperature.patch')
-rw-r--r--htop-temperature.patch76
1 files changed, 39 insertions, 37 deletions
diff --git a/htop-temperature.patch b/htop-temperature.patch
index a96f90fb6a4..76670e31f11 100644
--- a/htop-temperature.patch
+++ b/htop-temperature.patch
@@ -1,8 +1,8 @@
diff --git a/CRT.c b/CRT.c
-index 869573e..e6b8a75 100644
+index 0d83bf4..6574b38 100644
--- a/CRT.c
+++ b/CRT.c
-@@ -101,6 +101,9 @@ typedef enum ColorElements_ {
+@@ -88,6 +88,9 @@ typedef enum ColorElements_ {
UPTIME,
BATTERY,
TASKS_RUNNING,
@@ -12,7 +12,7 @@ index 869573e..e6b8a75 100644
SWAP,
PROCESS,
PROCESS_SHADOW,
-@@ -240,6 +243,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+@@ -204,6 +207,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_VALUE] = A_BOLD | ColorPair(Cyan,Black),
[LED_COLOR] = ColorPair(Green,Black),
[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black),
@@ -22,7 +22,7 @@ index 869573e..e6b8a75 100644
[PROCESS] = A_NORMAL,
[PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack,
[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black),
-@@ -308,6 +314,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+@@ -273,6 +279,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_VALUE] = A_BOLD,
[LED_COLOR] = A_NORMAL,
[TASKS_RUNNING] = A_BOLD,
@@ -32,7 +32,7 @@ index 869573e..e6b8a75 100644
[PROCESS] = A_NORMAL,
[PROCESS_SHADOW] = A_DIM,
[PROCESS_TAG] = A_BOLD,
-@@ -376,6 +385,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+@@ -342,6 +351,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_VALUE] = ColorPair(Black,White),
[LED_COLOR] = ColorPair(Green,White),
[TASKS_RUNNING] = ColorPair(Green,White),
@@ -42,7 +42,7 @@ index 869573e..e6b8a75 100644
[PROCESS] = ColorPair(Black,White),
[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,White),
[PROCESS_TAG] = ColorPair(White,Blue),
-@@ -444,6 +456,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+@@ -411,6 +423,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_VALUE] = ColorPair(Black,Black),
[LED_COLOR] = ColorPair(Green,Black),
[TASKS_RUNNING] = ColorPair(Green,Black),
@@ -52,7 +52,7 @@ index 869573e..e6b8a75 100644
[PROCESS] = ColorPair(Black,Black),
[PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack,
[PROCESS_TAG] = ColorPair(White,Blue),
-@@ -512,6 +527,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+@@ -480,6 +495,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_VALUE] = A_BOLD | ColorPair(Cyan,Blue),
[LED_COLOR] = ColorPair(Green,Blue),
[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Blue),
@@ -62,7 +62,7 @@ index 869573e..e6b8a75 100644
[PROCESS] = ColorPair(White,Blue),
[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Blue),
[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Blue),
-@@ -580,6 +598,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+@@ -549,6 +567,9 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[METER_VALUE] = ColorPair(Green,Black),
[LED_COLOR] = ColorPair(Green,Black),
[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black),
@@ -73,10 +73,10 @@ index 869573e..e6b8a75 100644
[PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack,
[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black),
diff --git a/CRT.h b/CRT.h
-index 5fb2f09..fc40b2a 100644
+index 7d5c8ad..9ef7660 100644
--- a/CRT.h
+++ b/CRT.h
-@@ -89,6 +89,9 @@ typedef enum ColorElements_ {
+@@ -76,6 +76,9 @@ typedef enum ColorElements_ {
UPTIME,
BATTERY,
TASKS_RUNNING,
@@ -86,12 +86,33 @@ index 5fb2f09..fc40b2a 100644
SWAP,
PROCESS,
PROCESS_SHADOW,
+diff --git a/Makefile.am b/Makefile.am
+index d455b4d..2f6dd75 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -49,6 +49,7 @@ linux_platform_headers = \
+ linux/LinuxProcessList.h \
+ linux/LinuxCRT.h \
+ linux/Battery.h \
++ TemperatureMeter.h \
+ linux/PressureStallMeter.h \
+ zfs/ZfsArcMeter.h \
+ zfs/ZfsCompressedArcMeter.h \
+@@ -59,7 +60,7 @@ all_platform_headers += $(linux_platform_headers)
+ if HTOP_LINUX
+ AM_LDFLAGS += -rdynamic
+ myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \
+-linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c \
++linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c TemperatureMeter.c \
+ linux/PressureStallMeter.c \
+ zfs/ZfsArcMeter.c zfs/ZfsCompressedArcMeter.c zfs/ZfsArcStats.c
+
diff --git a/TemperatureMeter.c b/TemperatureMeter.c
new file mode 100644
-index 0000000..9ee9185
+index 0000000..d28169d
--- /dev/null
+++ b/TemperatureMeter.c
-@@ -0,0 +1,100 @@
+@@ -0,0 +1,102 @@
+/*
+htop - TemperatureMeter.c
+(C) 2013 Ralf Stemmer
@@ -128,16 +149,18 @@ index 0000000..9ee9185
+}
+
+static void TemperatureMeter_display(Object* cast, RichString* out) {
++ (void) cast;
+ FILE *p;
+ p = popen("sensors", "r");
-+ if(p == NULL) return 1;
++ if(p == NULL) return;
+
+ int textColor = CRT_colors[METER_TEXT];
+ int coolColor = CRT_colors[TEMPERATURE_COOL];
+ int mediumColor = CRT_colors[TEMPERATURE_MEDIUM];
+ int hotColor = CRT_colors[TEMPERATURE_HOT];
+
-+ size_t read, len;
++ int read;
++ size_t len;
+ char *line = NULL;
+ char *entry = NULL;
+ char *tstart = NULL, *tend = NULL;
@@ -158,7 +181,7 @@ index 0000000..9ee9185
+
+ // convert the string into an integer, this is necessary for further steps
+ temperature = strtol(tstart, &tend, 10);
-+ if (temperature == LONG_MAX || temperature == LONG_MIN) continue;
++ if (temperature == INT_MAX || temperature == INT_MIN) continue;
+ if (tstart == tend) continue;
+
+ // choose the color for the temperature
@@ -217,27 +240,6 @@ index 0000000..b86ddd8
+extern MeterClass TemperatureMeter_class;
+
+#endif
-diff --git a/Makefile.am b/Makefile.am
-index d455b4d..2f6dd75 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -49,6 +49,7 @@ linux_platform_headers = \
- linux/LinuxProcessList.h \
- linux/LinuxCRT.h \
- linux/Battery.h \
-+ TemperatureMeter.h \
- linux/PressureStallMeter.h \
- zfs/ZfsArcMeter.h \
- zfs/ZfsCompressedArcMeter.h \
-@@ -59,7 +60,7 @@ all_platform_headers += $(linux_platform_headers)
- if HTOP_LINUX
- AM_LDFLAGS += -rdynamic
- myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \
--linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c \
-+linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c TemperatureMeter.c \
- linux/PressureStallMeter.c \
- zfs/ZfsArcMeter.c zfs/ZfsCompressedArcMeter.c zfs/ZfsArcStats.c
-
diff --git a/linux/Platform.c b/linux/Platform.c
index 0f59fed..49038b2 100644
--- a/linux/Platform.c
@@ -247,7 +249,7 @@ index 0f59fed..49038b2 100644
#include "zfs/ZfsCompressedArcMeter.h"
#include "LinuxProcess.h"
+#include "TemperatureMeter.h"
-
+
#include <math.h>
#include <assert.h>
@@ -119,6 +120,7 @@ MeterClass* Platform_meterTypes[] = {