Skip to content

Commit 9a29657

Browse files
committed
Use unsigned PRIu64 where appropriate
1 parent 207773b commit 9a29657

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

vcfstats.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,14 +1270,14 @@ static void print_stats(args_t *args)
12701270
for (id=0; id<args->nstats; id++)
12711271
{
12721272
stats_t *stats = &args->stats[id];
1273-
printf("SN\t%d\tnumber of records:\t%"PRId64"\n", id, stats->n_records);
1274-
printf("SN\t%d\tnumber of no-ALTs:\t%"PRId64"\n", id, stats->n_noalts);
1275-
printf("SN\t%d\tnumber of SNPs:\t%"PRId64"\n", id, stats->n_snps);
1276-
printf("SN\t%d\tnumber of MNPs:\t%"PRId64"\n", id, stats->n_mnps);
1277-
printf("SN\t%d\tnumber of indels:\t%"PRId64"\n", id, stats->n_indels);
1278-
printf("SN\t%d\tnumber of others:\t%"PRId64"\n", id, stats->n_others);
1279-
printf("SN\t%d\tnumber of multiallelic sites:\t%"PRId64"\n", id, stats->n_mals);
1280-
printf("SN\t%d\tnumber of multiallelic SNP sites:\t%"PRId64"\n", id, stats->n_snp_mals);
1273+
printf("SN\t%d\tnumber of records:\t%"PRIu64"\n", id, stats->n_records);
1274+
printf("SN\t%d\tnumber of no-ALTs:\t%"PRIu64"\n", id, stats->n_noalts);
1275+
printf("SN\t%d\tnumber of SNPs:\t%"PRIu64"\n", id, stats->n_snps);
1276+
printf("SN\t%d\tnumber of MNPs:\t%"PRIu64"\n", id, stats->n_mnps);
1277+
printf("SN\t%d\tnumber of indels:\t%"PRIu64"\n", id, stats->n_indels);
1278+
printf("SN\t%d\tnumber of others:\t%"PRIu64"\n", id, stats->n_others);
1279+
printf("SN\t%d\tnumber of multiallelic sites:\t%"PRIu64"\n", id, stats->n_mals);
1280+
printf("SN\t%d\tnumber of multiallelic SNP sites:\t%"PRIu64"\n", id, stats->n_snp_mals);
12811281
}
12821282
printf("# TSTV, transitions/transversions:\n# TSTV\t[2]id\t[3]ts\t[4]tv\t[5]ts/tv\t[6]ts (1st ALT)\t[7]tv (1st ALT)\t[8]ts/tv (1st ALT)\n");
12831283
for (id=0; id<args->nstats; id++)
@@ -1419,7 +1419,7 @@ static void print_stats(args_t *args)
14191419
{
14201420
if ( usr->vals_ts[j]+usr->vals_tv[j] == 0 ) continue; // skip empty bins
14211421
float val = usr->min + (usr->max - usr->min)*j/(usr->nbins-1);
1422-
const char *fmt = usr->type==BCF_HT_REAL ? "USR:%s/%d\t%d\t%e\t%"PRId64"\t%"PRId64"\t%"PRId64"\n" : "USR:%s/%d\t%d\t%.0f\t%"PRId64"\t%"PRId64"\t%"PRId64"\n";
1422+
const char *fmt = usr->type==BCF_HT_REAL ? "USR:%s/%d\t%d\t%e\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n" : "USR:%s/%d\t%d\t%.0f\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n";
14231423
printf(fmt,usr->tag,usr->idx,id,val,usr->vals_ts[j]+usr->vals_tv[j],usr->vals_ts[j],usr->vals_tv[j]);
14241424
}
14251425
}
@@ -1512,8 +1512,8 @@ static void print_stats(args_t *args)
15121512
}
15131513
double af = args->af_bins ? (bin_get_value(args->af_bins,i)+bin_get_value(args->af_bins,i-1))*0.5 : (double)(i-1)/(args->m_af-1);
15141514
printf("GC%cAF\t2\t%f", x==0 ? 's' : 'i', af);
1515-
printf("\t%"PRId64"\t%"PRId64"\t%"PRId64"", m[T2S(GT_HOM_RR)],m[T2S(GT_HET_RA)],m[T2S(GT_HOM_AA)]);
1516-
printf("\t%"PRId64"\t%"PRId64"\t%"PRId64"", mm[T2S(GT_HOM_RR)],mm[T2S(GT_HET_RA)],mm[T2S(GT_HOM_AA)]);
1515+
printf("\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"", m[T2S(GT_HOM_RR)],m[T2S(GT_HET_RA)],m[T2S(GT_HOM_AA)]);
1516+
printf("\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"", mm[T2S(GT_HOM_RR)],mm[T2S(GT_HET_RA)],mm[T2S(GT_HOM_AA)]);
15171517
if ( stats[i].n && !isnan(r2) ) printf("\t%f", r2);
15181518
else printf("\t"NA_STRING);
15191519
printf("\t%.0f\n", stats[i].n);
@@ -1571,11 +1571,11 @@ static void print_stats(args_t *args)
15711571
r2 *= r2;
15721572
}
15731573
printf("GC%cS\t2\t%s\t%.3f", x==0 ? 's' : 'i', args->files->samples[i], m+mm ? mm*100.0/(m+mm) : 0);
1574-
printf("\t%"PRId64"\t%"PRId64"\t%"PRId64"",
1574+
printf("\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"",
15751575
stats[i].gt2gt[T2S(GT_HOM_RR)][T2S(GT_HOM_RR)],
15761576
stats[i].gt2gt[T2S(GT_HET_RA)][T2S(GT_HET_RA)],
15771577
stats[i].gt2gt[T2S(GT_HOM_AA)][T2S(GT_HOM_AA)]);
1578-
printf("\t%"PRId64"\t%"PRId64"\t%"PRId64"",
1578+
printf("\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"",
15791579
stats[i].gt2gt[T2S(GT_HOM_RR)][T2S(GT_HET_RA)] + stats[i].gt2gt[T2S(GT_HOM_RR)][T2S(GT_HOM_AA)],
15801580
stats[i].gt2gt[T2S(GT_HET_RA)][T2S(GT_HOM_RR)] + stats[i].gt2gt[T2S(GT_HET_RA)][T2S(GT_HOM_AA)],
15811581
stats[i].gt2gt[T2S(GT_HOM_AA)][T2S(GT_HOM_RR)] + stats[i].gt2gt[T2S(GT_HOM_AA)][T2S(GT_HET_RA)]);
@@ -1631,7 +1631,7 @@ static void print_stats(args_t *args)
16311631
printf("GCT%c\t%s", x==0 ? 's' : 'i', args->files->samples[i]);
16321632
for (j=0; j<5; j++)
16331633
for (k=0; k<5; k++)
1634-
printf("\t%"PRId64, stats[i].gt2gt[j][k]);
1634+
printf("\t%"PRIu64, stats[i].gt2gt[j][k]);
16351635
printf("\n");
16361636
}
16371637
}
@@ -1650,8 +1650,8 @@ static void print_stats(args_t *args)
16501650
if ( i==0 ) printf("<%d", stats->dp.min);
16511651
else if ( i+1==stats->dp.m_vals ) printf(">%d", stats->dp.max);
16521652
else printf("%d", idist_i2bin(&stats->dp,i));
1653-
printf("\t%"PRId64"\t%f", stats->dp.vals[i], sum ? stats->dp.vals[i]*100./sum : 0);
1654-
printf("\t%"PRId64"\t%f\n", stats->dp_sites.vals[i], sum_sites ? stats->dp_sites.vals[i]*100./sum_sites : 0);
1653+
printf("\t%"PRIu64"\t%f", stats->dp.vals[i], sum ? stats->dp.vals[i]*100./sum : 0);
1654+
printf("\t%"PRIu64"\t%f\n", stats->dp_sites.vals[i], sum_sites ? stats->dp_sites.vals[i]*100./sum_sites : 0);
16551655
}
16561656
}
16571657

0 commit comments

Comments
 (0)