summaryrefslogtreecommitdiffstats
path: root/Meter.h
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2024-04-18 22:18:40 +0800
committerBenBE <BenBE@geshi.org>2024-04-20 19:36:00 +0200
commitc2c2a70997a0bf40b0484af6d82c4d41d370d06d (patch)
treeaf1e89442ddadf21cebccd2d60705cc4258d2454 /Meter.h
parentc167a2c4c514ffb1feb3b087060e0c0ee36578d1 (diff)
Define MeterModeId to unsigned int and use it throughout
All uses of meter drawing "mode" numbers now have the type `MeterModeId`, including the uses in structures and arrays. `MeterModeId` is defined as `unsigned int`, as (currently) it doesn't save any code size by defining it to any smaller type. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Diffstat (limited to 'Meter.h')
-rw-r--r--Meter.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Meter.h b/Meter.h
index ff402ae3..0d93759f 100644
--- a/Meter.h
+++ b/Meter.h
@@ -49,7 +49,7 @@ typedef struct Meter_ Meter;
typedef void(*Meter_Init)(Meter*);
typedef void(*Meter_Done)(Meter*);
-typedef void(*Meter_UpdateMode)(Meter*, int);
+typedef void(*Meter_UpdateMode)(Meter*, MeterModeId);
typedef void(*Meter_UpdateValues)(Meter*);
typedef void(*Meter_Draw)(Meter*, int, int, int);
typedef const char* (*Meter_GetCaption)(const Meter*);
@@ -64,7 +64,7 @@ typedef struct MeterClass_ {
const Meter_Draw draw;
const Meter_GetCaption getCaption;
const Meter_GetUiName getUiName;
- const int defaultMode;
+ const MeterModeId defaultMode;
const double total;
const int* const attributes;
const char* const name; /* internal name of the meter, must not contain any space */
@@ -105,7 +105,7 @@ struct Meter_ {
const Machine* host;
char* caption;
- int mode;
+ MeterModeId mode;
unsigned int param;
GraphData drawData;
int h;
@@ -137,7 +137,7 @@ void Meter_delete(Object* cast);
void Meter_setCaption(Meter* this, const char* caption);
-void Meter_setMode(Meter* this, int modeIndex);
+void Meter_setMode(Meter* this, MeterModeId modeIndex);
ListItem* Meter_toListItem(const Meter* this, bool moving);

© 2014-2024 Faster IT GmbH | imprint | privacy policy