summaryrefslogtreecommitdiff
path: root/choices.h
diff options
context:
space:
mode:
authorJohn Hawthorn <john@freerunningtechnologies.com>2014-09-17 10:43:01 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2014-09-17 19:11:14 -0700
commit39248de046c1debca11aadadde1bc5cd23d487d0 (patch)
tree6d302f8569443a0e2f5fc2fc3814a4f7c8119c8e /choices.h
parent989644d5ff9039ba23aedca109068944346c8936 (diff)
Use AoS instead of SoA; don't use qsort_r
Fixes Bus Error on BSDs due to qsort_r not being the same qsort_r as linux.
Diffstat (limited to 'choices.h')
-rw-r--r--choices.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/choices.h b/choices.h
index e87d2b7..2687893 100644
--- a/choices.h
+++ b/choices.h
@@ -1,14 +1,18 @@
#ifndef CHOICES_H
#define CHOICES_H CHOICES_H
+struct scored_position {
+ size_t position;
+ double score;
+};
+
typedef struct {
size_t capacity;
size_t size;
const char **strings;
- double *scores;
+ struct scored_position *results;
- size_t *sorted;
size_t available;
size_t selection;
} choices_t;