From: Petr Danecek <pd3@sanger.ac.uk>
Date: Fri, 15 Mar 2013 09:25:33 +0000 (+0100)
Subject: Get rid of %ld-with-int64_t warning on Mac
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=941fbbbf695efff2c78765d8d0c415ae19b516a1;p=samtools.git

Get rid of %ld-with-int64_t warning on Mac
---

diff --git a/sam_view.c b/sam_view.c
index 5283098..7f3fdab 100644
--- a/sam_view.c
+++ b/sam_view.c
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <math.h>
+#include <inttypes.h>
 #include "sam_header.h"
 #include "sam.h"
 #include "faidx.h"
@@ -273,9 +274,9 @@ int main_samview(int argc, char *argv[])
 	}
 
 view_end:
-	if (is_count && ret == 0) {
-		printf("%ld\n", count); // compilers on some platforms may complain about printing int64_t with %ld
-	}
+	if (is_count && ret == 0) 
+		printf("%" PRId64 "\n", count);
+
 	// close files, free and return
 	free(fn_list); free(fn_ref); free(fn_out); free(g_library); free(g_rg); free(fn_rg);
 	if (g_bed) bed_destroy(g_bed);