Space is ArrowArray_t

This commit is contained in:
Adrien Bourmault 2021-06-16 12:01:29 +02:00
parent ab64d8f557
commit 77909af0c5
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
2 changed files with 11 additions and 8 deletions

View File

@ -34,12 +34,12 @@ struct {
int x;
int y;
int z;
int xmax;
int ymax;
int zmax;
} typedef Arrow_t;
struct {
int xmax;
int ymax;
int zmax;
size_t size;
Arrow_t *space;
} typedef ArrowArray_t; //XXX
@ -59,7 +59,7 @@ struct {
//
struct {
IntArray_t *globalDrawingSpace;
ArrowArray_t *globalDrawingSpace;
IntArray_t *transitionsTree;
ArrowArray_t *arrowList;
int nmaxThread;

View File

@ -48,18 +48,21 @@ int main(int argc, char **argv)
//
scheduler0 = (Scheduler_t*) calloc(1, sizeof(Scheduler_t));
scheduler0->globalDrawingSpace = (IntArray_t*) calloc(1, sizeof(IntArray_t));
scheduler0->globalDrawingSpace =
(ArrowArray_t*) calloc(1, sizeof(IntArray_t));
scheduler0->globalDrawingSpace->space =
(int*) calloc(SPACE_SIZE, sizeof(int));
(Arrow_t*) calloc(SPACE_SIZE, sizeof(Arrow_t));
scheduler0->globalDrawingSpace->size = SPACE_SIZE;
scheduler0->arrowList = (ArrowArray_t*) calloc(1, sizeof(ArrowArray_t));
scheduler0->arrowList->space = (Arrow_t*) calloc(ARROW_NUMBER, sizeof(Arrow_t));
scheduler0->arrowList->space =
(Arrow_t*) calloc(ARROW_NUMBER, sizeof(Arrow_t));
scheduler0->arrowList->size = ARROW_NUMBER;
printLog("Populating a random arrow list...\n");
for (int i = 0; i < ARROW_NUMBER; i++) {
scheduler0->arrowList->space[i].x = rand() % SPACE_SIZE;
scheduler0->arrowList->space[i].x =
rand() % scheduler0->globalDrawingSpace->xmax;
scheduler0->arrowList->space[i].y = rand() % SPACE_SIZE;
scheduler0->arrowList->space[i].z = rand() % SPACE_SIZE;
}