aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/distribution.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers/distribution.h')
-rw-r--r--src/solvers/distribution.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/solvers/distribution.h b/src/solvers/distribution.h
index e9302da..78b9b5e 100644
--- a/src/solvers/distribution.h
+++ b/src/solvers/distribution.h
@@ -10,13 +10,13 @@ typedef struct {
10 const unsigned char *table; 10 const unsigned char *table;
11} getdistribution_data_t; 11} getdistribution_data_t;
12 12
13STATIC void *getdistribution_runthread(void *); 13STATIC wrapthread_return_t getdistribution_runthread(void *);
14STATIC void getdistribution(const unsigned char *, 14STATIC void getdistribution(const unsigned char *,
15 uint64_t [static INFO_DISTRIBUTION_LEN], const tableinfo_t [static 1]); 15 uint64_t [static INFO_DISTRIBUTION_LEN], const tableinfo_t [static 1]);
16STATIC bool distribution_equal(const uint64_t [static INFO_DISTRIBUTION_LEN], 16STATIC bool distribution_equal(const uint64_t [static INFO_DISTRIBUTION_LEN],
17 const uint64_t [static INFO_DISTRIBUTION_LEN], uint8_t); 17 const uint64_t [static INFO_DISTRIBUTION_LEN], uint8_t);
18 18
19STATIC void * 19STATIC wrapthread_return_t
20getdistribution_runthread(void *arg) 20getdistribution_runthread(void *arg)
21{ 21{
22 getdistribution_data_t *data = (getdistribution_data_t *)arg; 22 getdistribution_data_t *data = (getdistribution_data_t *)arg;
@@ -33,7 +33,7 @@ getdistribution_runthread(void *arg)
33 for (j = 0; j < ENTRIES_PER_BYTE(k); j++) 33 for (j = 0; j < ENTRIES_PER_BYTE(k); j++)
34 data->distr[(table[i] & (m << (j*k))) >> (j*k)]++; 34 data->distr[(table[i] & (m << (j*k))) >> (j*k)]++;
35 35
36 return NULL; 36 return wrapthread_return_val;
37} 37}
38 38
39STATIC void 39STATIC void
@@ -60,12 +60,12 @@ getdistribution(
60 .distr = local_distr[i], 60 .distr = local_distr[i],
61 .table = table, 61 .table = table,
62 }; 62 };
63 wrapthread_create(&thread[i], NULL, 63 wrapthread_create(&thread[i],
64 getdistribution_runthread, &targ[i]); 64 getdistribution_runthread, &targ[i]);
65 } 65 }
66 66
67 for (i = 0; i < THREADS; i++) 67 for (i = 0; i < THREADS; i++)
68 wrapthread_join(thread[i], NULL); 68 wrapthread_join(thread[i]);
69 69
70 memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t)); 70 memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t));
71 for (i = 0; i < THREADS; i++) 71 for (i = 0; i < THREADS; i++)

Generated with cgit - Back to sebastiano.tronto.net