diff --git a/ldpc_decoder.hh b/ldpc_decoder.hh index 0c79318..ce0e6c6 100644 --- a/ldpc_decoder.hh +++ b/ldpc_decoder.hh @@ -161,13 +161,13 @@ class LDPCDecoder shift[c] = (shift[c] + 1) % M; } std::sort(lo, lo + cnt, [](const Loc &a, const Loc &b){ return a.off < b.off; }); - bool wd[deg]; + bool wd[deg], repeat; for (int d = 0; d < deg; ++d) wd[d] = false; for (int c = 1; c < cnt; ++c) if (lo[c].off == lo[c-1].off) wd[c] = true; - for (bool repeat = true; repeat;) { + do { TYPE par[2]; if (i) { par[0] = pty[W*(i-1)+j]; @@ -217,7 +217,7 @@ class LDPCDecoder repeat = true; ++c; } - } + } while (repeat); bl += deg; } } diff --git a/ldpc_decoder2.hh b/ldpc_decoder2.hh index 48e578f..633b0b0 100644 --- a/ldpc_decoder2.hh +++ b/ldpc_decoder2.hh @@ -142,13 +142,13 @@ class LDPCDecoder int cnt = cnc[i]; int deg = cnt + 2; for (int j = 0; j < W; ++j) { - bool wd[deg]; + bool wd[deg], repeat; for (int d = 0; d < deg; ++d) wd[d] = false; for (int c = 1; c < cnt; ++c) if (lo[c].off == lo[c-1].off) wd[c] = true; - for (bool repeat = true; repeat;) { + do { TYPE par[2]; if (i) { par[0] = pty[W*(i-1)+j]; @@ -198,7 +198,7 @@ class LDPCDecoder repeat = true; ++c; } - } + } while (repeat); lo += cnt; bl += deg; }