Change , to && in 2 for loops in Oktalyzer loader

- For something like i < n_chnnels, j < 4 , the first condition is completely unused, so why put it in the for loop at all? I assume these are supposed to be binary-and and not sequences.
This commit is contained in:
Randy Heit 2014-04-03 08:50:09 -05:00
parent 4406578522
commit 1d1289722f

View file

@ -486,7 +486,7 @@ static DUMB_IT_SIGDATA *it_okt_load_sigdata(DUMBFILE *f)
/* And finally, the sample data */ /* And finally, the sample data */
k = get_chunk_count(mod, DUMB_ID('S','B','O','D')); k = get_chunk_count(mod, DUMB_ID('S','B','O','D'));
for (i = 0, j = 0; i < (unsigned)sigdata->n_samples, j < k; i++) { for (i = 0, j = 0; i < (unsigned)sigdata->n_samples && j < k; i++) {
if (sigdata->sample[i].flags & IT_SAMPLE_EXISTS) { if (sigdata->sample[i].flags & IT_SAMPLE_EXISTS) {
chunk = get_chunk_by_type(mod, DUMB_ID('S','B','O','D'), j); chunk = get_chunk_by_type(mod, DUMB_ID('S','B','O','D'), j);
if (it_okt_read_sample_data(&sigdata->sample[i], (const char *)chunk->data, chunk->size)) { if (it_okt_read_sample_data(&sigdata->sample[i], (const char *)chunk->data, chunk->size)) {
@ -503,7 +503,7 @@ static DUMB_IT_SIGDATA *it_okt_load_sigdata(DUMBFILE *f)
chunk = get_chunk_by_type(mod, DUMB_ID('C','M','O','D'), 0); chunk = get_chunk_by_type(mod, DUMB_ID('C','M','O','D'), 0);
for (i = 0, j = 0; i < n_channels, j < 4; j++) { for (i = 0, j = 0; i < n_channels && j < 4; j++) {
k = (chunk->data[j * 2] << 8) | chunk->data[j * 2 + 1]; k = (chunk->data[j * 2] << 8) | chunk->data[j * 2 + 1];
l = (j == 1 || j == 2) ? 48 : 16; l = (j == 1 || j == 2) ? 48 : 16;
if (k == 0) { if (k == 0) {