aboutsummaryrefslogtreecommitdiffstats
path: root/src/nmt
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-01-24 07:59:09 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2017-02-18 21:01:06 +0100
commit538a9591285bdc2604c5e05c06e4b2d776f4bdf9 (patch)
tree0eb989f5e8cd8490b5a4d46f55a3e2fbfd227f75 /src/nmt
parent23a42aeb2c96058e5450805a8ce2d1955e09abd5 (diff)
Indexing tables by casting index to unsigned integer only
Diffstat (limited to 'src/nmt')
-rw-r--r--src/nmt/dsp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nmt/dsp.c b/src/nmt/dsp.c
index e3ff165..ac3018c 100644
--- a/src/nmt/dsp.c
+++ b/src/nmt/dsp.c
@@ -512,7 +512,7 @@ int fsk_render_frame(nmt_t *nmt, const char *frame, int length, int16_t *sample)
for (i = 0; i < length; i++) {
bit = (frame[i] == '1');
do {
- *sample++ = dsp_tone_bit[polarity][bit][((uint8_t)phase) & 0xff];
+ *sample++ = dsp_tone_bit[polarity][bit][(uint8_t)phase];
count++;
phase += phaseshift;
} while (phase < 256.0);
@@ -586,7 +586,7 @@ static void super_encode(nmt_t *nmt, int16_t *samples, int length)
for (i = 0; i < length; i++) {
sample = *samples;
- sample += dsp_sine_super[((uint8_t)phase) & 0xff];
+ sample += dsp_sine_super[(uint8_t)phase];
if (sample > 32767)
sample = 32767;
else if (sample < -32767)
@@ -610,7 +610,7 @@ static void dial_tone(nmt_t *nmt, int16_t *samples, int length)
phase = nmt->dial_phase256;
for (i = 0; i < length; i++) {
- *samples++ = dsp_sine_dialtone[((uint8_t)phase) & 0xff];
+ *samples++ = dsp_sine_dialtone[(uint8_t)phase];
phase += phaseshift;
if (phase >= 256)
phase -= 256;