mirror of https://github.com/xzeldon/htop.git
Covert Meter attributes to file-local constant arrays
This commit is contained in:
parent
843949131a
commit
6db2d52261
|
@ -20,7 +20,7 @@ This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
|
|||
#include <stdlib.h>
|
||||
|
||||
|
||||
int BatteryMeter_attributes[] = {
|
||||
static const int BatteryMeter_attributes[] = {
|
||||
BATTERY
|
||||
};
|
||||
|
||||
|
|
|
@ -17,8 +17,6 @@ typedef enum ACPresence_ {
|
|||
AC_ERROR
|
||||
} ACPresence;
|
||||
|
||||
extern int BatteryMeter_attributes[];
|
||||
|
||||
extern MeterClass BatteryMeter_class;
|
||||
|
||||
#endif
|
||||
|
|
11
CPUMeter.c
11
CPUMeter.c
|
@ -16,8 +16,15 @@ in the source distribution for its full text.
|
|||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
int CPUMeter_attributes[] = {
|
||||
CPU_NICE, CPU_NORMAL, CPU_SYSTEM, CPU_IRQ, CPU_SOFTIRQ, CPU_STEAL, CPU_GUEST, CPU_IOWAIT
|
||||
static const int CPUMeter_attributes[] = {
|
||||
CPU_NICE,
|
||||
CPU_NORMAL,
|
||||
CPU_SYSTEM,
|
||||
CPU_IRQ,
|
||||
CPU_SOFTIRQ,
|
||||
CPU_STEAL,
|
||||
CPU_GUEST,
|
||||
CPU_IOWAIT
|
||||
};
|
||||
|
||||
static void CPUMeter_init(Meter* this) {
|
||||
|
|
|
@ -22,8 +22,6 @@ typedef enum {
|
|||
CPU_METER_ITEMCOUNT = 9, // number of entries in this enum
|
||||
} CPUMeterValues;
|
||||
|
||||
extern int CPUMeter_attributes[];
|
||||
|
||||
extern MeterClass CPUMeter_class;
|
||||
|
||||
extern MeterClass AllCPUsMeter_class;
|
||||
|
|
|
@ -12,7 +12,7 @@ in the source distribution for its full text.
|
|||
#include <time.h>
|
||||
|
||||
|
||||
int ClockMeter_attributes[] = {
|
||||
static const int ClockMeter_attributes[] = {
|
||||
CLOCK
|
||||
};
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ in the source distribution for its full text.
|
|||
|
||||
#include "Meter.h"
|
||||
|
||||
extern int ClockMeter_attributes[];
|
||||
|
||||
extern MeterClass ClockMeter_class;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,7 +12,7 @@ in the source distribution for its full text.
|
|||
#include <unistd.h>
|
||||
|
||||
|
||||
int HostnameMeter_attributes[] = {
|
||||
static const int HostnameMeter_attributes[] = {
|
||||
HOSTNAME
|
||||
};
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ in the source distribution for its full text.
|
|||
|
||||
#include "Meter.h"
|
||||
|
||||
extern int HostnameMeter_attributes[];
|
||||
|
||||
extern MeterClass HostnameMeter_class;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,11 +11,15 @@ in the source distribution for its full text.
|
|||
#include "Platform.h"
|
||||
|
||||
|
||||
int LoadAverageMeter_attributes[] = {
|
||||
LOAD_AVERAGE_ONE, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_FIFTEEN
|
||||
static const int LoadAverageMeter_attributes[] = {
|
||||
LOAD_AVERAGE_ONE,
|
||||
LOAD_AVERAGE_FIVE,
|
||||
LOAD_AVERAGE_FIFTEEN
|
||||
};
|
||||
|
||||
int LoadMeter_attributes[] = { LOAD };
|
||||
static const int LoadMeter_attributes[] = {
|
||||
LOAD
|
||||
};
|
||||
|
||||
static void LoadAverageMeter_updateValues(Meter* this, char* buffer, int size) {
|
||||
Platform_getLoadAverage(&this->values[0], &this->values[1], &this->values[2]);
|
||||
|
|
|
@ -9,10 +9,6 @@ in the source distribution for its full text.
|
|||
|
||||
#include "Meter.h"
|
||||
|
||||
extern int LoadAverageMeter_attributes[];
|
||||
|
||||
extern int LoadMeter_attributes[];
|
||||
|
||||
extern MeterClass LoadAverageMeter_class;
|
||||
|
||||
extern MeterClass LoadMeter_class;
|
||||
|
|
|
@ -17,8 +17,10 @@ in the source distribution for its full text.
|
|||
#include <assert.h>
|
||||
|
||||
|
||||
int MemoryMeter_attributes[] = {
|
||||
MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE
|
||||
static const int MemoryMeter_attributes[] = {
|
||||
MEMORY_USED,
|
||||
MEMORY_BUFFERS,
|
||||
MEMORY_CACHE
|
||||
};
|
||||
|
||||
static void MemoryMeter_updateValues(Meter* this, char* buffer, int size) {
|
||||
|
|
|
@ -9,8 +9,6 @@ in the source distribution for its full text.
|
|||
|
||||
#include "Meter.h"
|
||||
|
||||
extern int MemoryMeter_attributes[];
|
||||
|
||||
extern MeterClass MemoryMeter_class;
|
||||
|
||||
#endif
|
||||
|
|
2
Meter.c
2
Meter.c
|
@ -433,7 +433,7 @@ static void BlankMeter_display(Object* cast, RichString* out) {
|
|||
RichString_prune(out);
|
||||
}
|
||||
|
||||
int BlankMeter_attributes[] = {
|
||||
static const int BlankMeter_attributes[] = {
|
||||
DEFAULT_COLOR
|
||||
};
|
||||
|
||||
|
|
2
Meter.h
2
Meter.h
|
@ -105,8 +105,6 @@ ListItem* Meter_toListItem(Meter* this, bool moving);
|
|||
|
||||
extern MeterMode* Meter_modes[];
|
||||
|
||||
extern int BlankMeter_attributes[];
|
||||
|
||||
extern MeterClass BlankMeter_class;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -17,7 +17,7 @@ in the source distribution for its full text.
|
|||
#include <assert.h>
|
||||
|
||||
|
||||
int SwapMeter_attributes[] = {
|
||||
static const int SwapMeter_attributes[] = {
|
||||
SWAP
|
||||
};
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ in the source distribution for its full text.
|
|||
|
||||
#include "Meter.h"
|
||||
|
||||
extern int SwapMeter_attributes[];
|
||||
|
||||
extern MeterClass SwapMeter_class;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,8 +11,11 @@ in the source distribution for its full text.
|
|||
#include "CRT.h"
|
||||
|
||||
|
||||
int TasksMeter_attributes[] = {
|
||||
CPU_SYSTEM, PROCESS_THREAD, PROCESS, TASKS_RUNNING
|
||||
static const int TasksMeter_attributes[] = {
|
||||
CPU_SYSTEM,
|
||||
PROCESS_THREAD,
|
||||
PROCESS,
|
||||
TASKS_RUNNING
|
||||
};
|
||||
|
||||
static void TasksMeter_updateValues(Meter* this, char* buffer, int len) {
|
||||
|
|
|
@ -9,8 +9,6 @@ in the source distribution for its full text.
|
|||
|
||||
#include "Meter.h"
|
||||
|
||||
extern int TasksMeter_attributes[];
|
||||
|
||||
extern MeterClass TasksMeter_class;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -10,7 +10,7 @@ in the source distribution for its full text.
|
|||
#include "CRT.h"
|
||||
|
||||
|
||||
int UptimeMeter_attributes[] = {
|
||||
static const int UptimeMeter_attributes[] = {
|
||||
UPTIME
|
||||
};
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ in the source distribution for its full text.
|
|||
|
||||
#include "Meter.h"
|
||||
|
||||
extern int UptimeMeter_attributes[];
|
||||
|
||||
extern MeterClass UptimeMeter_class;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue