From 440bb87058fc591175c970b4d5f5c36aa957942d Mon Sep 17 00:00:00 2001 From: fraggerfox Date: Fri, 9 Apr 2021 08:24:02 +0530 Subject: Minor code clean up and corrections. --- netbsd/Platform.c | 58 +-------------------------------------------------- netbsd/ProcessField.h | 2 +- 2 files changed, 2 insertions(+), 58 deletions(-) (limited to 'netbsd') diff --git a/netbsd/Platform.c b/netbsd/Platform.c index 354476d3..c4a11e1a 100644 --- a/netbsd/Platform.c +++ b/netbsd/Platform.c @@ -1,5 +1,5 @@ /* -htop - openbsd/Platform.c +htop - netbsd/Platform.c (C) 2014 Hisham H. Muhammad (C) 2021 Santhosh Raju Released under the GNU GPLv2, see the COPYING file @@ -16,11 +16,9 @@ in the source distribution for its full text. #include #include #include -//#include #include #include #include -//#include #include "CPUMeter.h" #include "ClockMeter.h" @@ -319,62 +317,8 @@ bool Platform_getNetworkIO(NetworkIOData* data) { return false; } -//static bool findDevice(const char* name, int* mib, struct sensordev* snsrdev, size_t* sdlen) { -// for (int devn = 0;; devn++) { -// mib[2] = devn; -// if (sysctl(mib, 3, snsrdev, sdlen, NULL, 0) == -1) { -// if (errno == ENXIO) -// continue; -// if (errno == ENOENT) -// return false; -// } -// if (String_eq(name, snsrdev->xname)) { -// return true; -// } -// } -//} - void Platform_getBattery(double* percent, ACPresence* isOnAC) { // TODO (void)percent; (void)isOnAC; -// int mib[] = {CTL_HW, HW_SENSORS, 0, 0, 0}; -// struct sensor s; -// size_t slen = sizeof(struct sensor); -// struct sensordev snsrdev; -// size_t sdlen = sizeof(struct sensordev); -// -// bool found = findDevice("acpibat0", mib, &snsrdev, &sdlen); -// -// *percent = NAN; -// if (found) { -// /* last full capacity */ -// mib[3] = 7; -// mib[4] = 0; -// double last_full_capacity = 0; -// if (sysctl(mib, 5, &s, &slen, NULL, 0) != -1) -// last_full_capacity = s.value; -// if (last_full_capacity > 0) { -// /* remaining capacity */ -// mib[3] = 7; -// mib[4] = 3; -// if (sysctl(mib, 5, &s, &slen, NULL, 0) != -1) { -// double charge = s.value; -// *percent = 100 * (charge / last_full_capacity); -// if (charge >= last_full_capacity) { -// *percent = 100; -// } -// } -// } -// } -// -// found = findDevice("acpiac0", mib, &snsrdev, &sdlen); -// -// *isOnAC = AC_ERROR; -// if (found) { -// mib[3] = 9; -// mib[4] = 0; -// if (sysctl(mib, 5, &s, &slen, NULL, 0) != -1) -// *isOnAC = s.value; -// } } diff --git a/netbsd/ProcessField.h b/netbsd/ProcessField.h index 9978ddbc..43fe1694 100644 --- a/netbsd/ProcessField.h +++ b/netbsd/ProcessField.h @@ -1,7 +1,7 @@ #ifndef HEADER_NetBSDProcessField #define HEADER_NetBSDProcessField /* -htop - openbsd/ProcessField.h +htop - netbsd/ProcessField.h (C) 2020 htop dev team Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. -- cgit v1.2.3