]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/BamAlignment.cpp
Provided initialization values for previously unspecified (potentially
[bamtools.git] / src / api / BamAlignment.cpp
index c95e896c7333d527d726c953a7fcd660f7f42ffc..3a508c4cb2891b44ca24afa25f9845027cffb33c 100644 (file)
@@ -2,7 +2,7 @@
 // BamAlignment.cpp (c) 2009 Derek Barnett
 // Marth Lab, Department of Biology, Boston College
 // ---------------------------------------------------------------------------
-// Last modified: 13 October 2011 (DB)
+// Last modified: 22 February 2012 (DB)
 // ---------------------------------------------------------------------------
 // Provides the BamAlignment data structure
 // ***************************************************************************
@@ -70,8 +70,12 @@ using namespace std;
     \brief constructor
 */
 BamAlignment::BamAlignment(void)
-    : RefID(-1)
+    : Length(0)
+    , RefID(-1)
     , Position(-1)
+    , Bin(0)
+    , MapQuality(0)
+    , AlignmentFlag(0)
     , MateRefID(-1)
     , MatePosition(-1)
     , InsertSize(0)
@@ -365,18 +369,9 @@ bool BamAlignment::FindTag(const std::string& tag,
             return true;
 
         // get the storage class and find the next tag
-        if ( *pTagStorageType == '\0' ) {
-            ErrorString = "unexpected null found - 1";
-            return false;
-        }
-        if ( !SkipToNextTag(*pTagStorageType, pTagData, numBytesParsed) ) {
-            ErrorString = "could not skip to next tag";
-            return false;
-        }
-        if ( *pTagData == '\0' ) {
-            ErrorString = "unexpected null found - 2";
-            return false;
-        }
+        if ( *pTagStorageType == '\0' ) return false;
+        if ( !SkipToNextTag(*pTagStorageType, pTagData, numBytesParsed) ) return false;
+        if ( *pTagData == '\0' ) return false;
     }
 
     // checked all tags, none match