From ecfb993938dec34ac7e8d550bfa176462bf11c56 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 15 Sep 2022 11:00:50 +0300 Subject: [PATCH] move report() from main.c to util.c --- src/common.h | 3 +-- src/main.c | 12 ------------ src/util.c | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/common.h b/src/common.h index 939f994..a69751a 100644 --- a/src/common.h +++ b/src/common.h @@ -79,8 +79,6 @@ struct control { extern struct player_mode pmode[]; -int report(const char *, ...); - void delay_ms(unsigned int); #ifdef XMP_AMIGA void amiga_inittimer(void); @@ -89,6 +87,7 @@ void amiga_getsystime(void *); char *xmp_strdup(const char *); int xmp_strcasecmp(const char *, const char *); /* locale-insensitive */ +int report(const char *, ...); /* option */ void get_options(int, char **, struct options *); diff --git a/src/main.c b/src/main.c index 1a0ffea..915ea31 100644 --- a/src/main.c +++ b/src/main.c @@ -49,18 +49,6 @@ static struct sound_driver *sound; static unsigned int foreground_in, foreground_out; static int refresh_status; -int report(const char *fmt, ...) -{ - va_list a; - int n; - - va_start(a, fmt); - n = vfprintf(stderr, fmt, a); - va_end(a); - - return n; -} - #ifdef HAVE_SIGNAL_H static void cleanup(int sig) { diff --git a/src/util.c b/src/util.c index 29e39c4..e5bc903 100644 --- a/src/util.c +++ b/src/util.c @@ -7,8 +7,10 @@ */ #include +#include #include #include +#include #include "common.h" @@ -49,3 +51,16 @@ int xmp_strcasecmp(const char *s1, const char *s2) return (int)(c1 - c2); } + + +int report(const char *fmt, ...) +{ + va_list a; + int n; + + va_start(a, fmt); + n = vfprintf(stderr, fmt, a); + va_end(a); + + return n; +}