nissy-classic

Stable branch of nissy
git clone https://git.tronto.net/nissy-classic
Download | Log | Files | Refs | README | LICENSE

commit 1d0943fafdb3c547965917eb4dfcb4d6445461a4
parent bb689c922e2b34f6f803a6593190ba5f6993f8c5
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Mon,  1 May 2023 18:41:48 +0200

Added void in function prototypes and declarations

Diffstat:
Msrc/alg.c | 4++--
Msrc/alg.h | 4++--
Msrc/commands.c | 2+-
Msrc/commands.h | 2+-
Msrc/coord.c | 18+++++++++---------
Msrc/coord.h | 3+--
Msrc/cube.c | 14+++++++-------
Msrc/cube.h | 2+-
Msrc/env.c | 2+-
Msrc/env.h | 2+-
Msrc/moves.c | 11++++++-----
Msrc/moves.h | 2+-
Msrc/shell.c | 2+-
Msrc/shell.h | 2+-
Msrc/symcoord.c | 26+++++++++++++-------------
Msrc/symcoord.h | 2+-
Msrc/trans.c | 11++++++-----
Msrc/trans.h | 2+-
18 files changed, 56 insertions(+), 55 deletions(-)

diff --git a/src/alg.c b/src/alg.c @@ -376,7 +376,7 @@ new_alg(char *str) } AlgList * -new_alglist() +new_alglist(void) { AlgList *ret = malloc(sizeof(AlgList)); @@ -515,7 +515,7 @@ init_moveset(Moveset *ms) } void -init_all_movesets() +init_all_movesets(void) { int i; diff --git a/src/alg.h b/src/alg.h @@ -29,7 +29,7 @@ char * move_string(Move m); void movelist_to_position(Move *ml, int *pos); void moveset_to_list(Moveset ms, Move *lst); Alg * new_alg(char *str); -AlgList * new_alglist(); +AlgList * new_alglist(void); Alg * on_inverse(Alg *alg); void print_alg(Alg *alg, bool l); void print_alglist(AlgList *al, bool l); @@ -37,7 +37,7 @@ void swapmove(Move *m1, Move *m2); Alg * unniss(Alg *alg); void init_moveset(Moveset *ms); -void init_all_movesets(); +void init_all_movesets(void); #endif diff --git a/src/commands.c b/src/commands.c @@ -736,7 +736,7 @@ free_args(CommandArgs *args) } CommandArgs * -new_args() +new_args(void) { CommandArgs *args = malloc(sizeof(CommandArgs)); diff --git a/src/commands.h b/src/commands.h @@ -7,7 +7,7 @@ #include "steps.h" void free_args(CommandArgs *args); -CommandArgs * new_args(); +CommandArgs * new_args(void); extern Command * commands[]; diff --git a/src/coord.c b/src/coord.c @@ -30,12 +30,12 @@ static uint64_t move_htr_drud(Move m, uint64_t ind); static uint64_t move_htrfin(Move m, uint64_t ind); static uint64_t move_cpud_separate(Move m, uint64_t ind); -static void init_cphtr_cosets(); +static void init_cphtr_cosets(void); static void init_cphtr_left_cosets_bfs(int i, int c); static void init_cphtr_right_cosets_color(int i, int c); -static void init_cpud_separate(); -static void init_cornershtrfin(); -static void init_htr_eposs(); +static void init_cpud_separate(void); +static void init_cornershtrfin(void); +static void init_htr_eposs(void); /* All sorts of useful costants and tables **********************************/ @@ -463,7 +463,7 @@ move_cpud_separate(Move m, uint64_t ind) * know how to do. */ static void -init_cphtr_cosets() +init_cphtr_cosets(void) { unsigned int i; int c = 0, d = 0; @@ -531,7 +531,7 @@ init_cphtr_right_cosets_color(int i, int d) } static void -init_cpud_separate() +init_cpud_separate(void) { unsigned int ui; int i, co[8]; @@ -545,7 +545,7 @@ init_cpud_separate() } static void -init_cornershtrfin() +init_cornershtrfin(void) { unsigned int i, j; int n, c; @@ -576,7 +576,7 @@ init_cornershtrfin() } void -init_htr_eposs() +init_htr_eposs(void) { int ep[12], ep2[12]; int eps_solved[4] = {UL, UR, DL, DR}; @@ -594,7 +594,7 @@ init_htr_eposs() } void -init_coord() +init_coord(void) { static bool initialized = false; if (initialized) diff --git a/src/coord.h b/src/coord.h @@ -22,7 +22,6 @@ extern int cpud_separate_ant[BINOM8ON4]; extern int cpud_separate_ind[FACTORIAL8]; extern int cornershtrfin_ant[24*24/6]; -void init_coord(); +void init_coord(void); #endif - diff --git a/src/cube.c b/src/cube.c @@ -2,9 +2,9 @@ /* Local functions ***********************************************************/ -static void init_inverse(); -static bool read_invtables_file(); -static bool write_invtables_file(); +static void init_inverse(void); +static bool read_invtables_file(void); +static bool write_invtables_file(void); /* Tables ********************************************************************/ @@ -761,7 +761,7 @@ where_is_edge(Cube c, Edge e) } static bool -read_invtables_file() +read_invtables_file(void) { init_env(); @@ -802,7 +802,7 @@ read_invtables_file() } static bool -write_invtables_file() +write_invtables_file(void) { init_env(); @@ -843,7 +843,7 @@ write_invtables_file() } void -init_inverse() +init_inverse(void) { static bool initialized = false; if (initialized) @@ -926,7 +926,7 @@ init_inverse() } void -init_cube() +init_cube(void) { init_inverse(); } diff --git a/src/cube.h b/src/cube.h @@ -40,7 +40,7 @@ Center where_is_center(Cube cube, Center c); Corner where_is_corner(Cube cube, Corner c); Edge where_is_edge(Cube cube, Edge e); -void init_cube(); +void init_cube(void); #endif diff --git a/src/env.c b/src/env.c @@ -14,7 +14,7 @@ mymkdir(char *d, int m) } void -init_env() +init_env(void) { char *nissydata = getenv("NISSYDATA"); char *localdata = getenv("XDG_DATA_HOME"); diff --git a/src/env.h b/src/env.h @@ -10,6 +10,6 @@ extern char *tabledir; -void init_env(); +void init_env(void); #endif diff --git a/src/moves.c b/src/moves.c @@ -4,8 +4,8 @@ static Cube apply_move_cubearray(Move m, Cube cube, PieceFilter f); static void cleanup_aux(Alg *alg, Alg *ret, bool inv); -static bool read_mtables_file(); -static bool write_mtables_file(); +static bool read_mtables_file(void); +static bool write_mtables_file(void); /* Tables and other data *****************************************************/ @@ -342,7 +342,7 @@ cleanup_aux(Alg *alg, Alg *ret, bool inv) } static bool -read_mtables_file() +read_mtables_file(void) { init_env(); @@ -391,7 +391,7 @@ read_mtables_file() } static bool -write_mtables_file() +write_mtables_file(void) { init_env(); @@ -440,7 +440,8 @@ write_mtables_file() } void -init_moves() { +init_moves(void) +{ static bool initialized = false; if (initialized) return; diff --git a/src/moves.h b/src/moves.h @@ -25,6 +25,6 @@ Cube apply_alg_generic(Alg *alg, Cube c, PieceFilter f, bool a); Cube apply_move(Move m, Cube cube); Alg * cleanup(Alg *alg); -void init_moves(); +void init_moves(void); #endif diff --git a/src/shell.c b/src/shell.c @@ -4,7 +4,7 @@ static void cleanwhitespaces(char *line); static int parseline(char *line, char **v); bool -checkfiles() +checkfiles(void) { /* TODO: add more checks (other files, use checksum...) */ FILE *f; diff --git a/src/shell.h b/src/shell.h @@ -7,7 +7,7 @@ #define MAXTOKENLEN 255 #define MAXNTOKENS 255 -bool checkfiles(); +bool checkfiles(void); void exec_args(int c, char **v); void launch(bool batchmode); diff --git a/src/symcoord.c b/src/symcoord.c @@ -28,14 +28,14 @@ static uint64_t transform_drudfin_noE_sym16(Trans t, uint64_t ind); static uint64_t transform_nxopt31(Trans t, uint64_t ind); static void gensym(SymData *sd); -static void init_symc_moves(); -static void init_symc_trans(); +static void init_symc_moves(void); +static void init_symc_trans(void); static bool read_symdata_file(SymData *sd); -static bool read_symc_moves_file(); -static bool read_symc_trans_file(); +static bool read_symc_moves_file(void); +static bool read_symc_trans_file(void); static bool write_symdata_file(SymData *sd); -static bool write_symc_moves_file(); -static bool write_symc_trans_file(); +static bool write_symc_moves_file(void); +static bool write_symc_trans_file(void); /* Some tables ***************************************************************/ @@ -428,7 +428,7 @@ read_symdata_file(SymData *sd) } static bool -read_symc_moves_file() +read_symc_moves_file(void) { init_env(); @@ -460,7 +460,7 @@ read_symc_moves_file() } static bool -read_symc_trans_file() +read_symc_trans_file(void) { init_env(); @@ -516,7 +516,7 @@ write_symdata_file(SymData *sd) } static bool -write_symc_moves_file() +write_symc_moves_file(void) { init_env(); @@ -548,7 +548,7 @@ write_symc_moves_file() } static bool -write_symc_trans_file() +write_symc_trans_file(void) { init_env(); @@ -577,7 +577,7 @@ write_symc_trans_file() } static void -init_symc_moves() +init_symc_moves(void) { uint64_t i, ii, coo; Move j; @@ -609,7 +609,7 @@ init_symc_moves() } void -init_symc_trans() +init_symc_trans(void) { uint64_t i; int j, cp; @@ -666,7 +666,7 @@ init_symc_trans() } void -init_symcoord() +init_symcoord(void) { int i; diff --git a/src/symcoord.h b/src/symcoord.h @@ -12,6 +12,6 @@ extern Coordinate coord_nxopt31; extern SymData *all_sd[]; void free_sd(SymData *sd); -void init_symcoord(); +void init_symcoord(void); #endif diff --git a/src/trans.c b/src/trans.c @@ -2,9 +2,9 @@ /* Local functions ***********************************************************/ -static bool read_ttables_file(); +static bool read_ttables_file(void); static Cube rotate_via_compose(Trans r, Cube c, PieceFilter f); -static bool write_ttables_file(); +static bool write_ttables_file(void); /* Tables and other data *****************************************************/ @@ -56,7 +56,7 @@ Move moves_ttable[NTRANS][NMOVES]; /* Local functions implementation ********************************************/ static bool -read_ttables_file() +read_ttables_file(void) { init_env(); @@ -135,7 +135,7 @@ rotate_via_compose(Trans r, Cube c, PieceFilter f) } static bool -write_ttables_file() +write_ttables_file(void) { init_env(); @@ -262,7 +262,8 @@ transform_alg(Trans t, Alg *alg) } void -init_trans() { +init_trans(void) +{ static bool initialized = false; if (initialized) return; diff --git a/src/trans.h b/src/trans.h @@ -21,6 +21,6 @@ Trans inverse_trans(Trans t); Alg * rotation_alg(Trans i); void transform_alg(Trans i, Alg *alg); -void init_trans(); +void init_trans(void); #endif