Meter: use explicit type for drawData

This commit is contained in:
Christian Göttsche 2020-10-02 16:27:57 +02:00 committed by cgzones
parent 25022c219d
commit 0b9a001498
2 changed files with 7 additions and 7 deletions

View File

@ -259,7 +259,7 @@ static int GraphMeterMode_pixPerRow;
static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
if (!this->drawData) this->drawData = xCalloc(1, sizeof(GraphData)); if (!this->drawData) this->drawData = xCalloc(1, sizeof(GraphData));
GraphData* data = (GraphData*) this->drawData; GraphData* data = this->drawData;
const int nValues = METER_BUFFER_LEN; const int nValues = METER_BUFFER_LEN;
#ifdef HAVE_LIBNCURSESW #ifdef HAVE_LIBNCURSESW

12
Meter.h
View File

@ -53,6 +53,11 @@ typedef struct MeterClass_ {
#define Meter_name(this_) As_Meter(this_)->name #define Meter_name(this_) As_Meter(this_)->name
#define Meter_uiName(this_) As_Meter(this_)->uiName #define Meter_uiName(this_) As_Meter(this_)->uiName
typedef struct GraphData_ {
struct timeval time;
double values[METER_BUFFER_LEN];
} GraphData;
struct Meter_ { struct Meter_ {
Object super; Object super;
Meter_Draw draw; Meter_Draw draw;
@ -60,7 +65,7 @@ struct Meter_ {
char* caption; char* caption;
int mode; int mode;
int param; int param;
void* drawData; GraphData* drawData;
int h; int h;
struct ProcessList_* pl; struct ProcessList_* pl;
char curItems; char curItems;
@ -83,11 +88,6 @@ typedef enum {
LAST_METERMODE LAST_METERMODE
} MeterModeId; } MeterModeId;
typedef struct GraphData_ {
struct timeval time;
double values[METER_BUFFER_LEN];
} GraphData;
extern const MeterClass Meter_class; extern const MeterClass Meter_class;
Meter* Meter_new(struct ProcessList_* pl, int param, const MeterClass* type); Meter* Meter_new(struct ProcessList_* pl, int param, const MeterClass* type);