From 0b9a0014989b8557eb16697984d9fd02b59bf47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 2 Oct 2020 16:27:57 +0200 Subject: [PATCH] Meter: use explicit type for drawData --- Meter.c | 2 +- Meter.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Meter.c b/Meter.c index c8cd19eb..3edfb233 100644 --- a/Meter.c +++ b/Meter.c @@ -259,7 +259,7 @@ static int GraphMeterMode_pixPerRow; static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { if (!this->drawData) this->drawData = xCalloc(1, sizeof(GraphData)); - GraphData* data = (GraphData*) this->drawData; + GraphData* data = this->drawData; const int nValues = METER_BUFFER_LEN; #ifdef HAVE_LIBNCURSESW diff --git a/Meter.h b/Meter.h index 0647c764..8a0c8694 100644 --- a/Meter.h +++ b/Meter.h @@ -53,6 +53,11 @@ typedef struct MeterClass_ { #define Meter_name(this_) As_Meter(this_)->name #define Meter_uiName(this_) As_Meter(this_)->uiName +typedef struct GraphData_ { + struct timeval time; + double values[METER_BUFFER_LEN]; +} GraphData; + struct Meter_ { Object super; Meter_Draw draw; @@ -60,7 +65,7 @@ struct Meter_ { char* caption; int mode; int param; - void* drawData; + GraphData* drawData; int h; struct ProcessList_* pl; char curItems; @@ -83,11 +88,6 @@ typedef enum { LAST_METERMODE } MeterModeId; -typedef struct GraphData_ { - struct timeval time; - double values[METER_BUFFER_LEN]; -} GraphData; - extern const MeterClass Meter_class; Meter* Meter_new(struct ProcessList_* pl, int param, const MeterClass* type);