diff --git a/ctpv.c b/ctpv.c index e7acf07..e0d0154 100644 --- a/ctpv.c +++ b/ctpv.c @@ -53,7 +53,7 @@ static void init_previews_v(void) init_previews(previews, LEN(previews)); } -static const char *get_mimetype(char const *path) +static const char *get_mimetype(const char *path) { const char *r = magic_file(magic, path); if (!r) { @@ -64,7 +64,7 @@ static const char *get_mimetype(char const *path) return r; } -static const char *get_ext(char const *path) +static const char *get_ext(const char *path) { const char *base; @@ -80,7 +80,7 @@ static const char *get_ext(char const *path) return &dot[1]; } -static int check_file(char const *f) +static int check_file(const char *f) { if (!f) { print_error("file not given"); @@ -268,7 +268,7 @@ static int list(void) static int mime(int argc, char *argv[]) { - char const *f, *mimetype; + const char *f, *mimetype; for (int i = 0; i < argc; i++) { f = argv[i]; diff --git a/error.c b/error.c index d25a0ae..39a5618 100644 --- a/error.c +++ b/error.c @@ -3,12 +3,12 @@ #include "error.h" #include "utils.h" -void print_error(char const *error_msg) +void print_error(const char *error_msg) { fprintf(stderr, "%s: %s\n", program, error_msg); } -void print_errorf(char const *format, ...) +void print_errorf(const char *format, ...) { char s[1024]; FORMATTED_STRING(s, format); diff --git a/error.h b/error.h index 68f1e94..c9ae3b5 100644 --- a/error.h +++ b/error.h @@ -56,7 +56,7 @@ enum { ERR, }; -void print_error(char const *error_msg); -void print_errorf(char const *format, ...); +void print_error(const char *error_msg); +void print_errorf(const char *format, ...); #endif diff --git a/preview.c b/preview.c index c31d570..fd7dc94 100644 --- a/preview.c +++ b/preview.c @@ -81,7 +81,7 @@ static void break_mimetype(char *mimetype, char **type, char **subtype) #define MIMETYPE_MAX 64 -static Preview *find_preview(char const *mimetype, char const *ext, size_t *i) +static Preview *find_preview(const char *mimetype, const char *ext, size_t *i) { Preview *p; char mimetype_c[MIMETYPE_MAX], *t, *s; diff --git a/server.c b/server.c index 6870f49..4e3c96c 100644 --- a/server.c +++ b/server.c @@ -134,7 +134,7 @@ static void get_fifo_name(char *buf, size_t len, const char *id_s) snprintf(buf, len-1, "/tmp/ctpvfifo.%s", id_s); } -int server_listen(char const *id_s) +int server_listen(const char *id_s) { int ret = OK; diff --git a/server.h b/server.h index c589162..5044916 100644 --- a/server.h +++ b/server.h @@ -1,7 +1,7 @@ #ifndef SERVER_H #define SERVER_H -int server_listen(char const *id_s); +int server_listen(const char *id_s); int server_set_fifo_var(const char *id_s); int server_clear(const char *id_s); int server_end(const char *id_s); diff --git a/utils.c b/utils.c index 49222fb..ef5b01b 100644 --- a/utils.c +++ b/utils.c @@ -70,7 +70,7 @@ int spawn(char *args[], pid_t *cpid, int *exitcode, int (*cfunc)(const void *), return OK; } -int strcmpnull(char const *s1, char const *s2) +int strcmpnull(const char *s1, const char *s2) { if (!s1 && !s2) return 0; @@ -82,7 +82,7 @@ int strcmpnull(char const *s1, char const *s2) return strcmp(s1, s2); } -int strlennull(char const *s) +int strlennull(const char *s) { return s ? strlen(s) : 0; } diff --git a/utils.h b/utils.h index 58fa8b0..78eb245 100644 --- a/utils.h +++ b/utils.h @@ -28,8 +28,8 @@ int spawn_wait(pid_t pid, int *exitcode); int spawn(char *args[], pid_t *cpid, int *exitcode, int (*cfunc)(const void *), const void *carg); -int strcmpnull(char const *s1, char const *s2); -int strlennull(char const *s); +int strcmpnull(const char *s1, const char *s2); +int strlennull(const char *s); int get_cache_dir(char *buf, size_t len, char *name); int mkpath(char* file_path, mode_t mode);