aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-05-01 18:41:48 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-05-01 18:49:11 +0200
commit1d0943fafdb3c547965917eb4dfcb4d6445461a4 (patch)
treec924a58f9caa5d61095af780afcb46ff3a0deee9
parentbb689c922e2b34f6f803a6593190ba5f6993f8c5 (diff)
downloadnissy-classic-1d0943fafdb3c547965917eb4dfcb4d6445461a4.tar.gz
nissy-classic-1d0943fafdb3c547965917eb4dfcb4d6445461a4.zip
Added void in function prototypes and declarations
Diffstat (limited to '')
-rw-r--r--src/alg.c4
-rw-r--r--src/alg.h4
-rw-r--r--src/commands.c2
-rw-r--r--src/commands.h2
-rw-r--r--src/coord.c18
-rw-r--r--src/coord.h3
-rw-r--r--src/cube.c14
-rw-r--r--src/cube.h2
-rw-r--r--src/env.c2
-rw-r--r--src/env.h2
-rw-r--r--src/moves.c11
-rw-r--r--src/moves.h2
-rw-r--r--src/shell.c2
-rw-r--r--src/shell.h2
-rw-r--r--src/symcoord.c26
-rw-r--r--src/symcoord.h2
-rw-r--r--src/trans.c11
-rw-r--r--src/trans.h2
18 files changed, 56 insertions, 55 deletions
diff --git a/src/alg.c b/src/alg.c
index 52bebc0..66b2704 100644
--- a/src/alg.c
+++ b/src/alg.c
@@ -376,7 +376,7 @@ new_alg(char *str)
376} 376}
377 377
378AlgList * 378AlgList *
379new_alglist() 379new_alglist(void)
380{ 380{
381 AlgList *ret = malloc(sizeof(AlgList)); 381 AlgList *ret = malloc(sizeof(AlgList));
382 382
@@ -515,7 +515,7 @@ init_moveset(Moveset *ms)
515} 515}
516 516
517void 517void
518init_all_movesets() 518init_all_movesets(void)
519{ 519{
520 int i; 520 int i;
521 521
diff --git a/src/alg.h b/src/alg.h
index 6bee26b..ee73b64 100644
--- a/src/alg.h
+++ b/src/alg.h
@@ -29,7 +29,7 @@ char * move_string(Move m);
29void movelist_to_position(Move *ml, int *pos); 29void movelist_to_position(Move *ml, int *pos);
30void moveset_to_list(Moveset ms, Move *lst); 30void moveset_to_list(Moveset ms, Move *lst);
31Alg * new_alg(char *str); 31Alg * new_alg(char *str);
32AlgList * new_alglist(); 32AlgList * new_alglist(void);
33Alg * on_inverse(Alg *alg); 33Alg * on_inverse(Alg *alg);
34void print_alg(Alg *alg, bool l); 34void print_alg(Alg *alg, bool l);
35void print_alglist(AlgList *al, bool l); 35void print_alglist(AlgList *al, bool l);
@@ -37,7 +37,7 @@ void swapmove(Move *m1, Move *m2);
37Alg * unniss(Alg *alg); 37Alg * unniss(Alg *alg);
38 38
39void init_moveset(Moveset *ms); 39void init_moveset(Moveset *ms);
40void init_all_movesets(); 40void init_all_movesets(void);
41 41
42#endif 42#endif
43 43
diff --git a/src/commands.c b/src/commands.c
index 4d3ad50..7dd2e45 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -736,7 +736,7 @@ free_args(CommandArgs *args)
736} 736}
737 737
738CommandArgs * 738CommandArgs *
739new_args() 739new_args(void)
740{ 740{
741 CommandArgs *args = malloc(sizeof(CommandArgs)); 741 CommandArgs *args = malloc(sizeof(CommandArgs));
742 742
diff --git a/src/commands.h b/src/commands.h
index b7a4c36..ca09875 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -7,7 +7,7 @@
7#include "steps.h" 7#include "steps.h"
8 8
9void free_args(CommandArgs *args); 9void free_args(CommandArgs *args);
10CommandArgs * new_args(); 10CommandArgs * new_args(void);
11 11
12extern Command * commands[]; 12extern Command * commands[];
13 13
diff --git a/src/coord.c b/src/coord.c
index a9df9fd..0d87ffa 100644
--- a/src/coord.c
+++ b/src/coord.c
@@ -30,12 +30,12 @@ static uint64_t move_htr_drud(Move m, uint64_t ind);
30static uint64_t move_htrfin(Move m, uint64_t ind); 30static uint64_t move_htrfin(Move m, uint64_t ind);
31static uint64_t move_cpud_separate(Move m, uint64_t ind); 31static uint64_t move_cpud_separate(Move m, uint64_t ind);
32 32
33static void init_cphtr_cosets(); 33static void init_cphtr_cosets(void);
34static void init_cphtr_left_cosets_bfs(int i, int c); 34static void init_cphtr_left_cosets_bfs(int i, int c);
35static void init_cphtr_right_cosets_color(int i, int c); 35static void init_cphtr_right_cosets_color(int i, int c);
36static void init_cpud_separate(); 36static void init_cpud_separate(void);
37static void init_cornershtrfin(); 37static void init_cornershtrfin(void);
38static void init_htr_eposs(); 38static void init_htr_eposs(void);
39 39
40 40
41/* All sorts of useful costants and tables **********************************/ 41/* All sorts of useful costants and tables **********************************/
@@ -463,7 +463,7 @@ move_cpud_separate(Move m, uint64_t ind)
463 * know how to do. 463 * know how to do.
464 */ 464 */
465static void 465static void
466init_cphtr_cosets() 466init_cphtr_cosets(void)
467{ 467{
468 unsigned int i; 468 unsigned int i;
469 int c = 0, d = 0; 469 int c = 0, d = 0;
@@ -531,7 +531,7 @@ init_cphtr_right_cosets_color(int i, int d)
531} 531}
532 532
533static void 533static void
534init_cpud_separate() 534init_cpud_separate(void)
535{ 535{
536 unsigned int ui; 536 unsigned int ui;
537 int i, co[8]; 537 int i, co[8];
@@ -545,7 +545,7 @@ init_cpud_separate()
545} 545}
546 546
547static void 547static void
548init_cornershtrfin() 548init_cornershtrfin(void)
549{ 549{
550 unsigned int i, j; 550 unsigned int i, j;
551 int n, c; 551 int n, c;
@@ -576,7 +576,7 @@ init_cornershtrfin()
576} 576}
577 577
578void 578void
579init_htr_eposs() 579init_htr_eposs(void)
580{ 580{
581 int ep[12], ep2[12]; 581 int ep[12], ep2[12];
582 int eps_solved[4] = {UL, UR, DL, DR}; 582 int eps_solved[4] = {UL, UR, DL, DR};
@@ -594,7 +594,7 @@ init_htr_eposs()
594} 594}
595 595
596void 596void
597init_coord() 597init_coord(void)
598{ 598{
599 static bool initialized = false; 599 static bool initialized = false;
600 if (initialized) 600 if (initialized)
diff --git a/src/coord.h b/src/coord.h
index 61398a4..d9fbc4c 100644
--- a/src/coord.h
+++ b/src/coord.h
@@ -22,7 +22,6 @@ extern int cpud_separate_ant[BINOM8ON4];
22extern int cpud_separate_ind[FACTORIAL8]; 22extern int cpud_separate_ind[FACTORIAL8];
23extern int cornershtrfin_ant[24*24/6]; 23extern int cornershtrfin_ant[24*24/6];
24 24
25void init_coord(); 25void init_coord(void);
26 26
27#endif 27#endif
28
diff --git a/src/cube.c b/src/cube.c
index aae3a6e..cbd7762 100644
--- a/src/cube.c
+++ b/src/cube.c
@@ -2,9 +2,9 @@
2 2
3/* Local functions ***********************************************************/ 3/* Local functions ***********************************************************/
4 4
5static void init_inverse(); 5static void init_inverse(void);
6static bool read_invtables_file(); 6static bool read_invtables_file(void);
7static bool write_invtables_file(); 7static bool write_invtables_file(void);
8 8
9/* Tables ********************************************************************/ 9/* Tables ********************************************************************/
10 10
@@ -761,7 +761,7 @@ where_is_edge(Cube c, Edge e)
761} 761}
762 762
763static bool 763static bool
764read_invtables_file() 764read_invtables_file(void)
765{ 765{
766 init_env(); 766 init_env();
767 767
@@ -802,7 +802,7 @@ read_invtables_file()
802} 802}
803 803
804static bool 804static bool
805write_invtables_file() 805write_invtables_file(void)
806{ 806{
807 init_env(); 807 init_env();
808 808
@@ -843,7 +843,7 @@ write_invtables_file()
843} 843}
844 844
845void 845void
846init_inverse() 846init_inverse(void)
847{ 847{
848 static bool initialized = false; 848 static bool initialized = false;
849 if (initialized) 849 if (initialized)
@@ -926,7 +926,7 @@ init_inverse()
926} 926}
927 927
928void 928void
929init_cube() 929init_cube(void)
930{ 930{
931 init_inverse(); 931 init_inverse();
932} 932}
diff --git a/src/cube.h b/src/cube.h
index 483a89a..5dee6ea 100644
--- a/src/cube.h
+++ b/src/cube.h
@@ -40,7 +40,7 @@ Center where_is_center(Cube cube, Center c);
40Corner where_is_corner(Cube cube, Corner c); 40Corner where_is_corner(Cube cube, Corner c);
41Edge where_is_edge(Cube cube, Edge e); 41Edge where_is_edge(Cube cube, Edge e);
42 42
43void init_cube(); 43void init_cube(void);
44 44
45#endif 45#endif
46 46
diff --git a/src/env.c b/src/env.c
index 282bc8f..23b78d1 100644
--- a/src/env.c
+++ b/src/env.c
@@ -14,7 +14,7 @@ mymkdir(char *d, int m)
14} 14}
15 15
16void 16void
17init_env() 17init_env(void)
18{ 18{
19 char *nissydata = getenv("NISSYDATA"); 19 char *nissydata = getenv("NISSYDATA");
20 char *localdata = getenv("XDG_DATA_HOME"); 20 char *localdata = getenv("XDG_DATA_HOME");
diff --git a/src/env.h b/src/env.h
index 871a9c1..97df119 100644
--- a/src/env.h
+++ b/src/env.h
@@ -10,6 +10,6 @@
10 10
11extern char *tabledir; 11extern char *tabledir;
12 12
13void init_env(); 13void init_env(void);
14 14
15#endif 15#endif
diff --git a/src/moves.c b/src/moves.c
index 02880ca..955e8cf 100644
--- a/src/moves.c
+++ b/src/moves.c
@@ -4,8 +4,8 @@
4 4
5static Cube apply_move_cubearray(Move m, Cube cube, PieceFilter f); 5static Cube apply_move_cubearray(Move m, Cube cube, PieceFilter f);
6static void cleanup_aux(Alg *alg, Alg *ret, bool inv); 6static void cleanup_aux(Alg *alg, Alg *ret, bool inv);
7static bool read_mtables_file(); 7static bool read_mtables_file(void);
8static bool write_mtables_file(); 8static bool write_mtables_file(void);
9 9
10/* Tables and other data *****************************************************/ 10/* Tables and other data *****************************************************/
11 11
@@ -342,7 +342,7 @@ cleanup_aux(Alg *alg, Alg *ret, bool inv)
342} 342}
343 343
344static bool 344static bool
345read_mtables_file() 345read_mtables_file(void)
346{ 346{
347 init_env(); 347 init_env();
348 348
@@ -391,7 +391,7 @@ read_mtables_file()
391} 391}
392 392
393static bool 393static bool
394write_mtables_file() 394write_mtables_file(void)
395{ 395{
396 init_env(); 396 init_env();
397 397
@@ -440,7 +440,8 @@ write_mtables_file()
440} 440}
441 441
442void 442void
443init_moves() { 443init_moves(void)
444{
444 static bool initialized = false; 445 static bool initialized = false;
445 if (initialized) 446 if (initialized)
446 return; 447 return;
diff --git a/src/moves.h b/src/moves.h
index 14ae087..61c5622 100644
--- a/src/moves.h
+++ b/src/moves.h
@@ -25,6 +25,6 @@ Cube apply_alg_generic(Alg *alg, Cube c, PieceFilter f, bool a);
25Cube apply_move(Move m, Cube cube); 25Cube apply_move(Move m, Cube cube);
26Alg * cleanup(Alg *alg); 26Alg * cleanup(Alg *alg);
27 27
28void init_moves(); 28void init_moves(void);
29 29
30#endif 30#endif
diff --git a/src/shell.c b/src/shell.c
index 0001e0d..9c3173b 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -4,7 +4,7 @@ static void cleanwhitespaces(char *line);
4static int parseline(char *line, char **v); 4static int parseline(char *line, char **v);
5 5
6bool 6bool
7checkfiles() 7checkfiles(void)
8{ 8{
9 /* TODO: add more checks (other files, use checksum...) */ 9 /* TODO: add more checks (other files, use checksum...) */
10 FILE *f; 10 FILE *f;
diff --git a/src/shell.h b/src/shell.h
index 7e4f785..0dc274c 100644
--- a/src/shell.h
+++ b/src/shell.h
@@ -7,7 +7,7 @@
7#define MAXTOKENLEN 255 7#define MAXTOKENLEN 255
8#define MAXNTOKENS 255 8#define MAXNTOKENS 255
9 9
10bool checkfiles(); 10bool checkfiles(void);
11void exec_args(int c, char **v); 11void exec_args(int c, char **v);
12void launch(bool batchmode); 12void launch(bool batchmode);
13 13
diff --git a/src/symcoord.c b/src/symcoord.c
index 20d7c28..8ea4dfd 100644
--- a/src/symcoord.c
+++ b/src/symcoord.c
@@ -28,14 +28,14 @@ static uint64_t transform_drudfin_noE_sym16(Trans t, uint64_t ind);
28static uint64_t transform_nxopt31(Trans t, uint64_t ind); 28static uint64_t transform_nxopt31(Trans t, uint64_t ind);
29 29
30static void gensym(SymData *sd); 30static void gensym(SymData *sd);
31static void init_symc_moves(); 31static void init_symc_moves(void);
32static void init_symc_trans(); 32static void init_symc_trans(void);
33static bool read_symdata_file(SymData *sd); 33static bool read_symdata_file(SymData *sd);
34static bool read_symc_moves_file(); 34static bool read_symc_moves_file(void);
35static bool read_symc_trans_file(); 35static bool read_symc_trans_file(void);
36static bool write_symdata_file(SymData *sd); 36static bool write_symdata_file(SymData *sd);
37static bool write_symc_moves_file(); 37static bool write_symc_moves_file(void);
38static bool write_symc_trans_file(); 38static bool write_symc_trans_file(void);
39 39
40/* Some tables ***************************************************************/ 40/* Some tables ***************************************************************/
41 41
@@ -428,7 +428,7 @@ read_symdata_file(SymData *sd)
428} 428}
429 429
430static bool 430static bool
431read_symc_moves_file() 431read_symc_moves_file(void)
432{ 432{
433 init_env(); 433 init_env();
434 434
@@ -460,7 +460,7 @@ read_symc_moves_file()
460} 460}
461 461
462static bool 462static bool
463read_symc_trans_file() 463read_symc_trans_file(void)
464{ 464{
465 init_env(); 465 init_env();
466 466
@@ -516,7 +516,7 @@ write_symdata_file(SymData *sd)
516} 516}
517 517
518static bool 518static bool
519write_symc_moves_file() 519write_symc_moves_file(void)
520{ 520{
521 init_env(); 521 init_env();
522 522
@@ -548,7 +548,7 @@ write_symc_moves_file()
548} 548}
549 549
550static bool 550static bool
551write_symc_trans_file() 551write_symc_trans_file(void)
552{ 552{
553 init_env(); 553 init_env();
554 554
@@ -577,7 +577,7 @@ write_symc_trans_file()
577} 577}
578 578
579static void 579static void
580init_symc_moves() 580init_symc_moves(void)
581{ 581{
582 uint64_t i, ii, coo; 582 uint64_t i, ii, coo;
583 Move j; 583 Move j;
@@ -609,7 +609,7 @@ init_symc_moves()
609} 609}
610 610
611void 611void
612init_symc_trans() 612init_symc_trans(void)
613{ 613{
614 uint64_t i; 614 uint64_t i;
615 int j, cp; 615 int j, cp;
@@ -666,7 +666,7 @@ init_symc_trans()
666} 666}
667 667
668void 668void
669init_symcoord() 669init_symcoord(void)
670{ 670{
671 int i; 671 int i;
672 672
diff --git a/src/symcoord.h b/src/symcoord.h
index 0882bff..75e67b1 100644
--- a/src/symcoord.h
+++ b/src/symcoord.h
@@ -12,6 +12,6 @@ extern Coordinate coord_nxopt31;
12extern SymData *all_sd[]; 12extern SymData *all_sd[];
13 13
14void free_sd(SymData *sd); 14void free_sd(SymData *sd);
15void init_symcoord(); 15void init_symcoord(void);
16 16
17#endif 17#endif
diff --git a/src/trans.c b/src/trans.c
index e267a17..67056a6 100644
--- a/src/trans.c
+++ b/src/trans.c
@@ -2,9 +2,9 @@
2 2
3/* Local functions ***********************************************************/ 3/* Local functions ***********************************************************/
4 4
5static bool read_ttables_file(); 5static bool read_ttables_file(void);
6static Cube rotate_via_compose(Trans r, Cube c, PieceFilter f); 6static Cube rotate_via_compose(Trans r, Cube c, PieceFilter f);
7static bool write_ttables_file(); 7static bool write_ttables_file(void);
8 8
9/* Tables and other data *****************************************************/ 9/* Tables and other data *****************************************************/
10 10
@@ -56,7 +56,7 @@ Move moves_ttable[NTRANS][NMOVES];
56/* Local functions implementation ********************************************/ 56/* Local functions implementation ********************************************/
57 57
58static bool 58static bool
59read_ttables_file() 59read_ttables_file(void)
60{ 60{
61 init_env(); 61 init_env();
62 62
@@ -135,7 +135,7 @@ rotate_via_compose(Trans r, Cube c, PieceFilter f)
135} 135}
136 136
137static bool 137static bool
138write_ttables_file() 138write_ttables_file(void)
139{ 139{
140 init_env(); 140 init_env();
141 141
@@ -262,7 +262,8 @@ transform_alg(Trans t, Alg *alg)
262} 262}
263 263
264void 264void
265init_trans() { 265init_trans(void)
266{
266 static bool initialized = false; 267 static bool initialized = false;
267 if (initialized) 268 if (initialized)
268 return; 269 return;
diff --git a/src/trans.h b/src/trans.h
index 51df12f..8c5a8b8 100644
--- a/src/trans.h
+++ b/src/trans.h
@@ -21,6 +21,6 @@ Trans inverse_trans(Trans t);
21Alg * rotation_alg(Trans i); 21Alg * rotation_alg(Trans i);
22void transform_alg(Trans i, Alg *alg); 22void transform_alg(Trans i, Alg *alg);
23 23
24void init_trans(); 24void init_trans(void);
25 25
26#endif 26#endif

Generated with cgit - Back to sebastiano.tronto.net