|
77 | 77 | #include <stdio.h>
|
78 | 78 | #include <stdlib.h>
|
79 | 79 | #include <string.h>
|
80 |
| -#include <stdint.h> |
| 80 | +#include <inttypes.h> |
81 | 81 | #include "bch.h"
|
82 | 82 |
|
83 | 83 | int init_bch(bch_t *bch, int m, int length, int t) {
|
@@ -344,7 +344,7 @@ int apply_bch(const bch_t *bch, int *recd)
|
344 | 344 | {
|
345 | 345 | register int i, j, u, q, t2, count = 0, syn_error = 0;
|
346 | 346 | int elp[1026][1024], d[1026], l[1026], u_lu[1026], s[1025];
|
347 |
| - int root[200], loc[200], reg[201]; |
| 347 | + int loc[200], reg[201]; |
348 | 348 |
|
349 | 349 | t2 = 2 * bch->t;
|
350 | 350 |
|
@@ -456,9 +456,9 @@ int apply_bch(const bch_t *bch, int *recd)
|
456 | 456 | d[u + 1] = bch->alpha_to[s[u + 1]];
|
457 | 457 | else
|
458 | 458 | d[u + 1] = 0;
|
459 |
| - for (i = 1; i <= l[u + 1]; i++) |
460 |
| - if ((s[u + 1 - i] != -1) && (elp[u + 1][i] != 0)) |
461 |
| - d[u + 1] ^= bch->alpha_to[(s[u + 1 - i] |
| 459 | + for (i = 1; i <= l[u + 1]; i++) |
| 460 | + if ((s[u + 1 - i] != -1) && (elp[u + 1][i] != 0)) |
| 461 | + d[u + 1] ^= bch->alpha_to[(s[u + 1 - i] |
462 | 462 | + bch->index_of[elp[u + 1][i]]) % bch->n];
|
463 | 463 | /* put d[u+1] into index form */
|
464 | 464 | d[u + 1] = bch->index_of[d[u + 1]];
|
@@ -491,7 +491,6 @@ int apply_bch(const bch_t *bch, int *recd)
|
491 | 491 | }
|
492 | 492 | if (!q) { /* store root and error
|
493 | 493 | * location number indices */
|
494 |
| - root[count] = i; |
495 | 494 | loc[count] = bch->n - i;
|
496 | 495 | count++;
|
497 | 496 | #ifdef BCH_DEBUG
|
|
0 commit comments