test/test_list.c

changeset 489
af6be1e123aa
parent 488
9138acaa494b
child 491
6d538177f746
equal deleted inserted replaced
488:9138acaa494b 489:af6be1e123aa
50 const ptrdiff_t loc_next = offsetof(struct node, next); 50 const ptrdiff_t loc_next = offsetof(struct node, next);
51 const ptrdiff_t loc_data = offsetof(struct node, data); 51 const ptrdiff_t loc_data = offsetof(struct node, data);
52 52
53 struct node *create_test_data( 53 struct node *create_test_data(
54 size_t n, 54 size_t n,
55 const int data[] 55 int const data[]
56 ) { 56 ) {
57 if (n == 0) return NULL; 57 if (n == 0) return NULL;
58 struct node *begin = calloc(1, sizeof(struct node)); 58 struct node *begin = calloc(1, sizeof(struct node));
59 struct node *prev = begin; 59 struct node *prev = begin;
60 if (data) begin->data = data[0]; 60 if (data) begin->data = data[0];

mercurial