From dabfc9cb3ccc5355b1e6a196c01bbfd3e69902b7 Mon Sep 17 00:00:00 2001 From: wandai330 Date: Tue, 20 Jun 2017 16:45:32 -0400 Subject: [PATCH] Some int type variable overflow The maximal number of int type is 2,147,483,648. But now some number could be 5 billion or bigger. Changed those variables to type uint64_t --- clipper/fastq-multx.cpp | 6 +++--- clipper/fastq-stats.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/clipper/fastq-multx.cpp b/clipper/fastq-multx.cpp index 35aeec5..daf28e1 100644 --- a/clipper/fastq-multx.cpp +++ b/clipper/fastq-multx.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. See "void usage" below for usage. */ -#include + #include "fastq-lib.h" #define MAX_BARCODE_NUM 6000 @@ -1074,7 +1074,7 @@ int main (int argc, char **argv) { printf("Id\tCount\tFile(s)\n"); uint64_t tot=0; for (i=0;i<=bcnt;++i) { - printf("%s\t%" PRIu64, bc[i].id.s, bc[i].cnt); + printf("%s\t%lu", bc[i].id.s, bc[i].cnt); tot+=bc[i].cnt; for (j=0;j #include -#include void usage( FILE * f ) { fprintf( f, @@ -567,7 +566,7 @@ int main( int argc, char**argv ) { if(gc) { // put these where they belong if (debug) - printf("gcTotal\t%" PRIu64 "\tgcSum\t%f\n\n", gcTotal, gcSum); + printf("gcTotal\t%lu\tgcSum\t%f\n\n", gcTotal, gcSum); printf("pct-gc cycle-max\t%d\n", gcCyclemax); printf("pct-gc mean\t%.2f\n", 100.0 * gcSum / gcTotal); }