diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-10-04 17:55:08 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-10-07 13:01:53 +0200 |
commit | 08d85e61435e43ade490ecef16437f93c0d88bed (patch) | |
tree | fd7357e4a53f7786b5001ef128ffa8e473570f00 /Meter.c | |
parent | 164051354f11c0426e09e4fa09feeca7de92e619 (diff) |
Mark Object classes and Object class fields const
Diffstat (limited to 'Meter.c')
-rw-r--r-- | Meter.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -27,13 +27,13 @@ MeterClass Meter_class = { } }; -Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type) { +Meter* Meter_new(struct ProcessList_* pl, int param, const MeterClass* type) { Meter* this = xCalloc(1, sizeof(Meter)); Object_setClass(this, type); this->h = 1; this->param = param; this->pl = pl; - type->curItems = type->maxItems; + this->curItems = type->maxItems; this->values = xCalloc(type->maxItems, sizeof(double)); this->total = type->total; this->caption = xStrdup(type->caption); @@ -191,7 +191,7 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) { // First draw in the bar[] buffer... int offset = 0; - int items = Meter_getItems(this); + int items = this->curItems; for (int i = 0; i < items; i++) { double value = this->values[i]; value = CLAMP(value, 0.0, this->total); @@ -292,7 +292,7 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { Meter_updateValues(this, buffer, nValues - 1); double value = 0.0; - int items = Meter_getItems(this); + int items = this->curItems; for (int i = 0; i < items; i++) value += this->values[i]; value /= this->total; |