| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> |
|---|
| 3 | | - * |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 7 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 | | - * (at your option) any later version. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | | - * GNU General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, write to the Free Software |
|---|
| 17 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 18 | | - * |
|---|
| 19 | 4 | */ |
|---|
| 20 | 5 | |
|---|
| 21 | 6 | #include <linux/time.h> |
|---|
| .. | .. |
|---|
| 77 | 62 | unsigned short end, |
|---|
| 78 | 63 | unsigned int us) |
|---|
| 79 | 64 | { |
|---|
| 80 | | - static unsigned char vol_rates[19] = |
|---|
| 65 | + static const unsigned char vol_rates[19] = |
|---|
| 81 | 66 | { |
|---|
| 82 | 67 | 23, 24, 26, 28, 29, 31, 32, 34, |
|---|
| 83 | 68 | 36, 37, 39, 40, 42, 44, 45, 47, |
|---|
| .. | .. |
|---|
| 128 | 113 | |
|---|
| 129 | 114 | short snd_gf1_compute_vibrato(short cents, unsigned short fc_register) |
|---|
| 130 | 115 | { |
|---|
| 131 | | - static short vibrato_table[] = |
|---|
| 116 | + static const short vibrato_table[] = |
|---|
| 132 | 117 | { |
|---|
| 133 | 118 | 0, 0, 32, 592, 61, 1175, 93, 1808, |
|---|
| 134 | 119 | 124, 2433, 152, 3007, 182, 3632, 213, 4290, |
|---|
| .. | .. |
|---|
| 136 | 121 | }; |
|---|
| 137 | 122 | |
|---|
| 138 | 123 | long depth; |
|---|
| 139 | | - short *vi1, *vi2, pcents, v1; |
|---|
| 124 | + const short *vi1, *vi2; |
|---|
| 125 | + short pcents, v1; |
|---|
| 140 | 126 | |
|---|
| 141 | 127 | pcents = cents < 0 ? -cents : cents; |
|---|
| 142 | 128 | for (vi1 = vibrato_table, vi2 = vi1 + 2; pcents > *vi2; vi1 = vi2, vi2 += 2); |
|---|
| .. | .. |
|---|
| 160 | 146 | |
|---|
| 161 | 147 | unsigned short snd_gf1_compute_pitchbend(unsigned short pitchbend, unsigned short sens) |
|---|
| 162 | 148 | { |
|---|
| 163 | | - static long log_table[] = {1024, 1085, 1149, 1218, 1290, 1367, 1448, 1534, 1625, 1722, 1825, 1933}; |
|---|
| 149 | + static const long log_table[] = {1024, 1085, 1149, 1218, 1290, 1367, 1448, 1534, 1625, 1722, 1825, 1933}; |
|---|
| 164 | 150 | int wheel, sensitivity; |
|---|
| 165 | 151 | unsigned int mantissa, f1, f2; |
|---|
| 166 | 152 | unsigned short semitones, f1_index, f2_index, f1_power, f2_power; |
|---|