mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-16 00:58:18 -04:00
[misc] Fixup coding style
This commit is contained in:
parent
5dc8eea4c2
commit
36d9051a91
44
src/misc.c
44
src/misc.c
@ -940,8 +940,8 @@ extern mach_port_t clock_port;
|
|||||||
#ifndef HAVE_CLOCK_GETTIME
|
#ifndef HAVE_CLOCK_GETTIME
|
||||||
|
|
||||||
int
|
int
|
||||||
clock_gettime(clockid_t clock_id, struct timespec *tp) {
|
clock_gettime(clockid_t clock_id, struct timespec *tp)
|
||||||
|
{
|
||||||
static int clock_init = 0;
|
static int clock_init = 0;
|
||||||
static clock_serv_t clock;
|
static clock_serv_t clock;
|
||||||
|
|
||||||
@ -988,8 +988,8 @@ clock_gettime(clockid_t clock_id, struct timespec *tp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
clock_getres(clockid_t clock_id, struct timespec *res) {
|
clock_getres(clockid_t clock_id, struct timespec *res)
|
||||||
|
{
|
||||||
if (! res)
|
if (! res)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1007,8 +1007,8 @@ clock_getres(clockid_t clock_id, struct timespec *res) {
|
|||||||
#include <sys/time.h> /* ITIMER_REAL */
|
#include <sys/time.h> /* ITIMER_REAL */
|
||||||
|
|
||||||
int
|
int
|
||||||
timer_create(clockid_t clock_id, void *sevp, timer_t *timer_id) {
|
timer_create(clockid_t clock_id, void *sevp, timer_t *timer_id)
|
||||||
|
{
|
||||||
if (clock_id != CLOCK_MONOTONIC)
|
if (clock_id != CLOCK_MONOTONIC)
|
||||||
return -1;
|
return -1;
|
||||||
if (sevp)
|
if (sevp)
|
||||||
@ -1021,8 +1021,8 @@ timer_create(clockid_t clock_id, void *sevp, timer_t *timer_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
timer_delete(timer_t timer_id) {
|
timer_delete(timer_t timer_id)
|
||||||
|
{
|
||||||
struct itimerval timerval;
|
struct itimerval timerval;
|
||||||
|
|
||||||
if (timer_id != 0)
|
if (timer_id != 0)
|
||||||
@ -1034,9 +1034,8 @@ timer_delete(timer_t timer_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
timer_settime(timer_t timer_id, int flags, const struct itimerspec *tp,
|
timer_settime(timer_t timer_id, int flags, const struct itimerspec *tp, struct itimerspec *old)
|
||||||
struct itimerspec *old) {
|
{
|
||||||
|
|
||||||
struct itimerval tv;
|
struct itimerval tv;
|
||||||
|
|
||||||
if (timer_id != 0 || ! tp || old)
|
if (timer_id != 0 || ! tp || old)
|
||||||
@ -1049,8 +1048,8 @@ timer_settime(timer_t timer_id, int flags, const struct itimerspec *tp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
timer_getoverrun(timer_t timer_id) {
|
timer_getoverrun(timer_t timer_id)
|
||||||
|
{
|
||||||
/* since we don't know if there have been signals that weren't delivered,
|
/* since we don't know if there have been signals that weren't delivered,
|
||||||
assume none */
|
assume none */
|
||||||
return 0;
|
return 0;
|
||||||
@ -1074,20 +1073,23 @@ mutex_init(pthread_mutex_t *mutex)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_fatal_err(int domain, const char *func, int line, int err) {
|
void
|
||||||
DPRINTF(E_FATAL, domain, "%s failed at line %d, error %d (%s)\n", func,
|
log_fatal_err(int domain, const char *func, int line, int err)
|
||||||
line, err, strerror(err));
|
{
|
||||||
|
DPRINTF(E_FATAL, domain, "%s failed at line %d, error %d (%s)\n", func, line, err, strerror(err));
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_fatal_errno(int domain, const char *func, int line) {
|
void
|
||||||
DPRINTF(E_FATAL, domain, "%s failed at line %d, error %d (%s)\n", func,
|
log_fatal_errno(int domain, const char *func, int line)
|
||||||
line, errno, strerror(errno));
|
{
|
||||||
|
DPRINTF(E_FATAL, domain, "%s failed at line %d, error %d (%s)\n", func, line, errno, strerror(errno));
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_fatal_null(int domain, const char *func, int line) {
|
void
|
||||||
|
log_fatal_null(int domain, const char *func, int line)
|
||||||
|
{
|
||||||
DPRINTF(E_FATAL, domain, "%s returned NULL at line %d\n", func, line);
|
DPRINTF(E_FATAL, domain, "%s returned NULL at line %d\n", func, line);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user