Commit 60885506a7c07ceae66b5bebf3293762f2efdaf8

Thomas de Grivel 2024-11-18T12:26:56

fix compilation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
diff --git a/event/event.c b/event/event.c
index 0575bee..5367c67 100644
--- a/event/event.c
+++ b/event/event.c
@@ -91,8 +91,8 @@ struct event_base * kc3_event_base_new (void)
 }
 
 struct event * kc3_event_new (struct event_base **event_base, s32 fd,
-                               const s_list * const *events,
-                               const s_callable *callback, s_tag *arg)
+                              const s_list * const *events,
+                              p_callable *callback, s_tag *arg)
 {
   const s_list *e;
   struct event *ev;
@@ -127,7 +127,7 @@ struct event * kc3_event_new (struct event_base **event_base, s32 fd,
   return ev;
  invalid_event_list:
   err_write_1("kc3_event_new: invalid event list: ");
-  err_inspect_list(events);
+  err_inspect_list(*events);
   assert(! "kc3_event_new: invalid event list");
   return NULL;
 }
diff --git a/event/event.h b/event/event.h
index df5258b..2dfb230 100644
--- a/event/event.h
+++ b/event/event.h
@@ -21,7 +21,7 @@ void                kc3_event_delete (struct event *ev);
 struct event *      kc3_event_new (struct event_base **event_base,
                                    s32 fd,
                                    const s_list * const *events,
-                                   const s_callable *callback,
+                                   p_callable *callback,
                                    s_tag *arg);
 
 /* Operators. */
diff --git a/http/http_request.c b/http/http_request.c
index 51c0255..f617f47 100644
--- a/http/http_request.c
+++ b/http/http_request.c
@@ -118,7 +118,7 @@ s_tag * http_request_buf_parse (s_tag *req, s_buf *buf)
         err_inspect_tag(&body);
         err_write_1("\n");
       }
