History

Rename SRC_ERR to SRC_ERROR and make typedef

evpobr committed 6 years ago

Commit ee346bb1 parent 37540f64 files · +32 −32Browse files

Showing the changes to src (4 of 4 files). Show all

Unified · Split

4 files
  1. src/common.h +9 −9
  2. src/src_linear.c +5 −5
  3. src/src_sinc.c +13 −13
  4. src/src_zoh.c +5 −5
src/common.h+9−9
@@ -74,7 +74,7 @@ enum SRC_MODE · 73 unmodified lines
7474 SRC_MODE_CALLBACK = 1
7575 } ;
7676
77−enum SRC_ERR
77+typedef enum SRC_ERROR
7878 {
7979 SRC_ERR_NO_ERROR = 0,
8080
@@ -103,12 +103,12 @@ enum SRC_ERR · 22 unmodified lines
103103
104104 /* This must be the last error number. */
105105 SRC_ERR_MAX_ERROR
106−} ;
106+} SRC_ERROR ;
107107
108108 struct SRC_STATE_tag
109109 { double last_ratio, last_position ;
110110
111− enum SRC_ERR error ;
111+ SRC_ERROR error ;
112112 int channels ;
113113
114114 /* SRC_MODE_PROCESS or SRC_MODE_CALLBACK */
@@ -118,16 +118,16 @@ struct SRC_STATE_tag · 3 unmodified lines
118118 void *private_data ;
119119
120120 /* Varispeed process function. */
121− enum SRC_ERR (*vari_process) (SRC_STATE *state, SRC_DATA *data) ;
121+ SRC_ERROR (*vari_process) (SRC_STATE *state, SRC_DATA *data) ;
122122
123123 /* Constant speed process function. */
124− enum SRC_ERR (*const_process) (SRC_STATE *state, SRC_DATA *data) ;
124+ SRC_ERROR (*const_process) (SRC_STATE *state, SRC_DATA *data) ;
125125
126126 /* State reset. */
127127 void (*reset) (SRC_STATE *state) ;
128128
129129 /* State clone. */
130− enum SRC_ERR (*copy) (SRC_STATE *from, SRC_STATE *to) ;
130+ SRC_ERROR (*copy) (SRC_STATE *from, SRC_STATE *to) ;
131131
132132 /* State private_data close. */
133133 void (*close) (SRC_STATE *state) ;
@@ -143,19 +143,19 @@ struct SRC_STATE_tag · 9 unmodified lines
143143 const char* sinc_get_name (int src_enum) ;
144144 const char* sinc_get_description (int src_enum) ;
145145
146−enum SRC_ERR sinc_set_converter (SRC_STATE *state, int src_enum) ;
146+SRC_ERROR sinc_set_converter (SRC_STATE *state, int src_enum) ;
147147
148148 /* In src_linear.c */
149149 const char* linear_get_name (int src_enum) ;
150150 const char* linear_get_description (int src_enum) ;
151151
152−enum SRC_ERR linear_set_converter (SRC_STATE *state, int src_enum) ;
152+SRC_ERROR linear_set_converter (SRC_STATE *state, int src_enum) ;
153153
154154 /* In src_zoh.c */
155155 const char* zoh_get_name (int src_enum) ;
156156 const char* zoh_get_description (int src_enum) ;
157157
158−enum SRC_ERR zoh_set_converter (SRC_STATE *state, int src_enum) ;
158+SRC_ERROR zoh_set_converter (SRC_STATE *state, int src_enum) ;
159159
160160 /*----------------------------------------------------------
161161 ** Common static inline functions.
src/src_linear.c+5−5
@@ -14,9 +14,9 @@ · 13 unmodified lines
1414 #include "src_config.h"
1515 #include "common.h"
1616
17−static enum SRC_ERR linear_vari_process (SRC_STATE *state, SRC_DATA *data) ;
17+static SRC_ERROR linear_vari_process (SRC_STATE *state, SRC_DATA *data) ;
1818 static void linear_reset (SRC_STATE *state) ;
19−static enum SRC_ERR linear_copy (SRC_STATE *from, SRC_STATE *to) ;
19+static SRC_ERROR linear_copy (SRC_STATE *from, SRC_STATE *to) ;
2020 static void linear_close (SRC_STATE *state) ;
2121
2222 /*========================================================================================
@@ -37,7 +37,7 @@ typedef struct · 14 unmodified lines
3737 /*----------------------------------------------------------------------------------------
3838 */
3939
40−static enum SRC_ERR
40+static SRC_ERROR
4141 linear_vari_process (SRC_STATE *state, SRC_DATA *data)
4242 { LINEAR_DATA *priv ;
4343 double src_ratio, input_index, rem ;
@@ -158,7 +158,7 @@ linear_get_description (int src_enum) · 114 unmodified lines
158158 return NULL ;
159159 } /* linear_get_descrition */
160160
161−enum SRC_ERR
161+SRC_ERROR
162162 linear_set_converter (SRC_STATE *state, int src_enum)
163163 {
164164 LINEAR_DATA *priv = NULL ;
@@ -217,7 +217,7 @@ linear_reset (SRC_STATE *state) · 52 unmodified lines
217217 return ;
218218 } /* linear_reset */
219219
220−static enum SRC_ERR
220+SRC_ERROR
221221 linear_copy (SRC_STATE *from, SRC_STATE *to)
222222 {
223223 if (from->private_data == NULL)
src/src_sinc.c+13−13
@@ -56,16 +56,16 @@ typedef struct · 55 unmodified lines
5656 float *buffer ;
5757 } SINC_FILTER ;
5858
59−static enum SRC_ERR sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data) ;
60−static enum SRC_ERR sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data) ;
61−static enum SRC_ERR sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data) ;
62−static enum SRC_ERR sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data) ;
63−static enum SRC_ERR sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data) ;
59+static SRC_ERROR sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data) ;
60+static SRC_ERROR sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data) ;
61+static SRC_ERROR sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data) ;
62+static SRC_ERROR sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data) ;
63+static SRC_ERROR sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data) ;
6464
6565 static int prepare_data (SINC_FILTER *filter, int channels, SRC_DATA *data, int half_filter_chan_len) WARN_UNUSED ;
6666
6767 static void sinc_reset (SRC_STATE *state) ;
68−static enum SRC_ERR sinc_copy (SRC_STATE *from, SRC_STATE *to) ;
68+static SRC_ERROR sinc_copy (SRC_STATE *from, SRC_STATE *to) ;
6969 static void sinc_close (SRC_STATE *state) ;
7070
7171 static inline increment_t
@@ -141,7 +141,7 @@ sinc_get_description (int src_enum) · 69 unmodified lines
141141 return NULL ;
142142 } /* sinc_get_descrition */
143143
144−enum SRC_ERR
144+SRC_ERROR
145145 sinc_set_converter (SRC_STATE *state, int src_enum)
146146 { SINC_FILTER *filter, temp_filter ;
147147 increment_t count ;
@@ -264,7 +264,7 @@ sinc_reset (SRC_STATE *state) · 116 unmodified lines
264264 memset (filter->buffer + filter->b_len, 0xAA, state->channels * sizeof (filter->buffer [0])) ;
265265 } /* sinc_reset */
266266
267−static enum SRC_ERR
267+static SRC_ERROR
268268 sinc_copy (SRC_STATE *from, SRC_STATE *to)
269269 {
270270 if (from->private_data == NULL)
@@ -353,7 +353,7 @@ calc_output_single (SINC_FILTER *filter, increment_t increment, increment_t star · 82 unmodified lines
353353 return (left + right) ;
354354 } /* calc_output_single */
355355
356−static enum SRC_ERR
356+static SRC_ERROR
357357 sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data)
358358 { SINC_FILTER *filter ;
359359 double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -509,7 +509,7 @@ calc_output_stereo (SINC_FILTER *filter, int channels, increment_t increment, in · 149 unmodified lines
509509 output [ch] = (float) (scale * (left [ch] + right [ch])) ;
510510 } /* calc_output_stereo */
511511
512−static enum SRC_ERR
512+SRC_ERROR
513513 sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data)
514514 { SINC_FILTER *filter ;
515515 double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -665,7 +665,7 @@ calc_output_quad (SINC_FILTER *filter, int channels, increment_t increment, incr · 149 unmodified lines
665665 output [ch] = (float) (scale * (left [ch] + right [ch])) ;
666666 } /* calc_output_quad */
667667
668−static enum SRC_ERR
668+SRC_ERROR
669669 sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data)
670670 { SINC_FILTER *filter ;
671671 double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -820,7 +820,7 @@ calc_output_hex (SINC_FILTER *filter, int channels, increment_t increment, incre · 148 unmodified lines
820820 output [ch] = (float) (scale * (left [ch] + right [ch])) ;
821821 } /* calc_output_hex */
822822
823−static enum SRC_ERR
823+SRC_ERROR
824824 sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data)
825825 { SINC_FILTER *filter ;
826826 double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -985,7 +985,7 @@ calc_output_multi (SINC_FILTER *filter, increment_t increment, increment_t start · 158 unmodified lines
985985 return ;
986986 } /* calc_output_multi */
987987
988−static enum SRC_ERR
988+static SRC_ERROR
989989 sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data)
990990 { SINC_FILTER *filter ;
991991 double input_index, src_ratio, count, float_increment, terminate, rem ;
src/src_zoh.c+5−5
@@ -14,9 +14,9 @@ · 13 unmodified lines
1414 #include "src_config.h"
1515 #include "common.h"
1616
17−static enum SRC_ERR zoh_vari_process (SRC_STATE *state, SRC_DATA *data) ;
17+static SRC_ERROR zoh_vari_process (SRC_STATE *state, SRC_DATA *data) ;
1818 static void zoh_reset (SRC_STATE *state) ;
19−static enum SRC_ERR zoh_copy (SRC_STATE *from, SRC_STATE *to) ;
19+static SRC_ERROR zoh_copy (SRC_STATE *from, SRC_STATE *to) ;
2020 static void zoh_close (SRC_STATE *state) ;
2121
2222 /*========================================================================================
@@ -35,7 +35,7 @@ typedef struct · 12 unmodified lines
3535 /*----------------------------------------------------------------------------------------
3636 */
3737
38−static enum SRC_ERR
38+static SRC_ERROR
3939 zoh_vari_process (SRC_STATE *state, SRC_DATA *data)
4040 { ZOH_DATA *priv ;
4141 double src_ratio, input_index, rem ;
@@ -149,7 +149,7 @@ zoh_get_description (int src_enum) · 107 unmodified lines
149149 return NULL ;
150150 } /* zoh_get_descrition */
151151
152−enum SRC_ERR
152+SRC_ERROR
153153 zoh_set_converter (SRC_STATE *state, int src_enum)
154154 {
155155 ZOH_DATA *priv = NULL ;
@@ -208,7 +208,7 @@ zoh_reset (SRC_STATE *state) · 52 unmodified lines
208208 return ;
209209 } /* zoh_reset */
210210
211−static enum SRC_ERR
211+static SRC_ERROR
212212 zoh_copy (SRC_STATE *from, SRC_STATE *to)
213213 {
214214 if (from->private_data == NULL)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t