From 9dea20e06847f930920406e6de539db32e2644e0 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Wed, 4 May 2016 13:39:26 +0800 Subject: Rename Meter.setValues() functions to updateValues() Rationale (copied from htop issue #471): The function name "setValues" is misleading. For most OOP (object- oriented programming) contexts, setXXX functions mean they will change some member variables of an object into something specified in function arguments. But in the *Meter_setValues() case, the new values are not from the arguments, but from a hard-coded source. The caller is not supposed to change the values[] to anything it likes, but rather to "update" the values from the source. Hence, updateValues is a better name for this family of functions. --- ClockMeter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ClockMeter.c') diff --git a/ClockMeter.c b/ClockMeter.c index a248b9bb..0af88626 100644 --- a/ClockMeter.c +++ b/ClockMeter.c @@ -19,7 +19,7 @@ int ClockMeter_attributes[] = { CLOCK }; -static void ClockMeter_setValues(Meter* this, char* buffer, int size) { +static void ClockMeter_updateValues(Meter* this, char* buffer, int size) { time_t t = time(NULL); struct tm result; struct tm *lt = localtime_r(&t, &result); @@ -32,7 +32,7 @@ MeterClass ClockMeter_class = { .extends = Class(Meter), .delete = Meter_delete }, - .setValues = ClockMeter_setValues, + .updateValues = ClockMeter_updateValues, .defaultMode = TEXT_METERMODE, .maxItems = 1, .total = 1440, /* 24*60 */ -- cgit v1.2.3