-      if (alist_get((const s_list * const *) &body.data.list,
+      if (alist_get(body.data.list,
                     &method_key, &method_value)) {
         http_request_method_from_str(&method_value.data.str,
                                      &tmp_req.method);
@@ -205,7 +205,7 @@ sw http_request_buf_write (s_http_request *req, s_buf *buf)
     err_puts("http_request_buf_write: invalid protocol: \"\"");
     return -1;
   }    
-  if (! list_is_alist((const s_list * const *) &req->headers)) {
+  if (! list_is_alist(req->headers)) {
     err_puts("http_request_buf_write: invalid headers: not an AList");
     return -1;
   }
diff --git a/http/http_response.c b/http/http_response.c
index 010f7a4..78190b6 100644
--- a/http/http_response.c
+++ b/http/http_response.c
@@ -153,7 +153,7 @@ sw http_response_buf_write (const s_http_response *response,
       tag_clean(&default_messages);
       return -1;
     }
-    if (alist_get((const s_list * const *) &default_messages.data.list,
+    if (alist_get(default_messages.data.list,
                   &tag_code, &tag_message)) {
       if (tag_message.type != TAG_STR) {
         err_puts("http_response_buf_write: invalid default message:"
@@ -383,7 +383,7 @@ s_tag * http_response_find_header (const s_http_response *res,
 }
 
 s_http_response * http_response_init_copy (s_http_response *res,
-                                           const s_http_response *src)
+                                           s_http_response *src)
 {
   s_http_response tmp = {0};
   if (! str_init_copy(&tmp.protocol, &src->protocol))
@@ -391,8 +391,7 @@ s_http_response * http_response_init_copy (s_http_response *res,
   tmp.code = src->code;
   if (! str_init_copy(&tmp.message, &src->message))
     goto clean;
-  if (! list_init_copy(&tmp.headers,
-                       (const s_list * const *) &src->headers))
+  if (! list_init_copy(&tmp.headers, &src->headers))
     goto clean;
   if (! tag_init_copy(&tmp.body, &src->body))
     goto clean;
@@ -403,7 +402,7 @@ s_http_response * http_response_init_copy (s_http_response *res,
   return NULL;
 }
 
-s_http_response * http_response_set_header (const s_http_response *res,
+s_http_response * http_response_set_header (s_http_response *res,
                                             const s_str *key,
                                             const s_str *value,
                                             s_http_response *dest)
diff --git a/http/http_response.h b/http/http_response.h
index b28aff9..899e526 100644
--- a/http/http_response.h
+++ b/http/http_response.h
@@ -19,14 +19,16 @@
    after use. */
 void              http_response_clean (s_http_response *res);
 s_http_response * http_response_init_copy (s_http_response *res,
-                                           const s_http_response *src);
+                                           s_http_response *src);
 
 /* Observers. */
 sw                http_response_buf_write (const s_http_response *res,
                                            s_buf *buf, bool send_body);
 s_tag *           http_response_find_header (const s_http_response *res,
                                              const s_str *key);
-s_http_response * http_response_set_header (const s_http_response *res,
+
+/* Operators. */
+s_http_response * http_response_set_header (s_http_response *res,
                                             const s_str *key,
                                             const s_str *value,
                                             s_http_response *dest);
diff --git a/http/mime_type.c b/http/mime_type.c
index 1749c67..b3ed039 100644
--- a/http/mime_type.c
+++ b/http/mime_type.c
@@ -17,7 +17,7 @@ const s_sym ** http_mime_type (const s_str *ext, const s_sym **dest)
 {
   s_facts_cursor cursor;
   const s_sym *default_mime_type;
-  const s_fact *fact = NULL;
+  s_fact *fact = NULL;
   s_tag tag_ext = {0};
   s_tag tag_mime_type_sym;
   s_tag tag_mime_type_value;
@@ -122,8 +122,7 @@ bool http_mime_type_buf_parse_type (s_buf *buf)
   return false;
 }
 
-bool http_mime_type_def (const s_tag *ext,
-                         const s_sym * const *mime_type)
+bool http_mime_type_def (s_tag *ext, const s_sym * const *mime_type)
 {
   s_tag tag_mime_type_sym;
   s_tag tag_mime_type_value;
diff --git a/http/mime_type.h b/http/mime_type.h
index 5660bcf..a503602 100644
--- a/http/mime_type.h
+++ b/http/mime_type.h
@@ -18,7 +18,7 @@
 const s_sym ** http_mime_type (const s_str *ext, const s_sym **dest);
 bool           http_mime_type_buf_parse (s_buf *buf);
 bool           http_mime_type_buf_parse_type (s_buf *buf);
-bool           http_mime_type_def (const s_tag *ext,
+bool           http_mime_type_def (s_tag *ext,
                                    const s_sym * const *mime_type);
 bool           http_mime_type_load (s_str *path);
 
diff --git a/libkc3/array.h b/libkc3/array.h
index 247712c..1da980e 100644
--- a/libkc3/array.h
+++ b/libkc3/array.h
@@ -35,8 +35,7 @@ s_tag *            array_data_tag (const s_array *a,
 /* Operators */
 s_tag *   array_access (s_array *a, s_list *key, s_tag *dest);
 s_array * array_allocate (s_array *a);
-s_array * array_data_set (s_array *a, const uw *address,
-                          void *data);
+s_array * array_data_set (s_array *a, const uw *address, void *data);
 s_array * array_free (s_array *a);
 
 #endif /* LIBKC3_ARRAY_H */
diff --git a/libkc3/list_init.h b/libkc3/list_init.h
index 0ff3989..32b2fe1 100644
--- a/libkc3/list_init.h
+++ b/libkc3/list_init.h
@@ -23,6 +23,9 @@ s_list * list_init_array_copy (s_list *list, const s_array *a,
                                s_list *next);
 s_list * list_init_bool (s_list *list, bool b, s_list *next);
 s_list * list_init_call (s_list *list, s_list *next);
+s_list * list_init_callable (s_list *list, s_list *next);
+s_list * list_init_callable_copy (s_list *list, p_callable *src,
+                                  s_list *next);
 s_list * list_init_character (s_list *list, character c, s_list *next);
 
 s_list * list_init_complex (s_list *list, s_complex *c, s_list *next);
@@ -110,6 +113,8 @@ s_list * list_new_array (const s_sym *type, uw dimension,
 s_list * list_new_array_copy (const s_array *a, s_list *next);
 s_list * list_new_bool (bool b, s_list *next);
 s_list * list_new_call (s_list *next);
+s_list * list_new_callable (s_list *next);
+s_list * list_new_callable_copy (p_callable *src, s_list *next);
 s_list * list_new_character (character c, s_list *next);
 
 s_list * list_new_complex (s_complex *c, s_list *next);
diff --git a/libkc3/tag.c b/libkc3/tag.c
index 7c66090..1477db8 100644
--- a/libkc3/tag.c
+++ b/libkc3/tag.c
@@ -375,6 +375,28 @@ s_tag * tag_init_call_cast (s_tag *tag, const s_sym *type)
   return tag;
 }
 
+s_tag * tag_init_callable (s_tag *tag)
+{
+  s_tag tmp = {0};
+  assert(tag);
+  tmp.type = TAG_CALL;
+  if (! p_callable_init(&tmp.data.callable))
+    return NULL;
+  *tag = tmp;
+  return tag;
+}
+
+s_tag * tag_init_callable_copy (s_tag *tag, p_callable *src)
+{
+  s_tag tmp = {0};
+  assert(tag);
+  tmp.type = TAG_CALL;
+  if (! p_callable_init_copy(&tmp.data.callable, src))
+    return NULL;
+  *tag = tmp;
+  return tag;
+}
+
 s_tag * tag_init_cast (s_tag *tag, const s_sym * const *type,
                        s_tag *src)
 {
diff --git a/libkc3/tag_init.h b/libkc3/tag_init.h
index 5e6b9ec..bbcdb7d 100644
--- a/libkc3/tag_init.h
+++ b/libkc3/tag_init.h
@@ -21,6 +21,8 @@ s_tag * tag_init_array (s_tag *tag, const s_sym *type, uw dimension,
 s_tag * tag_init_array_copy (s_tag *tag, const s_array *a);
 s_tag * tag_init_bool (s_tag *tag, bool b);
 s_tag * tag_init_call (s_tag *tag);
+s_tag * tag_init_callable (s_tag *tag);
+s_tag * tag_init_callable_copy (s_tag *tag, p_callable *src);
 s_tag * tag_init_character (s_tag *tag, character c);
 s_tag * tag_init_copy (s_tag *tag, s_tag *src);
 s_tag * tag_init_complex (s_tag *tag, s_complex *c);
@@ -92,6 +94,8 @@ s_tag * tag_new_array (const s_sym *type, uw dimension,
 s_tag * tag_new_array_copy (const s_array *a);
 s_tag * tag_new_bool (bool b);
 s_tag * tag_new_call (void);
+s_tag * tag_new_callable (void);
+s_tag * tag_new_callable_copy (p_callable *src);
 s_tag * tag_new_character (character c);
 s_tag * tag_new_copy (s_tag *src);
 s_tag * tag_new_complex (s_complex *c);
@@ -156,6 +160,8 @@ s_tag * tag_array (s_tag *tag, const s_sym *type, uw dimension,
 s_tag * tag_array_copy (s_tag *tag, const s_array *a);
 s_tag * tag_bool (s_tag *tag, bool b);
 s_tag * tag_call (s_tag *tag);
+s_tag * tag_callable (s_tag *tag);
+s_tag * tag_callable_copy (s_tag *tag, p_callable *src);
 s_tag * tag_character (s_tag *tag, character c);
 s_tag * tag_copy (s_tag *tag, s_tag *src);
 s_tag * tag_complex (s_tag *tag, s_complex *c);
diff --git a/libkc3/tag_init.rb b/libkc3/tag_init.rb
index 20ed991..2811da2 100644
--- a/libkc3/tag_init.rb
+++ b/libkc3/tag_init.rb
@@ -301,9 +301,9 @@ class TagInitList
        TagInit.new("bool", "TAG_BOOL", :init_mode_direct,
                    [Arg.new("bool", "b")]),
        TagInit.new("call", "TAG_CALL", :init_mode_init, []),
-       TagInit.new("callable", "TAG_CALLABLE", :init_mode_init, []),
-       TagInit.new("callable", "copy", "TAG_CALLABLE", :init_mode_init,
-                   []),
+       TagInitProto.new("callable", "TAG_CALLABLE", :init_mode_init, []),
+       TagInitProto.new("callable", "copy", "TAG_CALLABLE", :init_mode_init,
+                   [Arg.new("p_callable *", "src")]),
        TagInit.new("character", "TAG_CHARACTER", :init_mode_direct,
                    [Arg.new("character", "c")]),
        TagInitProto.new("copy", nil, :init_mode_none,
diff --git a/test/facts_cursor_test.c b/test/facts_cursor_test.c
index 593deb9..6c133f6 100644
--- a/test/facts_cursor_test.c
+++ b/test/facts_cursor_test.c
@@ -112,7 +112,7 @@ TEST_CASE_END(facts_cursor_init)
 TEST_CASE(facts_cursor_next)
 {
   s_facts_cursor cursor;
-  const s_fact *cursor_fact;
+  s_fact *cursor_fact;
   uw i = 0;
   char *p[24] = {
     "-0x10000000000000000",
diff --git a/test/facts_test.c b/test/facts_test.c
index 8d36fe6..fa26e1c 100644
--- a/test/facts_test.c
+++ b/test/facts_test.c
@@ -77,7 +77,7 @@ TEST_CASE(facts_add)
     "-0x10000000000000000",
     NULL
   };
-  const s_fact *pf;
+  s_fact *pf;
   s_fact fact[24];
   s_facts facts;
   facts_init(&facts);
@@ -156,7 +156,7 @@ TEST_CASE_END(facts_dump_file)
 TEST_CASE(facts_find)
 {
   bool b;
-  const s_fact *f;
+  s_fact *f;
   uw i = 0;
   char *p[24] = {
     "\"a\"",
@@ -186,7 +186,7 @@ TEST_CASE(facts_find)
   };
   s_fact fact[24];
   s_facts facts;
-  const s_fact *pf;
+  s_fact *pf;
   facts_init(&facts);
   while (p[i]) {
     fact_test_init_1(fact + i, p[i]);
@@ -232,7 +232,7 @@ TEST_CASE_END(facts_init_clean)
 
 TEST_CASE(facts_load)
 {
-  const s_fact *f;
+  s_fact *f;
   uw i = 0;
   char *p[24] = {
     "\"a\"",
@@ -402,7 +402,7 @@ TEST_CASE_END(facts_new_delete)
 TEST_CASE(facts_open_file)
 {
   bool b;
-  const s_fact *f;
+  s_fact *f;
   uw i = 0;
   char *p[24] = {
     "\"a\"",
diff --git a/test/facts_with_test.c b/test/facts_with_test.c
index 3ff11cd..6c9e9a3 100644
--- a/test/facts_with_test.c
+++ b/test/facts_with_test.c
@@ -31,7 +31,7 @@ void facts_with_test (void)
 TEST_CASE(facts_with_)
 {
   s_facts_with_cursor cursor;
-  const s_fact *f;
+  s_fact *f;
   s_fact fact;
   s_facts facts;
   sw i = 0;
@@ -232,7 +232,7 @@ TEST_CASE_END(facts_with_)
 TEST_CASE(facts_with_tags)
 {
   s_facts_cursor cursor;
-  const s_fact *f;
+  s_fact *f;
   s_fact fact;
   s_facts facts;
   sw i = 0;
diff --git a/window/cairo/demo/flies.c b/window/cairo/demo/flies.c
index 2fa8471..b5f03a1 100644
--- a/window/cairo/demo/flies.c
+++ b/window/cairo/demo/flies.c
@@ -46,7 +46,7 @@ static void fly_init (s_map *map)
   board = &map->value[0].data.array;
   in    = &map->value[1].data.uw;
   t     = &map->value[3].data.f64;
-  array_data_set(board, address, &g_board_item_fly);
+  array_data_set(board, address, (void *) &g_board_item_fly);
   *t = 0.0;
   (*in)++;
 }
@@ -77,7 +77,7 @@ bool flies_load (s_sequence *seq)
     j = 0;
     while (j < BOARD_SIZE) {
       address[1] = j;
-      array_data_set(board, address, &g_board_item_space);
+      array_data_set(board, address, (void *) &g_board_item_space);
       j++;
     }
     i++;
@@ -86,40 +86,40 @@ bool flies_load (s_sequence *seq)
   while (i < BOARD_SIZE) {
     address[0] = i;
     address[1] = 0;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     address[1] = BOARD_SIZE - 1;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     address[0] = 0;
     address[1] = i;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     address[0] = BOARD_SIZE - 1;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     i++;
   }
   address[0] = BOARD_SIZE / 2;
   address[1] = 0;
-  array_data_set(board, address, &g_board_item_space);
+  array_data_set(board, address, (void *) &g_board_item_space);
   address[1] = BOARD_SIZE - 1;
-  array_data_set(board, address, &g_board_item_space);
+  array_data_set(board, address, (void *) &g_board_item_space);
   address[1] = BOARD_SIZE / 2;
   i = 1;
   while (i <= BOARD_SIZE / 2) {
     address[0] = i;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     i++;
   }
   address[0] = BOARD_SIZE / 2;
   j = BOARD_SIZE / 4;
   while (j < BOARD_SIZE / 2) {
     address[1] = j;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     j++;
   }
   address[1] = BOARD_SIZE * 3 / 4;
   i = BOARD_SIZE / 4;
   while (i < BOARD_SIZE - 1) {
     address[0] = i;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     i++;
   }
   fly_init(map);
@@ -230,7 +230,7 @@ bool flies_render (s_sequence *seq)
                               cr, 0, 0);
             if (address[0] == BOARD_SIZE / 2 &&
                 address[1] == BOARD_SIZE - 1) {
-              array_data_set(board, address, &g_board_item_space);
+              array_data_set(board, address, (void *) &g_board_item_space);
               (*fly_out)++;
               fly_init(map);
               break;
@@ -277,8 +277,9 @@ bool flies_render (s_sequence *seq)
                                                     fly_address)) &&
                     *board_item == g_board_item_space) {
                   array_data_set(board, fly_prev_address,
-                                 &g_board_item_space);
-                  array_data_set(board, fly_address, &g_board_item_fly);
+                                 (void *) &g_board_item_space);
+                  array_data_set(board, fly_address,
+                                 (void *) &g_board_item_fly);
                   direction_prev = direction;
                   break;
                 }
@@ -290,7 +291,8 @@ bool flies_render (s_sequence *seq)
             }
             *fly_time += 1;
             if (*fly_time > FLY_TIME_MAX) {
-              array_data_set(board, fly_address, &g_board_item_dead_fly);
+              array_data_set(board, fly_address,
+                             (void *) &g_board_item_dead_fly);
               fly_init(map);
             }
             break;
diff --git a/window/sdl2/demo/flies.c b/window/sdl2/demo/flies.c
index bfb3751..28a24c0 100644
--- a/window/sdl2/demo/flies.c
+++ b/window/sdl2/demo/flies.c
@@ -51,7 +51,7 @@ static void fly_init (s_map *map)
   board = &map->value[0].data.array;
   in    = &map->value[1].data.uw;
   t     = &map->value[3].data.f64;
-  array_data_set(board, address, &g_board_item_fly);
+  array_data_set(board, address, (void *) &g_board_item_fly);
   *t = 0.0;
   (*in)++;
 }
@@ -82,7 +82,7 @@ bool flies_load (s_sequence *seq)
     j = 0;
     while (j < BOARD_SIZE) {
       address[1] = j;
-      array_data_set(board, address, &g_board_item_space);
+      array_data_set(board, address, (void *) &g_board_item_space);
       j++;
     }
     i++;
@@ -91,40 +91,40 @@ bool flies_load (s_sequence *seq)
   while (i < BOARD_SIZE) {
     address[0] = i;
     address[1] = 0;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     address[1] = BOARD_SIZE - 1;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     address[0] = 0;
     address[1] = i;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     address[0] = BOARD_SIZE - 1;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     i++;
   }
   address[0] = BOARD_SIZE / 2;
   address[1] = 0;
-  array_data_set(board, address, &g_board_item_space);
+  array_data_set(board, address, (void *) &g_board_item_space);
   address[1] = BOARD_SIZE - 1;
-  array_data_set(board, address, &g_board_item_space);
+  array_data_set(board, address, (void *) &g_board_item_space);
   address[1] = BOARD_SIZE / 2;
   i = 1;
   while (i <= BOARD_SIZE / 2) {
     address[0] = i;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     i++;
   }
   address[0] = BOARD_SIZE / 2;
   j = BOARD_SIZE / 4;
   while (j < BOARD_SIZE / 2) {
     address[1] = j;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     j++;
   }
   address[1] = BOARD_SIZE * 3 / 4;
   i = BOARD_SIZE / 4;
   while (i < BOARD_SIZE - 1) {
     address[0] = i;
-    array_data_set(board, address, &g_board_item_block);
+    array_data_set(board, address, (void *) &g_board_item_block);
     i++;
   }
   fly_init(map);
@@ -241,7 +241,8 @@ bool flies_render (s_sequence *seq)
           case BOARD_ITEM_BLOCK:
             gl_ortho_bind_texture(&g_ortho, 0);
             gl_ortho_color(&g_ortho, 0.0f, 0.0f, 1.0f, 1.0f);
-            gl_ortho_rect(&g_ortho, 0, 0, board_item_w + 1.0, board_item_h + 1.0);
+            gl_ortho_rect(&g_ortho, 0, 0, board_item_w + 1.0,
+                          board_item_h + 1.0);
             gl_ortho_color(&g_ortho, 1.0f, 1.0f, 1.0f, 1.0f);
             break;
           case BOARD_ITEM_FLY:
@@ -253,7 +254,8 @@ bool flies_render (s_sequence *seq)
                                  fly_scale, 1.0);
               gl_ortho_update_model_matrix(&g_ortho);
               gl_ortho_bind_texture(&g_ortho,
-                                    gl_sprite_texture(&g_sprite_fly, 0));
+                                    gl_sprite_texture(&g_sprite_fly,
+                                                      0));
               gl_ortho_color(&g_ortho, 1.0f, 1.0f, 1.0f, 1.0f);
               gl_ortho_rect(&g_ortho, 0, 0, g_sprite_fly.pt_w,
                             g_sprite_fly.pt_h);
@@ -261,7 +263,8 @@ bool flies_render (s_sequence *seq)
             } g_ortho.model_matrix = matrix_2;
             if (address[0] == BOARD_SIZE / 2 &&
                 address[1] == BOARD_SIZE - 1) {
-              array_data_set(board, address, &g_board_item_space);
+              array_data_set(board, address,
+                             (void *) &g_board_item_space);
               (*fly_out)++;
               fly_init(map);
               break;
@@ -308,8 +311,9 @@ bool flies_render (s_sequence *seq)
                                                     fly_address)) &&
                     *board_item == g_board_item_space) {
                   array_data_set(board, fly_prev_address,
-                                 &g_board_item_space);
-                  array_data_set(board, fly_address, &g_board_item_fly);
+                                 (void *) &g_board_item_space);
+                  array_data_set(board, fly_address,
+                                 (void *) &g_board_item_fly);
                   direction_prev = direction;
                   break;
                 }
@@ -321,7 +325,8 @@ bool flies_render (s_sequence *seq)
             }
             *fly_time += 1;
             if (*fly_time > FLY_TIME_MAX) {
-              array_data_set(board, fly_address, &g_board_item_dead_fly);
+              array_data_set(board, fly_address,
+                             (void *) &g_board_item_dead_fly);
               fly_init(map);
             }
             break;