History

Rename some private structs `reset` field to `dirty`

To avoid confusion with SRC_STATE->reset field.

evpobr committed 6 years ago

Commit ece92451 parent 7f461a32 files · +8 −8Browse files

Unified · Split

2 files
  1. src/src_linear.c +4 −4
  2. src/src_zoh.c +4 −4
src/src_linear.c+4−4
@@ -28,7 +28,7 @@ static int linear_copy (SRC_STATE *from, SRC_STATE *to) ; · 27 unmodified lines
2828 typedef struct
2929 { int linear_magic_marker ;
3030 int channels ;
31− int reset ;
31+ int dirty ;
3232 long in_count, in_used ;
3333 long out_count, out_gen ;
3434 float last_value [] ;
@@ -51,11 +51,11 @@ linear_vari_process (SRC_STATE *state, SRC_DATA *data) · 16 unmodified lines
5151
5252 priv = (LINEAR_DATA*) state->private_data ;
5353
54− if (priv->reset)
54+ if (!priv->dirty)
5555 { /* If we have just been reset, set the last_value data. */
5656 for (ch = 0 ; ch < priv->channels ; ch++)
5757 priv->last_value [ch] = data->data_in [ch] ;
58− priv->reset = 0 ;
58+ priv->dirty = 1 ;
5959 } ;
6060
6161 priv->in_count = data->input_frames * priv->channels ;
@@ -203,7 +203,7 @@ linear_reset (SRC_STATE *state) · 141 unmodified lines
203203 return ;
204204
205205 priv->channels = state->channels ;
206− priv->reset = 1 ;
206+ priv->dirty = 0 ;
207207 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
208208
209209 return ;
src/src_zoh.c+4−4
@@ -26,7 +26,7 @@ static int zoh_copy (SRC_STATE *from, SRC_STATE *to) ; · 25 unmodified lines
2626 typedef struct
2727 { int zoh_magic_marker ;
2828 int channels ;
29− int reset ;
29+ int dirty ;
3030 long in_count, in_used ;
3131 long out_count, out_gen ;
3232 float last_value [] ;
@@ -49,11 +49,11 @@ zoh_vari_process (SRC_STATE *state, SRC_DATA *data) · 16 unmodified lines
4949
5050 priv = (ZOH_DATA*) state->private_data ;
5151
52− if (priv->reset)
52+ if (!priv->dirty)
5353 { /* If we have just been reset, set the last_value data. */
5454 for (ch = 0 ; ch < priv->channels ; ch++)
5555 priv->last_value [ch] = data->data_in [ch] ;
56− priv->reset = 0 ;
56+ priv->dirty = 1 ;
5757 } ;
5858
5959 priv->in_count = data->input_frames * priv->channels ;
@@ -194,7 +194,7 @@ zoh_reset (SRC_STATE *state) · 134 unmodified lines
194194 return ;
195195
196196 priv->channels = state->channels ;
197− priv->reset = 1 ;
197+ priv->dirty = 0 ;
198198 memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
199199
200200 return ;

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