Enable local multi-declarations. Fix of builtin argument checking. Migrate to @noinit.

This commit is contained in:
Christoffer Lerno
2023-02-11 02:03:02 +01:00
parent 18de9a146b
commit 1548cd06ef
30 changed files with 259 additions and 106 deletions

View File

@@ -59,7 +59,7 @@ const LINELEN = 60;
fn void repeat_fasta(char[] seq, int n)
{
usz len = seq.len;
int i = void;
int i @noinit;
for (i = 0; i < n; i++)
{
putchar(seq[i % len]);
@@ -72,12 +72,12 @@ fn void random_fasta(char[] symb, double[] probability, int n)
{
assert(symb.len == probability.len);
int len = probability.len;
int i = void;
int i @noinit;
for (i = 0; i < n; i++)
{
double v = fasta_rand(1.0);
/* slowest idiomatic linear lookup. Fast if len is short though. */
int j = void;
int j @noinit;
for (j = 0; j < len - 1; j++)
{
v -= probability[j];