summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-09-12 17:09:29 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-09-12 17:09:29 -0700
commitc829689a9b285db0243880d020a727f664d41e74 (patch)
tree85c4a063a24918515f0102222272ffad00e1c708 /src/modules
parent643148737f38151d7bfdec1ad45718f5616e0ac9 (diff)
modules/rtv: s/ticket/order/
Ticket is unnecessarily abstract/opaque of a name for this, it's simply the sort order. No point making the reader grok whatever model I was thinking when I wrote it at the time, i.e. tickets at a butcher counter.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/rtv/rtv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c
index 9b46b79..be974d1 100644
--- a/src/modules/rtv/rtv.c
+++ b/src/modules/rtv/rtv.c
@@ -21,7 +21,7 @@
typedef struct rtv_module_t {
const rototiller_module_t *module;
- unsigned ticket;
+ unsigned order;
} rtv_module_t;
typedef struct rtv_context_t {
@@ -68,10 +68,10 @@ static int cmp_modules(const void *p1, const void *p2)
{
const rtv_module_t *m1 = p1, *m2 = p2;
- if (m1->ticket < m2->ticket)
+ if (m1->order < m2->order)
return -1;
- if (m1->ticket > m2->ticket)
+ if (m1->order > m2->order)
return 1;
return 0;
@@ -81,7 +81,7 @@ static int cmp_modules(const void *p1, const void *p2)
static void randomize_modules(rtv_context_t *ctxt)
{
for (size_t i = 0; i < ctxt->n_modules; i++)
- ctxt->modules[i].ticket = rand();
+ ctxt->modules[i].order = rand();
qsort(ctxt->modules, ctxt->n_modules, sizeof(rtv_module_t), cmp_modules);
}
© All Rights Reserved