X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=samtools.git;a=blobdiff_plain;f=bam_aux.c;h=b6a8d88dcc9bde5e9f43f8e4d7f0ec1bd3ecc919;hp=4fd3190a73799c6fd68257cc8c1125a017dc4860;hb=9f4bebab2e0917c676ae739b2d05cb22ad6c4ed5;hpb=1539c893f863596db71ab2af75a802e935496940 diff --git a/bam_aux.c b/bam_aux.c index 4fd3190..b6a8d88 100644 --- a/bam_aux.c +++ b/bam_aux.c @@ -26,14 +26,12 @@ uint8_t *bam_aux_get_core(bam1_t *b, const char tag[2]) } #define __skip_tag(s) do { \ - int type = toupper(*(s)); \ - ++(s); \ - if (type == 'C' || type == 'A') ++(s); \ - else if (type == 'S') (s) += 2; \ - else if (type == 'I' || type == 'F') (s) += 4; \ - else if (type == 'D') (s) += 8; \ - else if (type == 'Z' || type == 'H') { while (*(s)) ++(s); ++(s); } \ - } while (0) + int type = toupper(*(s)); \ + ++(s); \ + if (type == 'Z' || type == 'H') { while (*(s)) ++(s); ++(s); } \ + else if (type == 'B') (s) += 5 + bam_aux_type2size(*(s)) * (*(int32_t*)((s)+1)); \ + else (s) += bam_aux_type2size(type); \ + } while(0) uint8_t *bam_aux_get(const bam1_t *b, const char tag[2]) {