NO-OP: clang-format whitespace

This commit is contained in:
Robin Gareus 2018-10-11 00:52:37 +02:00
parent 876e780e4d
commit 8e78827deb
2 changed files with 1106 additions and 1138 deletions

File diff suppressed because it is too large Load diff

View file

@ -17,25 +17,22 @@
// //
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifndef _ZITA_CONVOLVER_H #ifndef _ZITA_CONVOLVER_H
#define _ZITA_CONVOLVER_H #define _ZITA_CONVOLVER_H
#include <fftw3.h>
#include <pthread.h> #include <pthread.h>
#include <stdint.h> #include <stdint.h>
#include <fftw3.h>
#include "zita-convolver/zconvolver_visibility.h" #include "zita-convolver/zconvolver_visibility.h"
namespace ArdourZita { namespace ArdourZita {
#ifdef ZCSEMA_IS_IMPLEMENTED #ifdef ZCSEMA_IS_IMPLEMENTED
#undef ZCSEMA_IS_IMPLEMENTED #undef ZCSEMA_IS_IMPLEMENTED
#endif #endif
#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <semaphore.h> #include <semaphore.h>
@ -43,27 +40,46 @@ namespace ArdourZita {
class LIBZCONVOLVER_API ZCsema class LIBZCONVOLVER_API ZCsema
{ {
public: public:
ZCsema (void)
{
init (0, 0);
}
ZCsema (void) { init (0, 0); } ~ZCsema (void)
~ZCsema (void) { sem_destroy (&_sema); } {
sem_destroy (&_sema);
}
ZCsema (const ZCsema&); // disabled ZCsema (const ZCsema&); // disabled
ZCsema& operator= (const ZCsema&); // disabled ZCsema& operator= (const ZCsema&); // disabled
int init (int s, int v) { return sem_init (&_sema, s, v); } int init (int s, int v)
int post (void) { return sem_post (&_sema); } {
int wait (void) { return sem_wait (&_sema); } return sem_init (&_sema, s, v);
int trywait (void) { return sem_trywait (&_sema); } }
int post (void)
{
return sem_post (&_sema);
}
int wait (void)
{
return sem_wait (&_sema);
}
int trywait (void)
{
return sem_trywait (&_sema);
}
private: private:
sem_t _sema; sem_t _sema;
}; };
#define ZCSEMA_IS_IMPLEMENTED #define ZCSEMA_IS_IMPLEMENTED
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
// NOTE: ***** I DO NOT REPEAT NOT PROVIDE SUPPORT FOR OSX ***** // NOTE: ***** I DO NOT REPEAT NOT PROVIDE SUPPORT FOR OSX *****
@ -76,7 +92,6 @@ private:
class LIBZCONVOLVER_API ZCsema class LIBZCONVOLVER_API ZCsema
{ {
public: public:
ZCsema (void) : _count (0) ZCsema (void) : _count (0)
{ {
init (0, 0); init (0, 0);
@ -101,7 +116,8 @@ public:
{ {
pthread_mutex_lock (&_mutex); pthread_mutex_lock (&_mutex);
_count++; _count++;
if (_count == 1) pthread_cond_signal (&_cond); if (_count == 1)
pthread_cond_signal (&_cond);
pthread_mutex_unlock (&_mutex); pthread_mutex_unlock (&_mutex);
return 0; return 0;
} }
@ -109,7 +125,8 @@ public:
int wait (void) int wait (void)
{ {
pthread_mutex_lock (&_mutex); pthread_mutex_lock (&_mutex);
while (_count < 1) pthread_cond_wait (&_cond, &_mutex); while (_count < 1)
pthread_cond_wait (&_cond, &_mutex);
_count--; _count--;
pthread_mutex_unlock (&_mutex); pthread_mutex_unlock (&_mutex);
return 0; return 0;
@ -117,9 +134,9 @@ public:
int trywait (void) int trywait (void)
{ {
if (pthread_mutex_trylock (&_mutex)) return -1; if (pthread_mutex_trylock (&_mutex))
if (_count < 1) return -1;
{ if (_count < 1) {
pthread_mutex_unlock (&_mutex); pthread_mutex_unlock (&_mutex);
return -1; return -1;
} }
@ -129,7 +146,6 @@ public:
} }
private: private:
int _count; int _count;
pthread_mutex_t _mutex; pthread_mutex_t _mutex;
pthread_cond_t _cond; pthread_cond_t _cond;
@ -138,19 +154,15 @@ private:
#define ZCSEMA_IS_IMPLEMENTED #define ZCSEMA_IS_IMPLEMENTED
#endif #endif
#ifndef ZCSEMA_IS_IMPLEMENTED #ifndef ZCSEMA_IS_IMPLEMENTED
#error "The ZCsema class is not implemented." #error "The ZCsema class is not implemented."
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class LIBZCONVOLVER_API Inpnode class LIBZCONVOLVER_API Inpnode
{ {
private: private:
friend class Convlevel; friend class Convlevel;
Inpnode (uint16_t inp); Inpnode (uint16_t inp);
@ -164,11 +176,9 @@ private:
uint16_t _inp; uint16_t _inp;
}; };
class LIBZCONVOLVER_API Macnode class LIBZCONVOLVER_API Macnode
{ {
private: private:
friend class Convlevel; friend class Convlevel;
Macnode (Inpnode* inpn); Macnode (Inpnode* inpn);
@ -183,11 +193,9 @@ private:
uint16_t _npar; uint16_t _npar;
}; };
class LIBZCONVOLVER_API Outnode class LIBZCONVOLVER_API Outnode
{ {
private: private:
friend class Convlevel; friend class Convlevel;
Outnode (uint16_t out, int32_t size); Outnode (uint16_t out, int32_t size);
@ -199,13 +207,10 @@ private:
uint16_t _out; uint16_t _out;
}; };
class LIBZCONVOLVER_API Converror class LIBZCONVOLVER_API Converror
{ {
public: public:
enum {
enum
{
BAD_STATE = -1, BAD_STATE = -1,
BAD_PARAM = -2, BAD_PARAM = -2,
MEM_ALLOC = -3 MEM_ALLOC = -3
@ -214,26 +219,21 @@ public:
Converror (int error) : _error (error) {} Converror (int error) : _error (error) {}
private: private:
int _error; int _error;
}; };
class LIBZCONVOLVER_API Convlevel class LIBZCONVOLVER_API Convlevel
{ {
private: private:
friend class Convproc; friend class Convproc;
enum enum {
{
OPT_FFTW_MEASURE = 1, OPT_FFTW_MEASURE = 1,
OPT_VECTOR_MODE = 2, OPT_VECTOR_MODE = 2,
OPT_LATE_CONTIN = 4 OPT_LATE_CONTIN = 4
}; };
enum enum {
{
ST_IDLE, ST_IDLE,
ST_TERM, ST_TERM,
ST_PROC ST_PROC
@ -289,7 +289,6 @@ private:
Macnode* findmacnode (uint32_t inp, uint32_t out, bool create); Macnode* findmacnode (uint32_t inp, uint32_t out, bool create);
volatile uint32_t _stat; // current processing state volatile uint32_t _stat; // current processing state
int _prio; // relative priority int _prio; // relative priority
uint32_t _offs; // offset from start of impulse response uint32_t _offs; // offset from start of impulse response
@ -318,40 +317,33 @@ private:
float** _outbuff; // array of shared output buffers float** _outbuff; // array of shared output buffers
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class LIBZCONVOLVER_API Convproc class LIBZCONVOLVER_API Convproc
{ {
public: public:
Convproc (void); Convproc (void);
~Convproc (void); ~Convproc (void);
enum enum {
{
ST_IDLE, ST_IDLE,
ST_STOP, ST_STOP,
ST_WAIT, ST_WAIT,
ST_PROC ST_PROC
}; };
enum enum {
{
FL_LATE = 0x0000FFFF, FL_LATE = 0x0000FFFF,
FL_LOAD = 0x01000000 FL_LOAD = 0x01000000
}; };
enum enum {
{
OPT_FFTW_MEASURE = Convlevel::OPT_FFTW_MEASURE, OPT_FFTW_MEASURE = Convlevel::OPT_FFTW_MEASURE,
OPT_VECTOR_MODE = Convlevel::OPT_VECTOR_MODE, OPT_VECTOR_MODE = Convlevel::OPT_VECTOR_MODE,
OPT_LATE_CONTIN = Convlevel::OPT_LATE_CONTIN OPT_LATE_CONTIN = Convlevel::OPT_LATE_CONTIN
}; };
enum enum {
{
MAXINP = 64, MAXINP = 64,
MAXOUT = 64, MAXOUT = 64,
MAXLEV = 8, MAXLEV = 8,
@ -435,7 +427,6 @@ public:
void print (FILE* F = stdout); void print (FILE* F = stdout);
private: private:
uint32_t _state; // current state uint32_t _state; // current state
float* _inpbuff[MAXINP]; // input buffers float* _inpbuff[MAXINP]; // input buffers
float* _outbuff[MAXOUT]; // output buffers float* _outbuff[MAXOUT]; // output buffers
@ -458,10 +449,8 @@ private:
static float _fft_cost; static float _fft_cost;
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
} /* end namespace */ } /* end namespace */
#endif #endif