mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Enable local multi-declarations. Fix of builtin argument checking. Migrate to @noinit.
This commit is contained in:
@@ -57,7 +57,7 @@ const LINELEN = 60;
|
||||
fn void repeat_fasta(String seq, int n)
|
||||
{
|
||||
usz len = seq.len;
|
||||
int i = void;
|
||||
int i @noinit;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
io::putchar(seq[i % len]);
|
||||
@@ -70,12 +70,12 @@ fn void random_fasta(String 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];
|
||||
|
||||
@@ -137,7 +137,7 @@ fn MemInfo* newnolink(Value th, int enc, Auint sz)
|
||||
fn void growaux_(Value th, void *block, AuintIdx *size, AuintIdx size_elems, AuintIdx limit)
|
||||
{
|
||||
void* newblock;
|
||||
AuintIdx newsize = void;
|
||||
AuintIdx newsize @noinit;
|
||||
// cannot double it?
|
||||
if (*size >= limit / 2)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user