Use strict prototypes

This commit is contained in:
Christian Göttsche 2020-04-07 21:46:46 +02:00
parent 888bd663c6
commit e4e8ebd9e0
12 changed files with 26 additions and 26 deletions

View file

@ -42,7 +42,7 @@ static signed char seloption;
static int lasterrno; static int lasterrno;
static void delete_draw_confirm() { static void delete_draw_confirm(void) {
nccreate(6, 60, "Confirm delete"); nccreate(6, 60, "Confirm delete");
ncprint(1, 2, "Are you sure you want to delete \"%s\"%c", ncprint(1, 2, "Are you sure you want to delete \"%s\"%c",
@ -67,7 +67,7 @@ static void delete_draw_confirm() {
} }
static void delete_draw_progress() { static void delete_draw_progress(void) {
nccreate(6, 60, "Deleting..."); nccreate(6, 60, "Deleting...");
ncaddstr(1, 2, cropstr(getpath(curdir), 47)); ncaddstr(1, 2, cropstr(getpath(curdir), 47));
@ -77,7 +77,7 @@ static void delete_draw_progress() {
} }
static void delete_draw_error() { static void delete_draw_error(void) {
nccreate(6, 60, "Error!"); nccreate(6, 60, "Error!");
ncprint(1, 2, "Can't delete %s:", cropstr(getpath(curdir), 42)); ncprint(1, 2, "Can't delete %s:", cropstr(getpath(curdir), 42));

View file

@ -103,7 +103,7 @@ int dir_export_init(const char *fn);
/* Function set by input code. Returns dir_output.final(). */ /* Function set by input code. Returns dir_output.final(). */
extern int (*dir_process)(); extern int (*dir_process)(void);
/* Scanning a live directory */ /* Scanning a live directory */
extern int dir_scan_smfs; extern int dir_scan_smfs;
@ -121,7 +121,7 @@ extern struct dir_output dir_output;
extern char *dir_curpath; extern char *dir_curpath;
void dir_curpath_set(const char *); void dir_curpath_set(const char *);
void dir_curpath_enter(const char *); void dir_curpath_enter(const char *);
void dir_curpath_leave(); void dir_curpath_leave(void);
/* Sets the path where the last error occurred, or reset on NULL. */ /* Sets the path where the last error occurred, or reset on NULL. */
void dir_setlasterr(const char *); void dir_setlasterr(const char *);
@ -132,6 +132,6 @@ void dir_seterr(const char *, ...);
extern int dir_ui; extern int dir_ui;
int dir_key(int); int dir_key(int);
void dir_draw(); void dir_draw(void);
#endif #endif

View file

@ -31,7 +31,7 @@
#include <stdarg.h> #include <stdarg.h>
int (*dir_process)(); int (*dir_process)(void);
char *dir_curpath; /* Full path of the last seen item. */ char *dir_curpath; /* Full path of the last seen item. */
struct dir_output dir_output; struct dir_output dir_output;
char *dir_fatalerr; /* Error message on a fatal error. (NULL if there was no fatal error) */ char *dir_fatalerr; /* Error message on a fatal error. (NULL if there was no fatal error) */
@ -107,7 +107,7 @@ void dir_seterr(const char *fmt, ...) {
} }
static void draw_progress() { static void draw_progress(void) {
static const char scantext[] = "Scanning..."; static const char scantext[] = "Scanning...";
static const char loadtext[] = "Loading..."; static const char loadtext[] = "Loading...";
static size_t anpos = 0; static size_t anpos = 0;

View file

@ -159,7 +159,7 @@ static inline void con(int n) {
/* Consumes any whitespace. If *ctx->buf == 0 after this function, we've reached EOF. */ /* Consumes any whitespace. If *ctx->buf == 0 after this function, we've reached EOF. */
static int cons() { static int cons(void) {
while(1) { while(1) {
C(!*ctx->buf && fill(1)); C(!*ctx->buf && fill(1));
@ -289,7 +289,7 @@ static int rint64(uint64_t *val, uint64_t max) {
/* Parse and consume a JSON number. The result is discarded. /* Parse and consume a JSON number. The result is discarded.
* TODO: Improve validation. */ * TODO: Improve validation. */
static int rnum() { static int rnum(void) {
int haschar = 0; int haschar = 0;
C(rfill1); C(rfill1);
while(1) { while(1) {
@ -324,7 +324,7 @@ static int rkey(char *dest, int destlen) {
/* (Recursively) parse and consume any JSON value. The result is discarded. */ /* (Recursively) parse and consume any JSON value. The result is discarded. */
static int rval() { static int rval(void) {
C(rfill1); C(rfill1);
switch(*ctx->buf) { switch(*ctx->buf) {
case 't': /* true */ case 't': /* true */
@ -377,7 +377,7 @@ static int rval() {
/* Consumes everything up to the root item, and checks that this item is a dir. */ /* Consumes everything up to the root item, and checks that this item is a dir. */
static int header() { static int header(void) {
uint64_t v; uint64_t v;
C(cons()); C(cons());
@ -422,7 +422,7 @@ static int itemdir(uint64_t dev) {
/* Reads a JSON object representing a struct dir/dir_ext item. Writes to /* Reads a JSON object representing a struct dir/dir_ext item. Writes to
* ctx->buf_dir, ctx->buf_ext and ctx->buf_name. */ * ctx->buf_dir, ctx->buf_ext and ctx->buf_name. */
static int iteminfo() { static int iteminfo(void) {
uint64_t iv; uint64_t iv;
E(*ctx->buf != '{', "Expected JSON object"); E(*ctx->buf != '{', "Expected JSON object");
@ -557,7 +557,7 @@ static int item(uint64_t dev) {
} }
static int footer() { static int footer(void) {
C(cons()); C(cons());
E(*ctx->buf != ']', "Expected ']'"); E(*ctx->buf != ']', "Expected ']'");
con(1); con(1);
@ -567,7 +567,7 @@ static int footer() {
} }
static int process() { static int process(void) {
int fail = 0; int fail = 0;
header(); header();

View file

@ -255,7 +255,7 @@ static int dir_walk(char *dir) {
} }
static int process() { static int process(void) {
char *path; char *path;
char *dir; char *dir;
int fail = 0; int fail = 0;

View file

@ -161,7 +161,7 @@ static struct dir *dirlist_sort(struct dir *list) {
* - makes sure one, and only one, visible item is selected * - makes sure one, and only one, visible item is selected
* - updates the dirlist_(maxs|maxa) values * - updates the dirlist_(maxs|maxa) values
* - makes sure that the FF_BSEL bits are correct */ * - makes sure that the FF_BSEL bits are correct */
static void dirlist_fixup() { static void dirlist_fixup(void) {
struct dir *t; struct dir *t;
/* we're going to determine the selected items from the list itself, so reset this one */ /* we're going to determine the selected items from the list itself, so reset this one */

View file

@ -29,7 +29,7 @@
void exclude_add(char *); void exclude_add(char *);
int exclude_addfile(char *); int exclude_addfile(char *);
int exclude_match(char *); int exclude_match(char *);
void exclude_clear(); void exclude_clear(void);
int has_cachedir_tag(const char *name); int has_cachedir_tag(const char *name);
#endif #endif

View file

@ -110,7 +110,7 @@ extern int follow_symlinks;
int input_handle(int); int input_handle(int);
/* de-initialize ncurses */ /* de-initialize ncurses */
void close_nc(); void close_nc(void);
/* import all other global functions and variables */ /* import all other global functions and variables */

View file

@ -30,7 +30,7 @@
int help_key(int); int help_key(int);
void help_draw(void); void help_draw(void);
void help_init(); void help_init(void);
#endif #endif

View file

@ -50,7 +50,7 @@ static int ncurses_tty = 0; /* Explicitely open /dev/tty instead of using stdio
static long lastupdate = 999; static long lastupdate = 999;
static void screen_draw() { static void screen_draw(void) {
switch(pstate) { switch(pstate) {
case ST_CALC: dir_draw(); break; case ST_CALC: dir_draw(); break;
case ST_BROWSE: browse_draw(); break; case ST_BROWSE: browse_draw(); break;
@ -236,7 +236,7 @@ static void argv_parse(int argc, char **argv) {
/* Initializes ncurses only when not done yet. */ /* Initializes ncurses only when not done yet. */
static void init_nc() { static void init_nc(void) {
int ok = 0; int ok = 0;
FILE *tty; FILE *tty;
SCREEN *term; SCREEN *term;

View file

@ -30,6 +30,6 @@
#include "global.h" #include "global.h"
void shell_draw(void); void shell_draw(void);
void shell_init(); void shell_init(void);
#endif #endif

View file

@ -60,7 +60,7 @@ enum ui_coltype {
/* Color & attribute manipulation */ /* Color & attribute manipulation */
extern int uic_theme; extern int uic_theme;
void uic_init(); void uic_init(void);
void uic_set(enum ui_coltype); void uic_set(enum ui_coltype);
@ -141,7 +141,7 @@ char *fullsize(int64_t);
char *fmtmode(unsigned short); char *fmtmode(unsigned short);
/* read locale information from the environment */ /* read locale information from the environment */
void read_locale(); void read_locale(void);
/* recursively free()s a directory tree */ /* recursively free()s a directory tree */
void freedir(struct dir *); void freedir(struct dir *);
@ -187,7 +187,7 @@ void addparentstats(struct dir *, int64_t, int64_t, uint64_t, int);
/* Malloc wrappers that exit on OOM */ /* Malloc wrappers that exit on OOM */
void *xmalloc(); void *xmalloc(size_t);
void *xcalloc(size_t, size_t); void *xcalloc(size_t, size_t);
void *xrealloc(void *, size_t); void *xrealloc(void *, size_t);