History

removing unneeded tBuffer init args

Matthew Wang committed 6 years ago

Commit ef64cc01 parent f2d7e1a2 files · +4 −6Browse files

Unified · Split

2 files
  1. leaf/Inc/leaf-sampling.h +1 −1
  2. leaf/Src/leaf-sampling.c +3 −5
leaf/Inc/leaf-sampling.h+1−1
@@ -132,7 +132,7 @@ extern "C" { · 131 unmodified lines
132132 typedef _tBuffer* tBuffer;
133133
134134 void tBuffer_init (tBuffer* const, uint32_t length, LEAF* const leaf);
135− void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp, LEAF* const leaf);
135+ void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp);
136136 void tBuffer_free (tBuffer* const);
137137
138138 void tBuffer_tick (tBuffer* const, float sample);
leaf/Src/leaf-sampling.c+3−5
@@ -26,17 +26,17 @@ · 25 unmodified lines
2626
2727 void tBuffer_init (tBuffer* const sb, uint32_t length, LEAF* const leaf)
2828 {
29− tBuffer_initToPool(sb, length, &leaf->mempool, leaf);
29+ tBuffer_initToPool(sb, length, &leaf->mempool);
3030 }
3131
32−void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp, LEAF* const leaf)
32+void tBuffer_initToPool (tBuffer* const sb, uint32_t length, tMempool* const mp)
3333 {
3434 _tMempool* m = *mp;
3535 _tBuffer* s = *sb = (_tBuffer*) mpool_alloc(sizeof(_tBuffer), m);
3636 s->mempool = m;
3737
3838 s->buff = (float*) mpool_alloc( sizeof(float) * length, m);
39− s->sampleRate = leaf->sampleRate;
39+ s->sampleRate = s->mempool->leaf->sampleRate;
4040 s->channels = 1;
4141 s->bufferLength = length;
4242 s->recordedLength = 0;
@@ -273,7 +273,6 @@ void tSampler_setSample (tSampler* const sp, tBuffer* const b) · 230 unmodified lines
273273 float tSampler_tick (tSampler* const sp)
274274 {
275275 _tSampler* p = *sp;
276− LEAF* leaf = p->mempool->leaf;
277276
278277 attemptStartEndChange(sp);
279278
@@ -538,7 +537,6 @@ float tSampler_tick (tSampler* const sp) · 258 unmodified lines
538537 float tSampler_tickStereo (tSampler* const sp, float* outputArray)
539538 {
540539 _tSampler* p = *sp;
541− LEAF* leaf = p->mempool->leaf;
542540
543541 attemptStartEndChange(sp);
544542

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