mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-29 05:22:25 -04:00
DATV demod: MSVC build: fixed some initializations and destructions
This commit is contained in:
parent
0219f119a8
commit
9beca1a307
@ -105,9 +105,12 @@ struct bch_engine : bch_interface
|
|||||||
if (S[i])
|
if (S[i])
|
||||||
corrupted = true;
|
corrupted = true;
|
||||||
}
|
}
|
||||||
delete[] rem;
|
|
||||||
if (!corrupted)
|
if (!corrupted)
|
||||||
|
{
|
||||||
|
delete[] S;
|
||||||
|
delete[] rem;
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
#if 0
|
#if 0
|
||||||
fprintf(stderr, "synd:");
|
fprintf(stderr, "synd:");
|
||||||
for ( int i=0; i<2*npolys; ++i ) fprintf(stderr, " %04x", S[i]);
|
for ( int i=0; i<2*npolys; ++i ) fprintf(stderr, " %04x", S[i]);
|
||||||
@ -124,9 +127,9 @@ struct bch_engine : bch_interface
|
|||||||
|
|
||||||
int NN = 2 * npolys;
|
int NN = 2 * npolys;
|
||||||
TGF *C = new TGF[NN];
|
TGF *C = new TGF[NN];
|
||||||
std::fill(C, C+NN, 1);
|
C[0] = 1;
|
||||||
TGF *B = new TGF[NN];
|
TGF *B = new TGF[NN];
|
||||||
std::fill(C, C+NN, 1);
|
B[0] = 1;
|
||||||
// TGF C[NN] = { crap code
|
// TGF C[NN] = { crap code
|
||||||
// 1,
|
// 1,
|
||||||
// },
|
// },
|
||||||
@ -165,7 +168,6 @@ struct bch_engine : bch_interface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete[] S;
|
|
||||||
// L is the number of errors.
|
// L is the number of errors.
|
||||||
// C of degree L is the error locator polynomial (Lambda).
|
// C of degree L is the error locator polynomial (Lambda).
|
||||||
// C(X) = sum(l=1..L)(1-X_l*X).
|
// C(X) = sum(l=1..L)(1-X_l*X).
|
||||||
@ -197,6 +199,8 @@ struct bch_engine : bch_interface
|
|||||||
// This may happen if the code is used truncated.
|
// This may happen if the code is used truncated.
|
||||||
delete[] C;
|
delete[] C;
|
||||||
delete[] B;
|
delete[] B;
|
||||||
|
delete[] S;
|
||||||
|
delete[] rem;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
cw[rloc / 8] ^= 128 >> (rloc & 7);
|
cw[rloc / 8] ^= 128 >> (rloc & 7);
|
||||||
@ -208,6 +212,8 @@ struct bch_engine : bch_interface
|
|||||||
|
|
||||||
delete[] C;
|
delete[] C;
|
||||||
delete[] B;
|
delete[] B;
|
||||||
|
delete[] S;
|
||||||
|
delete[] rem;
|
||||||
|
|
||||||
if (roots_found != L)
|
if (roots_found != L)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user