History

Fix some C++ incompatibilities

evpobr committed 6 years ago

Commit c28af3d1 parent 5f609974 files · +7 −7Browse files

Unified · Split

4 files
  1. src/samplerate.c +1 −1
  2. src/src_linear.c +2 −2
  3. src/src_sinc.c +2 −2
  4. src/src_zoh.c +2 −2
src/samplerate.c+1−1
@@ -267,7 +267,7 @@ src_callback_read (SRC_STATE *state, double src_ratio, long frames, float *data) · 266 unmodified lines
267 state->saved_frames = src_data.input_frames ;267 state->saved_frames = src_data.input_frames ;
268 268
269 if (error != 0)269 if (error != 0)
270 { state->error = error ;270 { state->error = (SRC_ERROR) error ;
271 return 0 ;271 return 0 ;
272 } ;272 } ;
273 273
src/src_linear.c+2−2
@@ -173,7 +173,7 @@ linear_set_converter (SRC_STATE *state, int src_enum) · 172 unmodified lines
173 priv = (LINEAR_DATA *) calloc (1, sizeof (LINEAR_DATA)) ;173 priv = (LINEAR_DATA *) calloc (1, sizeof (LINEAR_DATA)) ;
174 if (priv)174 if (priv)
175 {175 {
176 priv->last_value = calloc (state->channels, sizeof (float)) ;176 priv->last_value = (float *) calloc (state->channels, sizeof (float)) ;
177 if (!priv->last_value)177 if (!priv->last_value)
178 {178 {
179 free (priv) ;179 free (priv) ;
@@ -229,7 +229,7 @@ linear_copy (SRC_STATE *from, SRC_STATE *to) · 49 unmodified lines
229 return SRC_ERR_MALLOC_FAILED ;229 return SRC_ERR_MALLOC_FAILED ;
230 230
231 memcpy (to_priv, from_priv, sizeof (LINEAR_DATA)) ;231 memcpy (to_priv, from_priv, sizeof (LINEAR_DATA)) ;
232 to_priv->last_value = malloc (sizeof (float) * from->channels) ;232 to_priv->last_value = (float *) malloc (sizeof (float) * from->channels) ;
233 if (!to_priv->last_value)233 if (!to_priv->last_value)
234 {234 {
235 free (to_priv) ;235 free (to_priv) ;
src/src_sinc.c+2−2
@@ -223,7 +223,7 @@ sinc_set_converter (SRC_STATE *state, int src_enum) · 222 unmodified lines
223 return SRC_ERR_MALLOC_FAILED ;223 return SRC_ERR_MALLOC_FAILED ;
224 224
225 *filter = temp_filter ;225 *filter = temp_filter ;
226 filter->buffer = calloc (temp_filter.b_len + state->channels, sizeof (float)) ;226 filter->buffer = (float *) calloc (temp_filter.b_len + state->channels, sizeof (float)) ;
227 if (!filter->buffer)227 if (!filter->buffer)
228 { free (filter) ;228 { free (filter) ;
229 return SRC_ERR_MALLOC_FAILED ;229 return SRC_ERR_MALLOC_FAILED ;
@@ -276,7 +276,7 @@ sinc_copy (SRC_STATE *from, SRC_STATE *to) · 46 unmodified lines
276 if ((to_filter = (SINC_FILTER *) calloc (1, sizeof (SINC_FILTER))) == NULL)276 if ((to_filter = (SINC_FILTER *) calloc (1, sizeof (SINC_FILTER))) == NULL)
277 return SRC_ERR_MALLOC_FAILED ;277 return SRC_ERR_MALLOC_FAILED ;
278 memcpy (to_filter, from_filter, sizeof (SINC_FILTER)) ;278 memcpy (to_filter, from_filter, sizeof (SINC_FILTER)) ;
279 to_filter->buffer = malloc (sizeof (float) * (from_filter->b_len + from->channels)) ;279 to_filter->buffer = (float *) malloc (sizeof (float) * (from_filter->b_len + from->channels)) ;
280 if (!to_filter->buffer)280 if (!to_filter->buffer)
281 {281 {
282 free (to_filter) ;282 free (to_filter) ;
src/src_zoh.c+2−2
@@ -164,7 +164,7 @@ zoh_set_converter (SRC_STATE *state, int src_enum) · 163 unmodified lines
164 priv = (ZOH_DATA *) calloc (1, sizeof (ZOH_DATA)) ;164 priv = (ZOH_DATA *) calloc (1, sizeof (ZOH_DATA)) ;
165 if (priv)165 if (priv)
166 {166 {
167 priv->last_value = calloc (state->channels, sizeof (float)) ;167 priv->last_value = (float *) calloc (state->channels, sizeof (float)) ;
168 if (!priv->last_value)168 if (!priv->last_value)
169 {169 {
170 free (priv) ;170 free (priv) ;
@@ -221,7 +221,7 @@ zoh_copy (SRC_STATE *from, SRC_STATE *to) · 50 unmodified lines
221 return SRC_ERR_MALLOC_FAILED ;221 return SRC_ERR_MALLOC_FAILED ;
222 222
223 memcpy (to_priv, from_priv, sizeof (ZOH_DATA)) ;223 memcpy (to_priv, from_priv, sizeof (ZOH_DATA)) ;
224 to_priv->last_value = malloc (sizeof (float) * from->channels) ;224 to_priv->last_value = (float *) malloc (sizeof (float) * from->channels) ;
225 if (!to_priv->last_value)225 if (!to_priv->last_value)
226 { free (to_priv) ;226 { free (to_priv) ;
227 return SRC_ERR_MALLOC_FAILED ;227 return SRC_ERR_MALLOC_FAILED ;

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