initialize logging at compile time

This commit is contained in:
derselbst 2018-10-09 18:11:37 +02:00
parent d25cdae17c
commit 2b563071f6
3 changed files with 9 additions and 61 deletions

View file

@ -290,8 +290,6 @@ fluid_synth_init(void)
fluid_rvoice_dsp_config();
fluid_sys_config();
init_dither();
/* custom_breath2att_mod is not a default modulator specified in SF2.01.

View file

@ -76,19 +76,18 @@ static int fluid_istream_gets(fluid_istream_t in, char *buf, int len);
static char fluid_errbuf[512]; /* buffer for error message */
static fluid_log_function_t fluid_log_function[LAST_LOG_LEVEL];
static void *fluid_log_user_data[LAST_LOG_LEVEL];
static int fluid_log_initialized = 0;
static fluid_log_function_t fluid_log_function[LAST_LOG_LEVEL] =
{
fluid_default_log_function,
fluid_default_log_function,
fluid_default_log_function,
fluid_default_log_function,
fluid_default_log_function
};
static void *fluid_log_user_data[LAST_LOG_LEVEL] = { NULL };
static const char fluid_libname[] = "fluidsynth";
void fluid_sys_config()
{
fluid_log_config();
}
/**
* Installs a new log function for a specified log level.
* @param level Log level to install handler for.
@ -128,11 +127,6 @@ fluid_default_log_function(int level, const char *message, void *data)
out = stderr;
#endif
if(fluid_log_initialized == 0)
{
fluid_log_config();
}
switch(level)
{
case FLUID_PANIC:
@ -165,44 +159,6 @@ fluid_default_log_function(int level, const char *message, void *data)
fflush(out);
}
/*
* fluid_init_log
*/
void
fluid_log_config(void)
{
if(fluid_log_initialized == 0)
{
fluid_log_initialized = 1;
if(fluid_log_function[FLUID_PANIC] == NULL)
{
fluid_set_log_function(FLUID_PANIC, fluid_default_log_function, NULL);
}
if(fluid_log_function[FLUID_ERR] == NULL)
{
fluid_set_log_function(FLUID_ERR, fluid_default_log_function, NULL);
}
if(fluid_log_function[FLUID_WARN] == NULL)
{
fluid_set_log_function(FLUID_WARN, fluid_default_log_function, NULL);
}
if(fluid_log_function[FLUID_INFO] == NULL)
{
fluid_set_log_function(FLUID_INFO, fluid_default_log_function, NULL);
}
if(fluid_log_function[FLUID_DBG] == NULL)
{
fluid_set_log_function(FLUID_DBG, fluid_default_log_function, NULL);
}
}
}
/**
* Print a message to the log.
* @param level Log level (#fluid_log_level).

View file

@ -52,12 +52,6 @@
*/
#define fluid_gerror_message(err) ((err) ? err->message : "No error details")
void fluid_sys_config(void);
void fluid_log_config(void);
void fluid_time_config(void);
/* Misc */
#if defined(__INTEL_COMPILER)
#define FLUID_RESTRICT restrict