From c829689a9b285db0243880d020a727f664d41e74 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 12 Sep 2020 17:09:29 -0700 Subject: 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. --- src/modules/rtv/rtv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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); } -- cgit v1.2.1