comparison ffstools/tiaud/compile.c @ 246:2abc086b13ed

tiaud-compile: max FIR coefficient number is 30, not 31
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 26 Aug 2017 05:17:49 +0000
parents 2568a2a8a453
children c458e33060bf
comparison
equal deleted inserted replaced
245:796c659b747c 246:2abc086b13ed
161 for (np = cp; *cp && !isspace(*cp); cp++) 161 for (np = cp; *cp && !isspace(*cp); cp++)
162 ; 162 ;
163 if (*cp) 163 if (*cp)
164 *cp++ = '\0'; 164 *cp++ = '\0';
165 start_idx = strtol_wrap(np); 165 start_idx = strtol_wrap(np);
166 if (start_idx < 0 || start_idx > 31) { 166 if (start_idx < 0 || start_idx > 30) {
167 fprintf(stderr, 167 fprintf(stderr,
168 "%s line %d: FIR coefficient number must be between 0 and 31\n", 168 "%s line %d: FIR coefficient number must be between 0 and 30\n",
169 infname, lineno); 169 infname, lineno);
170 exit(1); 170 exit(1);
171 } 171 }
172 for (idx = start_idx; ; idx++) { 172 for (idx = start_idx; ; idx++) {
173 while (isspace(*cp)) 173 while (isspace(*cp))
175 if (*cp == '\0' || *cp == '#') { 175 if (*cp == '\0' || *cp == '#') {
176 if (idx == start_idx) 176 if (idx == start_idx)
177 goto missing_arg; 177 goto missing_arg;
178 break; 178 break;
179 } 179 }
180 if (idx > 31) { 180 if (idx > 30) {
181 fprintf(stderr, 181 fprintf(stderr,
182 "%s line %d: spill past FIR coefficient 31\n", 182 "%s line %d: spill past FIR coefficient 30\n",
183 infname, lineno); 183 infname, lineno);
184 exit(1); 184 exit(1);
185 } 185 }
186 for (np = cp; *cp && !isspace(*cp); cp++) 186 for (np = cp; *cp && !isspace(*cp); cp++)
187 ; 187 ;
359 for (np = cp; *cp && !isspace(*cp); cp++) 359 for (np = cp; *cp && !isspace(*cp); cp++)
360 ; 360 ;
361 if (*cp) 361 if (*cp)
362 *cp++ = '\0'; 362 *cp++ = '\0';
363 start_idx = strtol_wrap(np); 363 start_idx = strtol_wrap(np);
364 if (start_idx < 0 || start_idx > 31) { 364 if (start_idx < 0 || start_idx > 30) {
365 fprintf(stderr, 365 fprintf(stderr,
366 "%s line %d: FIR coefficient number must be between 0 and 31\n", 366 "%s line %d: FIR coefficient number must be between 0 and 30\n",
367 infname, lineno); 367 infname, lineno);
368 exit(1); 368 exit(1);
369 } 369 }
370 for (idx = start_idx; ; idx++) { 370 for (idx = start_idx; ; idx++) {
371 while (isspace(*cp)) 371 while (isspace(*cp))
373 if (*cp == '\0' || *cp == '#') { 373 if (*cp == '\0' || *cp == '#') {
374 if (idx == start_idx) 374 if (idx == start_idx)
375 goto missing_arg; 375 goto missing_arg;
376 break; 376 break;
377 } 377 }
378 if (idx > 31) { 378 if (idx > 30) {
379 fprintf(stderr, 379 fprintf(stderr,
380 "%s line %d: spill past FIR coefficient 31\n", 380 "%s line %d: spill past FIR coefficient 30\n",
381 infname, lineno); 381 infname, lineno);
382 exit(1); 382 exit(1);
383 } 383 }
384 for (np = cp; *cp && !isspace(*cp); cp++) 384 for (np = cp; *cp && !isspace(*cp); cp++)
385 ; 385 ;