diff options
Diffstat (limited to 'src/libbio')
-rw-r--r-- | src/libbio/fasta.c | 30 | ||||
-rw-r--r-- | src/libbio/newick.c | 10 | ||||
-rw-r--r-- | src/libbio/phylo.c | 26 |
3 files changed, 33 insertions, 33 deletions
diff --git a/src/libbio/fasta.c b/src/libbio/fasta.c index 3788544..eb0d090 100644 --- a/src/libbio/fasta.c +++ b/src/libbio/fasta.c @@ -23,7 +23,7 @@ reset(struct SeqBuf *sb) } static -error +int grow(struct SeqBuf **sb, int min) { void* heap; @@ -56,7 +56,7 @@ grow(struct SeqBuf **sb, int min) } static -error +int put(struct SeqBuf **sb, byte c) { int err; @@ -79,7 +79,7 @@ put(struct SeqBuf **sb, byte c) } static -error +int push(struct SeqBuf **sb, int n, void *buf) { int d, err; @@ -117,7 +117,7 @@ struct bio·SeqReader { }; static -error +int fill(bio·SeqReader *rdr) { int n; @@ -141,7 +141,7 @@ fill(bio·SeqReader *rdr) bio·SeqReader* bio·openseq(io·Reader rdr, void *io, mem·Allocator mem, void *heap) { - error err; + int err; bio·SeqReader *r; r = mem.alloc(heap, 1, sizeof(bio·SeqReader)); @@ -168,7 +168,7 @@ ERROR: return nil; } -error +int bio·closeseq(bio·SeqReader *rdr) { mem·Allocator mem; @@ -185,11 +185,11 @@ bio·closeseq(bio·SeqReader *rdr) static -error +int readfasta(bio·SeqReader *rdr, bio·Seq *seq, byte hdr, byte stop) { - error err; - byte *beg; + int err; + byte *beg; if(rdr->eof && rdr->b == rdr->bend-1) return EOF; @@ -256,10 +256,10 @@ SUCCESS: * fasta files */ -error +int bio·readfasta(bio·SeqReader *rdr, bio·Seq *seq) { - error err; + int err; err = readfasta(rdr, seq, '>', '>'); if(err && err != EOF) { @@ -279,12 +279,12 @@ bio·readfasta(bio·SeqReader *rdr, bio·Seq *seq) * fastq files */ -error +int bio·readfastq(bio·SeqReader *rdr, bio·Seq *seq) { int n; byte *beg; - error err; + int err; err = readfasta(rdr, seq, '@', '+'); if(err) { @@ -352,7 +352,7 @@ SUCCESS: // ----------------------------------------------------------------------- // sequence writing -error +int bio·writefasta(io·Writer io, void *wtr, bio·Seq seq) { int i, j, d; @@ -385,7 +385,7 @@ bio·writefasta(io·Writer io, void *wtr, bio·Seq seq) return 0; } -error +int bio·writefastq(io·Writer io, void *wtr, bio·Seq seq) { panicf("need to implement"); diff --git a/src/libbio/newick.c b/src/libbio/newick.c index 5e6d30a..bc768fd 100644 --- a/src/libbio/newick.c +++ b/src/libbio/newick.c @@ -174,10 +174,10 @@ struct Parser }; static -error +int parse(struct Parser *p) { - error err; + int err; bio·Node *node; bio·Node *root; struct Token tok; @@ -332,7 +332,7 @@ ERROR: int bio·readnewick(io·Peeker stream, void *s, bio·Tree *tree) { - error err; + int err; struct Parser p; if (!tree) { @@ -369,7 +369,7 @@ bio·readnewick(io·Peeker stream, void *s, bio·Tree *tree) // Write static -error +int dump(bio·Node *node, void *impl, io·Putter out) { byte b[24]; @@ -403,7 +403,7 @@ dump(bio·Node *node, void *impl, io·Putter out) return 0; } -error +int bio·writenewick(bio·Tree tree, io·Putter out, void* impl) { dump(tree.root, impl, out); diff --git a/src/libbio/phylo.c b/src/libbio/phylo.c index d50934f..41b0f04 100644 --- a/src/libbio/phylo.c +++ b/src/libbio/phylo.c @@ -8,7 +8,7 @@ // NOTE: As of now these don't update nnode & nleaf stats. // It is the caller's responsibility to refresh counts. -error +int phylo·addchild(bio·Node* parent, bio·Node* child) { bio·Node *it, *sibling; @@ -28,7 +28,7 @@ SUCCESS: return 0; } -error +int phylo·rmchild(bio·Node *parent, bio·Node *child) { bio·Node *it, *prev; @@ -59,11 +59,11 @@ FOUND: // ----------------------------------------------------------------------- // subtree statistics -error +int phylo·countnodes(bio·Node *node, int *n) { - int m; - error err; + int m; + int err; bio·Node *child; m = *n; @@ -79,10 +79,10 @@ phylo·countnodes(bio·Node *node, int *n) return 0; } -error +int phylo·countleafs(bio·Node *node, int *n) { - error err; + int err; bio·Node *child; if (!node->nchild) { @@ -182,11 +182,11 @@ sortnodelist(bio·Node **head, bio·Node *next) *head = tmp.sibling; } -error +int phylo·ladderize(bio·Node *root) { - int i; - error err; + int i; + int err; bio·Node *child, *sorted, *sibling; if (!root->nchild) return 0; @@ -347,10 +347,10 @@ phylo·diameter(bio·Tree tree, int *len, bio·Node **path) * reroot a tree on a new node */ static -error +int rotateparent(bio·Node *node, bio·Node *to) { - error err; + int err; // NOTE: will this ever be taken? if (node->parent == to) { @@ -385,7 +385,7 @@ RMCHILD: } #define PREC .00000001 -error +int phylo·reroot(bio·Tree *tree, bio·Node *node, double d) { bio·Node *new; |