aboutsummaryrefslogtreecommitdiff
path: root/kmer_total_count.c
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2013-10-01 16:19:21 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2013-10-01 16:19:21 -0400
commit3d5ab03f760814e5e6bb6ac54e29650bc1fe6153 (patch)
tree8181071f59ed7e616611a12b8863057d6ac0a64d /kmer_total_count.c
parent4d00f90fd8b1b9e38eea297336ee83a5e5c9e764 (diff)
update headers, use const for better performance (.500ms on ~2gb file), update comments for functions
Diffstat (limited to 'kmer_total_count.c')
-rw-r--r--kmer_total_count.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/kmer_total_count.c b/kmer_total_count.c
index 2416bfa..8cc91a7 100644
--- a/kmer_total_count.c
+++ b/kmer_total_count.c
@@ -13,10 +13,8 @@ int main(int argc, char **argv) {
char *line = NULL;
size_t len = 0;
ssize_t read;
- long i = 0;
+ unsigned long i = 0;
- unsigned int kmer = 0;
- unsigned long width = 0;
unsigned long long *counts;
if(argc != 3) {
@@ -31,10 +29,10 @@ int main(int argc, char **argv) {
}
// second argument is the kmer
- kmer = atoi(argv[2]);
+ const unsigned int kmer = atoi(argv[2]);
// width is 4^kmer
- width = (int)pow(4, kmer);
+ const unsigned long width = (int)pow(4, kmer);
// malloc our counts matrix
counts = malloc((width+ 1) * sizeof(unsigned long long));