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
267267 state->saved_frames = src_data.input_frames ;
268268
269269 if (error != 0)
270− { state->error = error ;
270+ { state->error = (SRC_ERROR) error ;
271271 return 0 ;
272272 } ;
273273
src/src_linear.c+2−2
@@ -173,7 +173,7 @@ linear_set_converter (SRC_STATE *state, int src_enum) · 172 unmodified lines
173173 priv = (LINEAR_DATA *) calloc (1, sizeof (LINEAR_DATA)) ;
174174 if (priv)
175175 {
176− priv->last_value = calloc (state->channels, sizeof (float)) ;
176+ priv->last_value = (float *) calloc (state->channels, sizeof (float)) ;
177177 if (!priv->last_value)
178178 {
179179 free (priv) ;
@@ -229,7 +229,7 @@ linear_copy (SRC_STATE *from, SRC_STATE *to) · 49 unmodified lines
229229 return SRC_ERR_MALLOC_FAILED ;
230230
231231 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) ;
233233 if (!to_priv->last_value)
234234 {
235235 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
223223 return SRC_ERR_MALLOC_FAILED ;
224224
225225 *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)) ;
227227 if (!filter->buffer)
228228 { free (filter) ;
229229 return SRC_ERR_MALLOC_FAILED ;
@@ -276,7 +276,7 @@ sinc_copy (SRC_STATE *from, SRC_STATE *to) · 46 unmodified lines
276276 if ((to_filter = (SINC_FILTER *) calloc (1, sizeof (SINC_FILTER))) == NULL)
277277 return SRC_ERR_MALLOC_FAILED ;
278278 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)) ;
280280 if (!to_filter->buffer)
281281 {
282282 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
164164 priv = (ZOH_DATA *) calloc (1, sizeof (ZOH_DATA)) ;
165165 if (priv)
166166 {
167− priv->last_value = calloc (state->channels, sizeof (float)) ;
167+ priv->last_value = (float *) calloc (state->channels, sizeof (float)) ;
168168 if (!priv->last_value)
169169 {
170170 free (priv) ;
@@ -221,7 +221,7 @@ zoh_copy (SRC_STATE *from, SRC_STATE *to) · 50 unmodified lines
221221 return SRC_ERR_MALLOC_FAILED ;
222222
223223 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) ;
225225 if (!to_priv->last_value)
226226 { free (to_priv) ;
227227 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