From 3d5ab03f760814e5e6bb6ac54e29650bc1fe6153 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Tue, 1 Oct 2013 16:19:21 -0400 Subject: update headers, use const for better performance (.500ms on ~2gb file), update comments for functions --- kmer_total_count.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'kmer_total_count.c') 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)); -- cgit v1.2.1