From 35cd67346e1ced88528a2217c1fb98ada4e8cec9 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 3 Mar 2017 23:59:53 +0100 Subject: [PATCH] imageinfo_ni: simplify max_bit handling Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d04afd80ba7079aeb7fcb95171b3af3ad90278fd Author: vanhofen Date: 2017-03-03 (Fri, 03 Mar 2017) Origin message was: ------------------ - imageinfo_ni: simplify max_bit handling ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/imageinfo_ni.cpp | 15 ++++----------- src/gui/imageinfo_ni.h | 3 +-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/gui/imageinfo_ni.cpp b/src/gui/imageinfo_ni.cpp index f93dc79b6..7f6c59bda 100644 --- a/src/gui/imageinfo_ni.cpp +++ b/src/gui/imageinfo_ni.cpp @@ -138,8 +138,7 @@ void CImageInfoNI::Init(void) } offset = offset + OFFSET_INNER_MID; - netIfName = "eth0"; - netMaxBit = 104857600; + netIfName = "eth0"; //FIXME; What about the other ports? } CImageInfoNI::~CImageInfoNI() @@ -858,16 +857,10 @@ void CImageInfoNI::paint_NET_Info(int posx, int posy) * 13107200 Byte * 104857600 Bit */ -#ifdef HAVE_GENERIC_HARDWARE - int max_bit = netMaxBit; /* PC */ -#else -# ifdef BOXMODEL_CS_HD2 - int max_bit = 104857600; /* Shiner, Kronos */ - if (revision == 9) - max_bit = 1073741824; /* Apollo */ -# else ifdef int max_bit = 104857600; -# endif +#ifdef BOXMODEL_CS_HD2 + if (revision == 9) /* Apollo */ + max_bit = 1073741824; #endif int percent = ((rbit_s+wbit_s)*100/max_bit); diff --git a/src/gui/imageinfo_ni.h b/src/gui/imageinfo_ni.h index d0e28a037..a758cf63f 100644 --- a/src/gui/imageinfo_ni.h +++ b/src/gui/imageinfo_ni.h @@ -57,8 +57,6 @@ class CImageInfoNI : public CMenuTarget int font_head; int font_info; int font_small; - std::string netIfName; - int netMaxBit; void paint(); void paint_pic(int x, int y, int w, int h); @@ -104,6 +102,7 @@ class CImageInfoNI : public CMenuTarget uint64_t read_old; uint64_t write_old; uint64_t net_best; + std::string netIfName; pthread_t InfoThread; static void* InfoProc(void *arg);