Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

use RE_ARRAY_SIZE #125

Merged
merged 2 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/aac/aac.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ int aac_header_decode(struct aac_header *hdr, const uint8_t *p, size_t len)

channel_index = (p[1] >> 3) & 0xf;

if (srate_index >= ARRAY_SIZE(aac_sample_rates))
if (srate_index >= RE_ARRAY_SIZE(aac_sample_rates))
return ENOTSUP;
if (channel_index >= ARRAY_SIZE(aac_channels))
if (channel_index >= RE_ARRAY_SIZE(aac_channels))
return ENOTSUP;

hdr->sample_rate = aac_sample_rates[srate_index];
Expand Down
12 changes: 6 additions & 6 deletions src/auresamp/resamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,16 @@ int auresamp_setup(struct auresamp *rs, uint32_t irate, unsigned ich,
}
else if (orate == 48000 && irate == 16000) {
rs->tapv = fir_48_8;
rs->tapc = ARRAY_SIZE(fir_48_8);
rs->tapc = RE_ARRAY_SIZE(fir_48_8);
}
else if ((orate == 16000 && irate == 8000) ||
(orate == 32000 && irate == 16000)) {
rs->tapv = fir_16_4;
rs->tapc = ARRAY_SIZE(fir_16_4);
rs->tapc = RE_ARRAY_SIZE(fir_16_4);
}
else {
rs->tapv = fir_48_4;
rs->tapc = ARRAY_SIZE(fir_48_4);
rs->tapc = RE_ARRAY_SIZE(fir_48_4);
}
}
else {
Expand All @@ -263,16 +263,16 @@ int auresamp_setup(struct auresamp *rs, uint32_t irate, unsigned ich,

if (irate == 48000 && orate == 16000) {
rs->tapv = fir_48_8;
rs->tapc = ARRAY_SIZE(fir_48_8);
rs->tapc = RE_ARRAY_SIZE(fir_48_8);
}
else if ((irate == 16000 && orate == 8000) ||
(irate == 32000 && orate == 16000)) {
rs->tapv = fir_16_4;
rs->tapc = ARRAY_SIZE(fir_16_4);
rs->tapc = RE_ARRAY_SIZE(fir_16_4);
}
else {
rs->tapv = fir_48_4;
rs->tapc = ARRAY_SIZE(fir_48_4);
rs->tapc = RE_ARRAY_SIZE(fir_48_4);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/fir/fir.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void fir_filter(struct fir *fir, int16_t *outv, const int16_t *inv, size_t inc,
if (!fir || !outv || !inv || !ch || !tapv || !tapc)
return;

if (hmask >= ARRAY_SIZE(fir->history) || hmask & (hmask+1))
if (hmask >= RE_ARRAY_SIZE(fir->history) || hmask & (hmask+1))
return;

while (inc--) {
Expand Down