Skip to content

Commit e147aad

Browse files
author
Javier Serrano Polo
committedMar 28, 2017
Fix tautological compare and use of uninitialized value
1 parent 2c50807 commit e147aad

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎delayorama_1402.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<code><![CDATA[
1010
#include <ladspa-util.h>
1111
12+
#define MIN(a,b) ((a) < (b) ? (a) : (b))
1213
#define N_TAPS 128
1314
1415
typedef struct {
@@ -146,7 +147,7 @@
146147
for (i=0; i<ntaps; i++) {
147148
g_rand = (1.0f-gain_rand) + (float)rand() / (float)RAND_MAX * 2.0f * gain_rand;
148149
d_rand = (1.0f-delay_rand) + (float)rand() / (float)RAND_MAX * 2.0f * delay_rand;
149-
taps[next_set][i].delay = LIMIT((unsigned int)(delay_base + delay_sum * delay_fix * d_rand), 0, buffer_size-1);
150+
taps[next_set][i].delay = MIN((unsigned int)(delay_base + delay_sum * delay_fix * d_rand), buffer_size-1);
150151
taps[next_set][i].gain = gain * g_rand;
151152
152153
delay_sum += delay;

‎makestub.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ sub process_plugin {
206206
if ($foo eq "callback") {
207207
push(@callbacks, $tree->[$i+1]->[0]->{'event'});
208208
$callback_code{$label.'_'.$tree->[$i+1]->[0]->{'event'}} = $tree->[$i+1]->[2];
209-
$callback_unused_vars{$label.'_'.$tree->[$i+1]->[0]->{'event'}} = $tree->[$i+1]->[0]->{'unused-vars'};
209+
$callback_unused_vars{$label.'_'.$tree->[$i+1]->[0]->{'event'}} = $tree->[$i+1]->[0]->{'unused-vars'} // "";
210210
}
211211
if ($foo eq "port") {
212212
push(@ports, &process_port($tree->[$i+1]));

0 commit comments

Comments
 (0)
Please sign in to comment.