Space is ArrowArray_t
This commit is contained in:
parent
ab64d8f557
commit
77909af0c5
|
@ -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;
|
||||
|
|
11
src/main.c
11
src/main.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue