From: Michael Stapelberg Date: Thu, 3 Nov 2016 08:55:46 +0000 (+0100) Subject: fix prototypes X-Git-Tag: rgb2rv17~27 X-Git-Url: https://git.sur5r.net/?p=c128-kasse;a=commitdiff_plain;h=3cdc0de1c9d9a6e85db0bbe8055c4998d6edf1a7;hp=946fa5052f1d3cc4fc4077c380cb86ce4c566a00 fix prototypes …to fix the build with cc65 2.15.0.git.1474623290.bc94d53 The deposit_credit prototype was lacking the char *input parameter. All other prototypes needed an explicit “void” to signal that they are not taking any parameters. --- diff --git a/include/c128time.h b/include/c128time.h index 039fcd2..a53d268 100644 --- a/include/c128time.h +++ b/include/c128time.h @@ -1,5 +1,5 @@ #ifndef TIME_H_ #define TIME_H_ void set_time(BYTE hrs, BYTE min, BYTE sec); -char *get_time(); +char *get_time(void); #endif diff --git a/include/config.h b/include/config.h index dfba87e..b29f10d 100644 --- a/include/config.h +++ b/include/config.h @@ -48,11 +48,11 @@ extern struct credits_array_t credits; #endif /* Lädt Dinge wie die Druckeradresse */ -void load_config(); -void load_items(); -void load_credits(); -//void dump_state(); +void load_config(void); +void load_items(void); +void load_credits(void); +//void dump_state(void); -void save_items(); -void save_credits(); +void save_items(void); +void save_credits(void); #endif /*CONFIG_H_*/ diff --git a/include/credit_manager.h b/include/credit_manager.h index c5dfb99..dba26c7 100644 --- a/include/credit_manager.h +++ b/include/credit_manager.h @@ -1,6 +1,6 @@ #ifndef CREDIT_MANAGER_H_ #define CREDIT_MANAGER_H_ struct credits_t *find_credit(char *name); -void deposit_credit(); -void credit_manager(); +void deposit_credit(char *input); +void credit_manager(void); #endif diff --git a/include/general.h b/include/general.h index 5691400..cdc997e 100644 --- a/include/general.h +++ b/include/general.h @@ -1,8 +1,8 @@ #ifndef GENERAL_H_ #define GENERAL_H_ typedef unsigned char BYTE; -char *get_input(); -char retry_or_quit(); +char *get_input(void); +char retry_or_quit(void); char *format_euro(char * s, int maxlen, int cent); void c128_perror(BYTE, char*); extern BYTE _oserror; diff --git a/include/kasse.h b/include/kasse.h index 76d414b..93650f3 100644 --- a/include/kasse.h +++ b/include/kasse.h @@ -1,7 +1,7 @@ #ifndef _KASSE_H #define _KASSE_H -void print_the_buffer(); +void print_the_buffer(void); #ifdef _IS_KASSE BYTE printing = 1; diff --git a/include/print.h b/include/print.h index 33acad2..78d65d0 100644 --- a/include/print.h +++ b/include/print.h @@ -1,9 +1,9 @@ #ifndef _PRINT_H #define _PRINT_H -void init_log(); -void print_the_buffer(); -void print_header(); +void init_log(void); +void print_the_buffer(void); +void print_header(void); void log_file(const char *s); void log_flush(void); diff --git a/src/c128time.c b/src/c128time.c index 40a86a4..7bba5b8 100644 --- a/src/c128time.c +++ b/src/c128time.c @@ -10,7 +10,7 @@ #include "general.h" #include -char *get_time() { +char *get_time(void) { uint32_t h = PEEK(0x00A0) * 65536, m = PEEK(0x00A1) * 256, s = PEEK(0x00A2); diff --git a/src/cat.c b/src/cat.c index 37f60e7..ee93962 100644 --- a/src/cat.c +++ b/src/cat.c @@ -8,7 +8,7 @@ #define x2(x) (buffer[x] <= 0xF ? "0" : ""), buffer[x] -int main() { +int main(void) { char *filename = NULL; FILE *file; unsigned int c; diff --git a/src/config.c b/src/config.c index 7304c07..c7c9914 100644 --- a/src/config.c +++ b/src/config.c @@ -37,7 +37,7 @@ struct credits_array_t credits; * files directly) * */ -static void lookup_needed_files() { +static void lookup_needed_files(void) { BYTE lfn = 8, c; struct cbm_dirent dirent; char filename[8]; @@ -79,7 +79,7 @@ static void lookup_needed_files() { } } -void load_items() { +void load_items(void) { BYTE c; if (items_exists) { @@ -91,27 +91,27 @@ void load_items() { memset(&status, 0, sizeof(struct status_array_t)); } -void load_credits() { +void load_credits(void) { if (credits_exists) cbm_load("credits", (BYTE)8, &credits); else memset(&credits, 0, sizeof(struct credits_array_t)); } -void save_items() { +void save_items(void) { if (items_exists) _sysremove("items"); cbm_save("items", (BYTE)8, &status, sizeof(struct status_array_t)); items_exists = true; } -void save_credits() { +void save_credits(void) { if (credits_exists) _sysremove("credits"); cbm_save("credits", (BYTE)8, &credits, sizeof(struct credits_array_t)); credits_exists = true; } -void load_config() { +void load_config(void) { lookup_needed_files(); } diff --git a/src/credit_manager.c b/src/credit_manager.c index 670926d..a8a8e3a 100644 --- a/src/credit_manager.c +++ b/src/credit_manager.c @@ -21,7 +21,7 @@ static BYTE filter_len; static BYTE current_credits_page = 0; -static void credit_print_screen() { +static void credit_print_screen(void) { BYTE i, pages; char buffer[10]; @@ -91,7 +91,7 @@ void deposit_credit(char *input) { toggle_videomode(); } -static void new_credit() { +static void new_credit(void) { char *input, *name; char *time; int credit; @@ -126,7 +126,7 @@ static void _delete_credit(BYTE num) { credits.credits[num].credit = 0; } -static void delete_credit() { +static void delete_credit(void) { char *input; BYTE num, last; diff --git a/src/general.c b/src/general.c index 0e50a72..bdd38ea 100644 --- a/src/general.c +++ b/src/general.c @@ -18,7 +18,7 @@ * erneut aufruft * */ -char *get_input() { +char *get_input(void) { BYTE i = 0; BYTE c, x, y; static char output[32]; @@ -47,7 +47,7 @@ char *get_input() { return output; } -char retry_or_quit() { +char retry_or_quit(void) { char *c; do { cprintf("\r\nr)etry or q)uit?\r\n"); diff --git a/src/itemz.c b/src/itemz.c index 591118a..0676c7a 100644 --- a/src/itemz.c +++ b/src/itemz.c @@ -17,7 +17,7 @@ #include "credit_manager.h" #include "version.h" -static void itemz_print_screen() { +static void itemz_print_screen(void) { BYTE i; char buffer[10]; @@ -35,7 +35,7 @@ static void itemz_print_screen() { cprintf("\r\nn) Neu d) Loeschen s) Speichern m) Credit Modus q) Beenden\r\nr) Reset des Verkauft-Zaehlers\r\n"); } -static void new_item() { +static void new_item(void) { char *input, *name; int price; @@ -69,7 +69,7 @@ static void _delete_item(BYTE num) { status.status[num].times_sold = 0; } -static void delete_item() { +static void delete_item(void) { char *input; BYTE num, last; @@ -124,7 +124,7 @@ static void itemz_manager(){ } } -int main() { +int main(void) { if (VIDEOMODE == 40) toggle_videomode(); credits.num_items = 0; diff --git a/src/kasse.c b/src/kasse.c index 895c2e6..c225d87 100644 --- a/src/kasse.c +++ b/src/kasse.c @@ -21,14 +21,8 @@ // drucker 4 oder 5 // graphic 4,0,10 -static void sane_exit() { - save_items(); - save_credits(); - exit(1); -} - /* Hauptbildschirm ausgeben */ -static void print_screen() { +static void print_screen(void) { BYTE i = 0; char *time = get_time(); char profit[10]; @@ -266,7 +260,7 @@ void buy_stock(BYTE n) { status.status[n].times_sold += buy(status.status[n].item_name, status.status[n].price); } -void buy_custom() { +void buy_custom(void) { BYTE c = 0, i = 0; int negative = 1; char entered[5] = {'1', 0, 0, 0, 0}; @@ -303,7 +297,7 @@ void buy_custom() { buy(name, price); } -void set_time_interactive() { +void set_time_interactive(void) { BYTE part[3] = {'0', '0', '\0'}; BYTE tp1, tp2, tp3; char *time_input, *time; @@ -324,7 +318,7 @@ void set_time_interactive() { cprintf("\r\nZeit gesetzt: %s\r\n", time); } -int main() { +int main(void) { char *c; char *time; diff --git a/src/print.c b/src/print.c index 768e819..0ca1422 100644 --- a/src/print.c +++ b/src/print.c @@ -27,7 +27,7 @@ int log_heap_flushed = 0; const int LOG_SIZE = 8192; -void init_log() { +void init_log(void) { log_heap_buf = malloc(sizeof(char) * LOG_SIZE); if (log_heap_buf == NULL) { cprintf("malloc(log_heap_buf) failed"); @@ -35,7 +35,7 @@ void init_log() { } } -void print_the_buffer() { +void print_the_buffer(void) { BYTE c; RETRY: c = cbm_open((BYTE)4, (BYTE)4, (BYTE)0, NULL); @@ -57,7 +57,7 @@ RETRY: log_file(print_buffer); } -void print_header() { +void print_header(void) { sprintf(print_buffer, "%c--------------------------------------------------------------------------------\r", 17); print_the_buffer();