mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
make valgrind shut up regarding non-freed ident strings. other modernizations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1544 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
bc17b8ea2d
commit
042cb09394
1 changed files with 15 additions and 5 deletions
|
|
@ -26,7 +26,6 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
@ -40,6 +39,7 @@
|
||||||
#include <pulse/xmalloc.h>
|
#include <pulse/xmalloc.h>
|
||||||
#include <pulse/util.h>
|
#include <pulse/util.h>
|
||||||
|
|
||||||
|
#include <pulsecore/macro.h>
|
||||||
#include <pulsecore/core-util.h>
|
#include <pulsecore/core-util.h>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
@ -79,13 +79,22 @@ void pa_log_set_ident(const char *p) {
|
||||||
log_ident_local = pa_xstrdup(log_ident);
|
log_ident_local = pa_xstrdup(log_ident);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* To make valgrind shut up. */
|
||||||
|
static void ident_destructor(void) PA_GCC_DESTRUCTOR;
|
||||||
|
static void ident_destructor(void) {
|
||||||
|
pa_xfree(log_ident);
|
||||||
|
pa_xfree(log_ident_local);
|
||||||
|
}
|
||||||
|
|
||||||
void pa_log_set_maximal_level(pa_log_level_t l) {
|
void pa_log_set_maximal_level(pa_log_level_t l) {
|
||||||
assert(l < PA_LOG_LEVEL_MAX);
|
pa_assert(l < PA_LOG_LEVEL_MAX);
|
||||||
|
|
||||||
maximal_level = l;
|
maximal_level = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_log_set_target(pa_log_target_t t, void (*func)(pa_log_level_t l, const char*s)) {
|
void pa_log_set_target(pa_log_target_t t, void (*func)(pa_log_level_t l, const char*s)) {
|
||||||
assert(t == PA_LOG_USER || !func);
|
pa_assert(t == PA_LOG_USER || !func);
|
||||||
|
|
||||||
log_target = t;
|
log_target = t;
|
||||||
user_log_func = func;
|
user_log_func = func;
|
||||||
}
|
}
|
||||||
|
|
@ -101,8 +110,8 @@ void pa_log_levelv_meta(
|
||||||
const char *e;
|
const char *e;
|
||||||
char *text, *t, *n, *location;
|
char *text, *t, *n, *location;
|
||||||
|
|
||||||
assert(level < PA_LOG_LEVEL_MAX);
|
pa_assert(level < PA_LOG_LEVEL_MAX);
|
||||||
assert(format);
|
pa_assert(format);
|
||||||
|
|
||||||
if ((e = getenv(ENV_LOGLEVEL)))
|
if ((e = getenv(ENV_LOGLEVEL)))
|
||||||
maximal_level = atoi(e);
|
maximal_level = atoi(e);
|
||||||
|
|
@ -218,6 +227,7 @@ void pa_log_levelv(pa_log_level_t level, const char *format, va_list ap) {
|
||||||
|
|
||||||
void pa_log_level(pa_log_level_t level, const char *format, ...) {
|
void pa_log_level(pa_log_level_t level, const char *format, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
pa_log_levelv_meta(level, NULL, 0, NULL, format, ap);
|
pa_log_levelv_meta(level, NULL, 0, NULL, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue