Path: blob/next/external/packages/extras-buildpkgs/htop/debian/patches/remove-fancy-flashing.patch
8661 views
diff --git a/BlockDevice_ioStatsMeter.c b/BlockDevice_ioStatsMeter.c1index 9dccbde..95532cd 1006442--- a/BlockDevice_ioStatsMeter.c3+++ b/BlockDevice_ioStatsMeter.c4@@ -26,7 +26,6 @@ static void BlockDevice_sda_ioStatsMeter_setValues(Meter* this, char* buffer, in5char block_device[80];6static double old = 0.;7static double now = 0.;8- static int flash = 0;9static unsigned long sec_size = 0;10FILE *fp;1112@@ -81,11 +80,7 @@ static void BlockDevice_sda_ioStatsMeter_setValues(Meter* this, char* buffer, in13Platform_BlockDevice_sda_stats.write_sectors_comp = Platform_BlockDevice_sda_stats.write_sectors;1415} else {16- if (!(flash % 2))17- xSnprintf(buffer, len, "%s", "unavailable");18- else19- xSnprintf(buffer, len, "%s", "");20- flash++;21+ xSnprintf(buffer, len, "%s", "unavailable");22}23}2425@@ -112,7 +107,6 @@ static void BlockDevice_sdb_ioStatsMeter_setValues(Meter* this, char* buffer, in26char block_device[80];27static double old = 0.;28static double now = 0.;29- static int flash = 0;30static unsigned long sec_size = 0;31FILE *fp;3233@@ -167,11 +161,7 @@ static void BlockDevice_sdb_ioStatsMeter_setValues(Meter* this, char* buffer, in34Platform_BlockDevice_sdb_stats.write_sectors_comp = Platform_BlockDevice_sdb_stats.write_sectors;3536} else {37- if (!(flash % 2))38- xSnprintf(buffer, len, "%s", "unavailable");39- else40- xSnprintf(buffer, len, "%s", "");41- flash++;42+ xSnprintf(buffer, len, "%s", "unavailable");43}44}4546@@ -198,7 +188,6 @@ static void BlockDevice_sdc_ioStatsMeter_setValues(Meter* this, char* buffer, in47char block_device[80];48static double old = 0.;49static double now = 0.;50- static int flash = 0;51static unsigned long sec_size = 0;52FILE *fp;5354@@ -253,11 +242,7 @@ static void BlockDevice_sdc_ioStatsMeter_setValues(Meter* this, char* buffer, in55Platform_BlockDevice_sdc_stats.write_sectors_comp = Platform_BlockDevice_sdc_stats.write_sectors;5657} else {58- if (!(flash % 2))59- xSnprintf(buffer, len, "%s", "unavailable");60- else61- xSnprintf(buffer, len, "%s", "");62- flash++;63+ xSnprintf(buffer, len, "%s", "unavailable");64}65}6667@@ -284,7 +269,6 @@ static void BlockDevice_sdd_ioStatsMeter_setValues(Meter* this, char* buffer, in68char block_device[80];69static double old = 0.;70static double now = 0.;71- static int flash = 0;72static unsigned long sec_size = 0;73FILE *fp;7475@@ -339,11 +323,7 @@ static void BlockDevice_sdd_ioStatsMeter_setValues(Meter* this, char* buffer, in76Platform_BlockDevice_sdd_stats.write_sectors_comp = Platform_BlockDevice_sdd_stats.write_sectors;7778} else {79- if (!(flash % 2))80- xSnprintf(buffer, len, "%s", "unavailable");81- else82- xSnprintf(buffer, len, "%s", "");83- flash++;84+ xSnprintf(buffer, len, "%s", "unavailable");85}86}8788@@ -370,7 +350,6 @@ static void BlockDevice_mmcblk0_ioStatsMeter_setValues(Meter* this, char* buffer89char block_device[80];90static double old = 0.;91static double now = 0.;92- static int flash = 0;93static unsigned long sec_size = 0;94FILE *fp;9596@@ -425,11 +404,7 @@ static void BlockDevice_mmcblk0_ioStatsMeter_setValues(Meter* this, char* buffer97Platform_BlockDevice_mmcblk0_stats.write_sectors_comp = Platform_BlockDevice_mmcblk0_stats.write_sectors;9899} else {100- if (!(flash % 2))101- xSnprintf(buffer, len, "%s", "unavailable");102- else103- xSnprintf(buffer, len, "%s", "");104- flash++;105+ xSnprintf(buffer, len, "%s", "unavailable");106}107}108109@@ -456,7 +431,6 @@ static void BlockDevice_mmcblk1_ioStatsMeter_setValues(Meter* this, char* buffer110char block_device[80];111static double old = 0.;112static double now = 0.;113- static int flash = 0;114static unsigned long sec_size = 0;115FILE *fp;116117@@ -511,11 +485,7 @@ static void BlockDevice_mmcblk1_ioStatsMeter_setValues(Meter* this, char* buffer118Platform_BlockDevice_mmcblk1_stats.write_sectors_comp = Platform_BlockDevice_mmcblk1_stats.write_sectors;119120} else {121- if (!(flash % 2))122- xSnprintf(buffer, len, "%s", "unavailable");123- else124- xSnprintf(buffer, len, "%s", "");125- flash++;126+ xSnprintf(buffer, len, "%s", "unavailable");127}128}129130@@ -542,7 +512,6 @@ static void BlockDevice_mmcblk2_ioStatsMeter_setValues(Meter* this, char* buffer131char block_device[80];132static double old = 0.;133static double now = 0.;134- static int flash = 0;135static unsigned long sec_size = 0;136FILE *fp;137138@@ -597,11 +566,7 @@ static void BlockDevice_mmcblk2_ioStatsMeter_setValues(Meter* this, char* buffer139Platform_BlockDevice_mmcblk2_stats.write_sectors_comp = Platform_BlockDevice_mmcblk2_stats.write_sectors;140141} else {142- if (!(flash % 2))143- xSnprintf(buffer, len, "%s", "unavailable");144- else145- xSnprintf(buffer, len, "%s", "");146- flash++;147+ xSnprintf(buffer, len, "%s", "unavailable");148}149}150151@@ -628,7 +593,6 @@ static void BlockDevice_mmcblk3_ioStatsMeter_setValues(Meter* this, char* buffer152char block_device[80];153static double old = 0.;154static double now = 0.;155- static int flash = 0;156static unsigned long sec_size = 0;157FILE *fp;158159@@ -683,11 +647,7 @@ static void BlockDevice_mmcblk3_ioStatsMeter_setValues(Meter* this, char* buffer160Platform_BlockDevice_mmcblk3_stats.write_sectors_comp = Platform_BlockDevice_mmcblk3_stats.write_sectors;161162} else {163- if (!(flash % 2))164- xSnprintf(buffer, len, "%s", "unavailable");165- else166- xSnprintf(buffer, len, "%s", "");167- flash++;168+ xSnprintf(buffer, len, "%s", "unavailable");169}170}171172diff --git a/CpuFreqMeter.c b/CpuFreqMeter.c173index 6508180..a2f39eb 100644174--- a/CpuFreqMeter.c175+++ b/CpuFreqMeter.c176@@ -23,7 +23,6 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {177char buf_b[32];178char buf_l[32];179int ln = sizeof(buf_l);180- static int pulse = 0;181182memset(buf_l, 0, sizeof(buf_l));183memset(buf_b, 0, sizeof(buf_b));184@@ -66,11 +65,7 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {185xSnprintf(buf_l, ln, "%4d MHz", Freq);186}187188- if (pulse)189- xSnprintf(buffer, len, "%s %s (big.LITTLE)", buf_b, buf_l, pulse);190- else191- xSnprintf(buffer, len, "%s %s ", buf_b, buf_l, pulse);192- pulse = !pulse;193+ xSnprintf(buffer, len, "%s %s (big.LITTLE)", buf_b, buf_l);194return;195}196197@@ -89,7 +84,6 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {198} else {199xSnprintf(buffer, len, "%4d MHz", Freq);200}201- pulse = !pulse;202}203204MeterClass CpuFreqMeter_class = {205diff --git a/Eth0_Meter.c b/Eth0_Meter.c206index 90e512a..21e4b05 100644207--- a/Eth0_Meter.c208+++ b/Eth0_Meter.c209@@ -35,11 +35,10 @@ static void Eth0_Meter_setValues(Meter* this, char* buffer, int len) {210ret = findIP_interface("eth0", szIP, sizeof(szIP));211}212213- if (ret) {214- xSnprintf(buffer, len, "%s", szIP);215- } else {216- xSnprintf(buffer, len, "%s", "down");217+ if (!ret) {218+ snprintf(szIP, sizeof(szIP), "%s", "down");219}220+ xSnprintf(buffer, len, "%s", szIP);221}222223MeterClass Eth0_Meter_class = {224diff --git a/Eth0_StatsMeter.c b/Eth0_StatsMeter.c225index 974c656..1a42334 100644226--- a/Eth0_StatsMeter.c227+++ b/Eth0_StatsMeter.c228@@ -27,7 +27,6 @@ static void Eth0_StatsMeter_setValues(Meter* this, char* buffer, int len) {229double refreshdelay;230static double old = 0.;231static double now = 0.;232- static int flash = 0;233234now = get_wall_time();235refreshdelay = now - old;236@@ -57,11 +56,7 @@ static void Eth0_StatsMeter_setValues(Meter* this, char* buffer, int len) {237Platform_Eth0_stats.tx_bytes_comp = Platform_Eth0_stats.tx_bytes;238239} else {240- if (!(flash % 2))241- xSnprintf(buffer, len, "%s", "unavail");242- else243- xSnprintf(buffer, len, "%s", "");244- flash++;245+ xSnprintf(buffer, len, "%s", "unavail");246}247}248249diff --git a/Eth1_Meter.c b/Eth1_Meter.c250index 41cfa05..181370f 100644251--- a/Eth1_Meter.c252+++ b/Eth1_Meter.c253@@ -35,11 +35,10 @@ static void Eth1_Meter_setValues(Meter* this, char* buffer, int len) {254ret = findIP_interface("eth1", szIP, sizeof(szIP));255}256257- if (ret) {258- xSnprintf(buffer, len, "%s", szIP);259- } else {260- xSnprintf(buffer, len, "%s", "down");261+ if (!ret) {262+ snprintf(szIP, sizeof(szIP), "%s", "down");263}264+ xSnprintf(buffer, len, "%s", szIP);265}266267MeterClass Eth1_Meter_class = {268diff --git a/Eth1_StatsMeter.c b/Eth1_StatsMeter.c269index 85e6dc9..e7c5718 100644270--- a/Eth1_StatsMeter.c271+++ b/Eth1_StatsMeter.c272@@ -27,7 +27,6 @@ static void Eth1_StatsMeter_setValues(Meter* this, char* buffer, int len) {273double refreshdelay;274static double old = 0.;275static double now = 0.;276- static int flash = 0;277278now = get_wall_time();279refreshdelay = now - old;280@@ -57,11 +56,7 @@ static void Eth1_StatsMeter_setValues(Meter* this, char* buffer, int len) {281Platform_Eth1_stats.tx_bytes_comp = Platform_Eth1_stats.tx_bytes;282283} else {284- if (!(flash % 2))285- xSnprintf(buffer, len, "%s", "unavail");286- else287- xSnprintf(buffer, len, "%s", "");288- flash++;289+ xSnprintf(buffer, len, "%s", "unavail");290}291}292293diff --git a/Wlan0_Meter.c b/Wlan0_Meter.c294index bf75623..8296a6c 100644295--- a/Wlan0_Meter.c296+++ b/Wlan0_Meter.c297@@ -33,11 +33,10 @@ static void Wlan0_Meter_setValues(Meter* this, char* buffer, int len) {298ret = findIP_interface("wlan0", szIP, sizeof(szIP));299}300301- if (ret) {302- xSnprintf(buffer, len, "%s", szIP);303- } else {304- xSnprintf(buffer, len, "%s", "down");305+ if (!ret) {306+ snprintf(szIP, sizeof(szIP), "%s", "down");307}308+ xSnprintf(buffer, len, "%s", szIP);309}310311MeterClass Wlan0_Meter_class = {312diff --git a/Wlan0_StatsMeter.c b/Wlan0_StatsMeter.c313index f920f9c..9ced108 100644314--- a/Wlan0_StatsMeter.c315+++ b/Wlan0_StatsMeter.c316@@ -27,7 +27,6 @@ static void Wlan0_StatsMeter_setValues(Meter* this, char* buffer, int len) {317double refreshdelay;318static double old = 0.;319static double now = 0.;320- static int flash = 0;321322now = get_wall_time();323refreshdelay = now - old;324@@ -57,11 +56,7 @@ static void Wlan0_StatsMeter_setValues(Meter* this, char* buffer, int len) {325Platform_Wlan0_stats.tx_bytes_comp = Platform_Wlan0_stats.tx_bytes;326327} else {328- if (!(flash % 2))329- xSnprintf(buffer, len, "%s", "unavail");330- else331- xSnprintf(buffer, len, "%s", "");332- flash++;333+ xSnprintf(buffer, len, "%s", "unavail");334}335}336337diff --git a/Wlan1_Meter.c b/Wlan1_Meter.c338index c5acd69..4c5fcea 100644339--- a/Wlan1_Meter.c340+++ b/Wlan1_Meter.c341@@ -35,11 +35,10 @@ static void Wlan1_Meter_setValues(Meter* this, char* buffer, int len) {342ret = findIP_interface("wlan1", szIP, sizeof(szIP));343}344345- if (ret) {346- xSnprintf(buffer, len, "%s", szIP);347- } else {348- xSnprintf(buffer, len, "%s", "down");349+ if (!ret) {350+ snprintf(szIP, sizeof(szIP), "%s", "down");351}352+ xSnprintf(buffer, len, "%s", szIP);353}354355MeterClass Wlan1_Meter_class = {356357358