summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-04-07 21:46:46 +0200
committerYorhel <git@yorhel.nl>2020-04-08 10:52:25 +0200
commit39709aa665c6a6690e0e993579f7e71666447698 (patch)
tree8da343e45cafd9530094f23d2c56b371bf617d78
parentbd22bf42eeed4043d87d816180c1fcfc1cace5bd (diff)
Use strict prototypes
(cherry picked from commit e4e8ebd9e0037812436a1588809deb23e0f3751a)
-rw-r--r--src/delete.c6
-rw-r--r--src/dir.h6
-rw-r--r--src/dir_common.c4
-rw-r--r--src/dir_import.c14
-rw-r--r--src/dir_scan.c2
-rw-r--r--src/dirlist.c2
-rw-r--r--src/exclude.h2
-rw-r--r--src/global.h2
-rw-r--r--src/help.h2
-rw-r--r--src/main.c4
-rw-r--r--src/shell.h2
-rw-r--r--src/util.h6
12 files changed, 26 insertions, 26 deletions
diff --git a/src/delete.c b/src/delete.c
index 66cdd8e..d60ee6c 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -42,7 +42,7 @@ static signed char seloption;
static int lasterrno;
-static void delete_draw_confirm() {
+static void delete_draw_confirm(void) {
nccreate(6, 60, "Confirm delete");
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...");
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!");
ncprint(1, 2, "Can't delete %s:", cropstr(getpath(curdir), 42));
diff --git a/src/dir.h b/src/dir.h
index 83f9dff..8c145f1 100644
--- a/src/dir.h
+++ b/src/dir.h
@@ -103,7 +103,7 @@ int dir_export_init(const char *fn);
/* Function set by input code. Returns dir_output.final(). */
-extern int (*dir_process)();
+extern int (*dir_process)(void);
/* Scanning a live directory */
extern int dir_scan_smfs;
@@ -121,7 +121,7 @@ extern struct dir_output dir_output;
extern char *dir_curpath;
void dir_curpath_set(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. */
void dir_setlasterr(const char *);
@@ -132,6 +132,6 @@ void dir_seterr(const char *, ...);
extern int dir_ui;
int dir_key(int);
-void dir_draw();
+void dir_draw(void);
#endif
diff --git a/src/dir_common.c b/src/dir_common.c
index ee8157f..bee9bf1 100644
--- a/src/dir_common.c
+++ b/src/dir_common.c
@@ -31,7 +31,7 @@
#include <stdarg.h>
-int (*dir_process)();
+int (*dir_process)(void);
char *dir_curpath; /* Full path of the last seen item. */
struct dir_output dir_output;
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 loadtext[] = "Loading...";
static size_t anpos = 0;
diff --git a/src/dir_import.c b/src/dir_import.c
index c216cde..a41b86c 100644
--- a/src/dir_import.c
+++ b/src/dir_import.c
@@ -159,7 +159,7 @@ static inline void con(int n) {
/* Consumes any whitespace. If *ctx->buf == 0 after this function, we've reached EOF. */
-static int cons() {
+static int cons(void) {
while(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.
* TODO: Improve validation. */
-static int rnum() {
+static int rnum(void) {
int haschar = 0;
C(rfill1);
while(1) {
@@ -324,7 +324,7 @@ static int rkey(char *dest, int destlen) {
/* (Recursively) parse and consume any JSON value. The result is discarded. */
-static int rval() {
+static int rval(void) {
C(rfill1);
switch(*ctx->buf) {
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. */
-static int header() {
+static int header(void) {
uint64_t v;
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
* ctx->buf_dir, ctx->buf_ext and ctx->buf_name. */
-static int iteminfo() {
+static int iteminfo(void) {
uint64_t iv;
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());
E(*ctx->buf != ']', "Expected ']'");
con(1);
@@ -567,7 +567,7 @@ static int footer() {
}
-static int process() {
+static int process(void) {
int fail = 0;
header();
diff --git a/src/dir_scan.c b/src/dir_scan.c
index f071646..8706e9c 100644
--- a/src/dir_scan.c
+++ b/src/dir_scan.c
@@ -255,7 +255,7 @@ static int dir_walk(char *dir) {
}
-static int process() {
+static int process(void) {
char *path;
char *dir;
int fail = 0;
diff --git a/src/dirlist.c b/src/dirlist.c
index 7234346..d0207a7 100644
--- a/src/dirlist.c
+++ b/src/dirlist.c
@@ -161,7 +161,7 @@ static struct dir *dirlist_sort(struct dir *list) {
* - makes sure one, and only one, visible item is selected
* - updates the dirlist_(maxs|maxa) values
* - makes sure that the FF_BSEL bits are correct */
-static void dirlist_fixup() {
+static void dirlist_fixup(void) {
struct dir *t;
/* we're going to determine the selected items from the list itself, so reset this one */
diff --git a/src/exclude.h b/src/exclude.h
index e577541..72eff50 100644
--- a/src/exclude.h
+++ b/src/exclude.h
@@ -29,7 +29,7 @@
void exclude_add(char *);
int exclude_addfile(char *);
int exclude_match(char *);
-void exclude_clear();
+void exclude_clear(void);
int has_cachedir_tag(const char *name);
#endif
diff --git a/src/global.h b/src/global.h
index cc48144..f9b59cb 100644
--- a/src/global.h
+++ b/src/global.h
@@ -110,7 +110,7 @@ extern int follow_symlinks;
int input_handle(int);
/* de-initialize ncurses */
-void close_nc();
+void close_nc(void);
/* import all other global functions and variables */
diff --git a/src/help.h b/src/help.h
index 867a8ba..09fd553 100644
--- a/src/help.h
+++ b/src/help.h
@@ -30,7 +30,7 @@
int help_key(int);
void help_draw(void);
-void help_init();
+void help_init(void);
#endif
diff --git a/src/main.c b/src/main.c
index e72c507..0df0a50 100644
--- a/src/main.c
+++ b/src/main.c
@@ -50,7 +50,7 @@ static int ncurses_tty = 0; /* Explicitely open /dev/tty instead of using stdio
static long lastupdate = 999;
-static void screen_draw() {
+static void screen_draw(void) {
switch(pstate) {
case ST_CALC: dir_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. */
-static void init_nc() {
+static void init_nc(void) {
int ok = 0;
FILE *tty;
SCREEN *term;
diff --git a/src/shell.h b/src/shell.h
index bd71776..b0e53b7 100644
--- a/src/shell.h
+++ b/src/shell.h
@@ -30,6 +30,6 @@
#include "global.h"
void shell_draw(void);
-void shell_init();
+void shell_init(void);
#endif
diff --git a/src/util.h b/src/util.h
index 8ffe2b0..34d6580 100644
--- a/src/util.h
+++ b/src/util.h
@@ -60,7 +60,7 @@ enum ui_coltype {
/* Color & attribute manipulation */
extern int uic_theme;
-void uic_init();
+void uic_init(void);
void uic_set(enum ui_coltype);
@@ -141,7 +141,7 @@ char *fullsize(int64_t);
char *fmtmode(unsigned short);
/* read locale information from the environment */
-void read_locale();
+void read_locale(void);
/* recursively free()s a directory tree */
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 */
-void *xmalloc();
+void *xmalloc(size_t);
void *xcalloc(size_t, size_t);
void *xrealloc(void *, size_t);