From: barnett Date: Wed, 30 Sep 2009 16:55:07 +0000 (+0000) Subject: changed SIZEOF_INT to BT_SIZEOF_INT - namespace collision on Xcode-GCC X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=655263adb43685cb53d84447a0c72f550df764a0;p=bamtools.git changed SIZEOF_INT to BT_SIZEOF_INT - namespace collision on Xcode-GCC git-svn-id: svn+ssh://gene.bc.edu/home/subversion/Derek/BamTools/trunk@27 9efb377e-2e27-44b9-b91a-ec4abb80ed8b --- diff --git a/BamAux.h b/BamAux.h index 7f47afe..7e46bd7 100644 --- a/BamAux.h +++ b/BamAux.h @@ -87,7 +87,7 @@ namespace BamTools { const int BAM_LIDX_SHIFT = 14; // Explicit variable sizes - const int SIZEOF_INT = 4; + const int BT_SIZEOF_INT = 4; struct BgzfData { unsigned int UncompressedBlockSize; diff --git a/BamWriter.cpp b/BamWriter.cpp index 694241d..597bae6 100644 --- a/BamWriter.cpp +++ b/BamWriter.cpp @@ -203,7 +203,7 @@ void BamWriter::CreatePackedCigar(const vector& cigarOperations, string // initialize const unsigned int numCigarOperations = cigarOperations.size(); - packedCigar.resize(numCigarOperations * SIZEOF_INT); + packedCigar.resize(numCigarOperations * BT_SIZEOF_INT); // pack the cigar data into the string unsigned int* pPackedCigar = (unsigned int*)packedCigar.data(); @@ -315,14 +315,14 @@ void BamWriter::Open(const string& filename, const string& samHeader, const RefV // write the SAM header text length const unsigned int samHeaderLen = samHeader.size(); - BgzfWrite((char*)&samHeaderLen, SIZEOF_INT); + BgzfWrite((char*)&samHeaderLen, BT_SIZEOF_INT); // write the SAM header text if(samHeaderLen > 0) BgzfWrite(samHeader.data(), samHeaderLen); // write the number of reference sequences const unsigned int numReferenceSequences = referenceSequences.size(); - BgzfWrite((char*)&numReferenceSequences, SIZEOF_INT); + BgzfWrite((char*)&numReferenceSequences, BT_SIZEOF_INT); // ============================= // write the sequence dictionary @@ -333,13 +333,13 @@ void BamWriter::Open(const string& filename, const string& samHeader, const RefV // write the reference sequence name length const unsigned int referenceSequenceNameLen = rsIter->RefName.size() + 1; - BgzfWrite((char*)&referenceSequenceNameLen, SIZEOF_INT); + BgzfWrite((char*)&referenceSequenceNameLen, BT_SIZEOF_INT); // write the reference sequence name BgzfWrite(rsIter->RefName.c_str(), referenceSequenceNameLen); // write the reference sequence length - BgzfWrite((char*)&rsIter->RefLength, SIZEOF_INT); + BgzfWrite((char*)&rsIter->RefLength, BT_SIZEOF_INT); } } @@ -379,7 +379,7 @@ void BamWriter::SaveAlignment(const BamAlignment& al) { const unsigned int dataBlockSize = nameLen + packedCigarLen + encodedQueryLen + queryLen + tagDataLength; const unsigned int blockSize = BAM_CORE_SIZE + dataBlockSize; - BgzfWrite((char*)&blockSize, SIZEOF_INT); + BgzfWrite((char*)&blockSize, BT_SIZEOF_INT); // write the BAM core BgzfWrite((char*)&buffer, BAM_CORE_SIZE);