From 5ad642aaf5d6a4ed7a26438de5cce96217dc5040 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Thu, 16 Jul 2009 10:49:53 +0000 Subject: [PATCH] * samtools-0.1.5-6 (r402) * fixed compiling error when "-D_USE_NETFILE" is not applied * improve portability to MinGW --- bam_import.c | 2 +- bam_index.c | 7 +++++++ bamtk.c | 2 +- bgzf.c | 5 +++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bam_import.c b/bam_import.c index fccaa02..c6fbafc 100644 --- a/bam_import.c +++ b/bam_import.c @@ -359,7 +359,7 @@ int sam_read1(tamFile fp, bam_header_t *header, bam1_t *b) if (c->n_cigar && c->l_qseq != (int32_t)bam_cigar2qlen(c, bam1_cigar(b))) parse_error(fp->n_lines, "CIGAR and sequence length are inconsistent"); p = (uint8_t*)alloc_data(b, doff + c->l_qseq + (c->l_qseq+1)/2) + doff; - bzero(p, (c->l_qseq+1)/2); + memset(p, 0, (c->l_qseq+1)/2); for (i = 0; i < c->l_qseq; ++i) p[i/2] |= bam_nt16_table[(int)str->s[i]] << 4*(1-i%2); if (ks_getuntil(ks, KS_SEP_TAB, str, &dret) < 0) return -6; // qual diff --git a/bam_index.c b/bam_index.c index 725d053..5126f00 100644 --- a/bam_index.c +++ b/bam_index.c @@ -354,6 +354,7 @@ bam_index_t *bam_index_load_local(const char *_fn) } else return 0; } +#ifdef _USE_KNETFILE static void download_from_remote(const char *url) { const int buf_size = 1 * 1024 * 1024; @@ -384,6 +385,12 @@ static void download_from_remote(const char *url) fclose(fp); knet_close(fp_remote); } +#else +static void download_from_remote(const char *url) +{ + return; +} +#endif bam_index_t *bam_index_load(const char *fn) { diff --git a/bamtk.c b/bamtk.c index e071d31..edc949e 100644 --- a/bamtk.c +++ b/bamtk.c @@ -4,7 +4,7 @@ #include "bam.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.5-5 (r395)" +#define PACKAGE_VERSION "0.1.5-6 (r402)" #endif int bam_taf2baf(int argc, char *argv[]); diff --git a/bgzf.c b/bgzf.c index fe4e31d..364ca64 100644 --- a/bgzf.c +++ b/bgzf.c @@ -31,8 +31,13 @@ typedef struct { } cache_t; KHASH_MAP_INIT_INT64(cache, cache_t) +#ifdef _NO_LFS +#define ftello(fp) ftell(fp) +#define fseeko(fp, offset, whence) fseek(fp, offset, whence) +#else extern off_t ftello(FILE *stream); extern int fseeko(FILE *stream, off_t offset, int whence); +#endif typedef int8_t byte; -- 2.39.2