ref: ee346bbeacc596a87d1eccea35f0ed9ae2e6e67a
parent: 37540f69507e5a10b7bc99e3b637c99a3e3a2e29
author: evpobr <evpobr@gmail.com>
date: Tue Nov 3 15:38:14 EST 2020
Rename SRC_ERR to SRC_ERROR and make typedef
--- a/src/common.h
+++ b/src/common.h
@@ -74,7 +74,7 @@
SRC_MODE_CALLBACK = 1
} ;
-enum SRC_ERR
+typedef enum SRC_ERROR
{
SRC_ERR_NO_ERROR = 0,
@@ -103,12 +103,12 @@
/* This must be the last error number. */
SRC_ERR_MAX_ERROR
-} ;
+} SRC_ERROR ;
struct SRC_STATE_tag
{ double last_ratio, last_position ;
- enum SRC_ERR error ;
+ SRC_ERROR error ;
int channels ;
/* SRC_MODE_PROCESS or SRC_MODE_CALLBACK */
@@ -118,16 +118,16 @@
void *private_data ;
/* Varispeed process function. */
- enum SRC_ERR (*vari_process) (SRC_STATE *state, SRC_DATA *data) ;
+ SRC_ERROR (*vari_process) (SRC_STATE *state, SRC_DATA *data) ;
/* Constant speed process function. */
- enum SRC_ERR (*const_process) (SRC_STATE *state, SRC_DATA *data) ;
+ SRC_ERROR (*const_process) (SRC_STATE *state, SRC_DATA *data) ;
/* State reset. */
void (*reset) (SRC_STATE *state) ;
/* State clone. */
- enum SRC_ERR (*copy) (SRC_STATE *from, SRC_STATE *to) ;
+ SRC_ERROR (*copy) (SRC_STATE *from, SRC_STATE *to) ;
/* State private_data close. */
void (*close) (SRC_STATE *state) ;
@@ -143,19 +143,19 @@
const char* sinc_get_name (int src_enum) ;
const char* sinc_get_description (int src_enum) ;
-enum SRC_ERR sinc_set_converter (SRC_STATE *state, int src_enum) ;
+SRC_ERROR sinc_set_converter (SRC_STATE *state, int src_enum) ;
/* In src_linear.c */
const char* linear_get_name (int src_enum) ;
const char* linear_get_description (int src_enum) ;
-enum SRC_ERR linear_set_converter (SRC_STATE *state, int src_enum) ;
+SRC_ERROR linear_set_converter (SRC_STATE *state, int src_enum) ;
/* In src_zoh.c */
const char* zoh_get_name (int src_enum) ;
const char* zoh_get_description (int src_enum) ;
-enum SRC_ERR zoh_set_converter (SRC_STATE *state, int src_enum) ;
+SRC_ERROR zoh_set_converter (SRC_STATE *state, int src_enum) ;
/*----------------------------------------------------------
** Common static inline functions.
--- a/src/src_linear.c
+++ b/src/src_linear.c
@@ -14,9 +14,9 @@
#include "src_config.h"
#include "common.h"
-static enum SRC_ERR linear_vari_process (SRC_STATE *state, SRC_DATA *data) ;
+static SRC_ERROR linear_vari_process (SRC_STATE *state, SRC_DATA *data) ;
static void linear_reset (SRC_STATE *state) ;
-static enum SRC_ERR linear_copy (SRC_STATE *from, SRC_STATE *to) ;
+static SRC_ERROR linear_copy (SRC_STATE *from, SRC_STATE *to) ;
static void linear_close (SRC_STATE *state) ;
/*========================================================================================
@@ -37,7 +37,7 @@
/*----------------------------------------------------------------------------------------
*/
-static enum SRC_ERR
+static SRC_ERROR
linear_vari_process (SRC_STATE *state, SRC_DATA *data)
{ LINEAR_DATA *priv ;
double src_ratio, input_index, rem ;
@@ -158,7 +158,7 @@
return NULL ;
} /* linear_get_descrition */
-enum SRC_ERR
+SRC_ERROR
linear_set_converter (SRC_STATE *state, int src_enum)
{
LINEAR_DATA *priv = NULL ;
@@ -217,7 +217,7 @@
return ;
} /* linear_reset */
-static enum SRC_ERR
+SRC_ERROR
linear_copy (SRC_STATE *from, SRC_STATE *to)
{
if (from->private_data == NULL)
--- a/src/src_sinc.c
+++ b/src/src_sinc.c
@@ -56,16 +56,16 @@
float *buffer ;
} SINC_FILTER ;
-static enum SRC_ERR sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data) ;
-static enum SRC_ERR sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data) ;
-static enum SRC_ERR sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data) ;
-static enum SRC_ERR sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data) ;
-static enum SRC_ERR sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data) ;
+static SRC_ERROR sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data) ;
+static SRC_ERROR sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data) ;
+static SRC_ERROR sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data) ;
+static SRC_ERROR sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data) ;
+static SRC_ERROR sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data) ;
static int prepare_data (SINC_FILTER *filter, int channels, SRC_DATA *data, int half_filter_chan_len) WARN_UNUSED ;
static void sinc_reset (SRC_STATE *state) ;
-static enum SRC_ERR sinc_copy (SRC_STATE *from, SRC_STATE *to) ;
+static SRC_ERROR sinc_copy (SRC_STATE *from, SRC_STATE *to) ;
static void sinc_close (SRC_STATE *state) ;
static inline increment_t
@@ -141,7 +141,7 @@
return NULL ;
} /* sinc_get_descrition */
-enum SRC_ERR
+SRC_ERROR
sinc_set_converter (SRC_STATE *state, int src_enum)
{ SINC_FILTER *filter, temp_filter ;
increment_t count ;
@@ -264,7 +264,7 @@
memset (filter->buffer + filter->b_len, 0xAA, state->channels * sizeof (filter->buffer [0])) ;
} /* sinc_reset */
-static enum SRC_ERR
+static SRC_ERROR
sinc_copy (SRC_STATE *from, SRC_STATE *to)
{
if (from->private_data == NULL)
@@ -353,7 +353,7 @@
return (left + right) ;
} /* calc_output_single */
-static enum SRC_ERR
+static SRC_ERROR
sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data)
{ SINC_FILTER *filter ;
double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -509,7 +509,7 @@
output [ch] = (float) (scale * (left [ch] + right [ch])) ;
} /* calc_output_stereo */
-static enum SRC_ERR
+SRC_ERROR
sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data)
{ SINC_FILTER *filter ;
double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -665,7 +665,7 @@
output [ch] = (float) (scale * (left [ch] + right [ch])) ;
} /* calc_output_quad */
-static enum SRC_ERR
+SRC_ERROR
sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data)
{ SINC_FILTER *filter ;
double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -820,7 +820,7 @@
output [ch] = (float) (scale * (left [ch] + right [ch])) ;
} /* calc_output_hex */
-static enum SRC_ERR
+SRC_ERROR
sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data)
{ SINC_FILTER *filter ;
double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -985,7 +985,7 @@
return ;
} /* calc_output_multi */
-static enum SRC_ERR
+static SRC_ERROR
sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data)
{ SINC_FILTER *filter ;
double input_index, src_ratio, count, float_increment, terminate, rem ;
--- a/src/src_zoh.c
+++ b/src/src_zoh.c
@@ -14,9 +14,9 @@
#include "src_config.h"
#include "common.h"
-static enum SRC_ERR zoh_vari_process (SRC_STATE *state, SRC_DATA *data) ;
+static SRC_ERROR zoh_vari_process (SRC_STATE *state, SRC_DATA *data) ;
static void zoh_reset (SRC_STATE *state) ;
-static enum SRC_ERR zoh_copy (SRC_STATE *from, SRC_STATE *to) ;
+static SRC_ERROR zoh_copy (SRC_STATE *from, SRC_STATE *to) ;
static void zoh_close (SRC_STATE *state) ;
/*========================================================================================
@@ -35,7 +35,7 @@
/*----------------------------------------------------------------------------------------
*/
-static enum SRC_ERR
+static SRC_ERROR
zoh_vari_process (SRC_STATE *state, SRC_DATA *data)
{ ZOH_DATA *priv ;
double src_ratio, input_index, rem ;
@@ -149,7 +149,7 @@
return NULL ;
} /* zoh_get_descrition */
-enum SRC_ERR
+SRC_ERROR
zoh_set_converter (SRC_STATE *state, int src_enum)
{
ZOH_DATA *priv = NULL ;
@@ -208,7 +208,7 @@
return ;
} /* zoh_reset */
-static enum SRC_ERR
+static SRC_ERROR
zoh_copy (SRC_STATE *from, SRC_STATE *to)
{
if (from->private_data == NULL)