nsgmls: resolve coverity warnings related to uninitialed members in C++ classes
authorPeter Howkins <flibble@users.sf.net>
Fri, 20 Apr 2018 00:00:01 +0000 (01:00 +0100)
committerPeter Howkins <flibble@users.sf.net>
Fri, 20 Apr 2018 00:00:01 +0000 (01:00 +0100)
25 files changed:
cde/programs/nsgmls/ArcEngine.C
cde/programs/nsgmls/Attribute.C
cde/programs/nsgmls/CharsetDecl.C
cde/programs/nsgmls/ContentState.C
cde/programs/nsgmls/ContentToken.C
cde/programs/nsgmls/ContentToken.h
cde/programs/nsgmls/ExtendEntityManager.C
cde/programs/nsgmls/ExternalId.C
cde/programs/nsgmls/Group.h
cde/programs/nsgmls/InputSource.C
cde/programs/nsgmls/Location.C
cde/programs/nsgmls/Message.C
cde/programs/nsgmls/OutputCharStream.C
cde/programs/nsgmls/OutputState.C
cde/programs/nsgmls/Param.h
cde/programs/nsgmls/ParserState.C
cde/programs/nsgmls/PosixStorage.C
cde/programs/nsgmls/RewindStorageObject.C
cde/programs/nsgmls/SOEntityCatalog.C
cde/programs/nsgmls/SdText.C
cde/programs/nsgmls/SgmlsEventHandler.C
cde/programs/nsgmls/ShortReferenceMap.C
cde/programs/nsgmls/Syntax.C
cde/programs/nsgmls/Text.C
cde/programs/nsgmls/Trie.h

index eca9df9c4a993acaea22f1b77ca824a80058fc2d..99970e06043cee81710077bf5b21deddeb3c6331 100644 (file)
@@ -208,7 +208,7 @@ ArcEngineImpl::ArcEngineImpl(Messenger &mgr,
   parser_(parser), stage_(0),
   gatheringContent_(0), startAgain_(0), haveLinkProcess_(0),
   allocator_(maxSize(sizes, SIZEOF(sizes)), 50),
-  nullHandler_(mgr), docName_(docName)
+  nullHandler_(mgr), docName_(docName), linkAttributes_(NULL)
 {
   eventHandler_ = director.arcEventHandler(notation, docName, table);
   if (!eventHandler_)
@@ -544,7 +544,7 @@ void ArcEngineImpl::initMessage(Message &msg)
 
 ArcProcessor::ArcProcessor()
 : errorIdref_(1), notationSetArch_(0), docHandler_(0), arcAuto_(1),
-  arcDtdIsParam_(0)
+  arcDtdIsParam_(0), valid_(false), mgr_(NULL), director_(NULL), docIndex_(0)
 {
 }
 
@@ -1817,6 +1817,7 @@ ArcProcessor::MetaMapCache::MetaMapCache()
   for (int i = 0; i < nNoSpec; i++)
     noSpec[i] = invalidAtt;
   linkAtts = 0;
+  suppressFlags = 0;
 }
 
 void ArcProcessor::MetaMapCache::clear()
@@ -1828,7 +1829,7 @@ void ArcProcessor::MetaMapCache::clear()
 }
 
 ArcProcessor::MetaMap::MetaMap()
-: attributed(0)
+: attributed(0), suppressFlags(0)
 {
 }
 
index 9471b1287cdc4ab485c33a774813544f5ec36d90..de5d6544ed3c96f9c7c5a3974514451f1fecd16d 100644 (file)
@@ -1069,7 +1069,7 @@ AttributeList::AttributeList(const ConstPtr<AttributeDefinitionList> &def)
 }
 
 AttributeList::AttributeList()
-: nSpec_(0), conref_(0)
+: nSpec_(0), conref_(0), nIdrefs_(0), nEntityNames_(0)
 {
 }
 
index ba626f895b59a85d69bd0824ecd941f979d7bc99..b4429d241d0bf2a8a08f5719b7c4ff1b5297cd2d 100644 (file)
@@ -38,6 +38,10 @@ namespace SP_NAMESPACE {
 #endif
 
 CharsetDeclRange::CharsetDeclRange()
+: descMin_(0),
+  count_(0),
+  type_(unused),
+  baseMin_(0)
 {
 }
 
@@ -53,8 +57,8 @@ CharsetDeclRange::CharsetDeclRange(WideChar descMin, Number count,
 CharsetDeclRange::CharsetDeclRange(WideChar descMin, Number count)
 : descMin_(descMin),
   count_(count),
-  type_(unused)
-     
+  type_(unused),
+  baseMin_(0)
 {
 }
 
@@ -63,7 +67,8 @@ CharsetDeclRange::CharsetDeclRange(WideChar descMin, Number count,
 : descMin_(descMin),
   count_(count),
   type_(string),
-  str_(str)
+  str_(str),
+  baseMin_(0)
 {
 }
 
index cd85cfa7c3687cb027f1527f37fd9b7fa5a87657..996c84c6eae8981535cdba0b1736551754c6250e 100644 (file)
@@ -45,7 +45,11 @@ typedef IListIter<OpenElement> Dummy_IListIter_OpenElement;
 #endif
 
 ContentState::ContentState()
-: documentElementContainer_(StringC(), size_t(-1))
+: documentElementContainer_(StringC(), size_t(-1)),
+totalExcludeCount_(0),
+tagLevel_(0),
+netEnablingCount_(0),
+lastEndedElementType_(NULL)
 {
 }
 
index 2d95b2ce47437712238c0ccbee11403278f7cc45..86b5b93e98844347179511ba211560d5b5dcfdda 100644 (file)
@@ -42,7 +42,8 @@ namespace SP_NAMESPACE {
 
 AndModelGroup::AndModelGroup(NCVector<Owner<ContentToken> > &v,
                             ContentToken::OccurrenceIndicator oi)
-: ModelGroup(v, oi)
+: ModelGroup(v, oi), andDepth_(0), andIndex_(0), andGroupIndex_(0),
+  andAncestor_(NULL)
 {
 }
 
@@ -108,7 +109,8 @@ ElementToken::ElementToken(const ElementType *element, OccurrenceIndicator oi)
 }
 
 ContentToken::ContentToken(OccurrenceIndicator oi)
-: occurrenceIndicator_(oi)
+: occurrenceIndicator_(oi),
+inherentlyOptional_(0)
 {
 }
 
@@ -134,7 +136,8 @@ const LeafContentToken *ContentToken::asLeafContentToken() const
 LeafContentToken::LeafContentToken(const ElementType *element,
                                   OccurrenceIndicator oi)
 : element_(element), ContentToken(oi), isFinal_(0), orGroupMember_(0),
-  requiredIndex_(size_t(-1))
+  requiredIndex_(size_t(-1)), leafIndex_(0), typeIndex_(0), pcdataTransitionType_(0),
+  simplePcdataTransition_(NULL)
 {
 }
 
@@ -211,7 +214,7 @@ GroupInfo::GroupInfo(size_t nType)
 }
 
 CompiledModelGroup::CompiledModelGroup(Owner<ModelGroup> &modelGroup)
-: modelGroup_(modelGroup.extract())
+: modelGroup_(modelGroup.extract()), andStateSize_(0), containsPcdata_(false)
 {
 }
 
@@ -611,7 +614,7 @@ void AndState::clearFrom1(unsigned i)
 }
 
 MatchState::MatchState()
-: andState_(0)
+: andState_(0), pos_(NULL), minAndDepth_(0)
 {
 }
 
index ec46575e754bec8d8b86fdc2b2da4b4a4254ca31..01d8188537e753d4869852e24598eda1059e8a5d 100644 (file)
@@ -208,7 +208,7 @@ class AndState;
 
 class SP_API AndInfo {
 public:
-  AndInfo() { }
+  AndInfo() : andAncestor(NULL), andGroupIndex(0) { }
   const AndModelGroup *andAncestor;
   unsigned andGroupIndex;
   Vector<Transition> follow;
index cc0a9de98dc567c600ce247e7f11c6774733cd4d..7425b306062d8364560a88ade4c4826861bbbbee 100644 (file)
@@ -500,7 +500,11 @@ ExternalInputSource::ExternalInputSource(ParsedSystemId &parsedSysid,
 : InputSource(origin, 0, 0),
   mayRewind_(mayRewind),
   mayNotExist_(mayNotExist),
-  sov_(parsedSysid.size())
+  sov_(parsedSysid.size()),
+  readSize_(0),
+  decoder_(NULL),
+  recordType_(unknown),
+  zapEof_(false)
 {
   init();
   info_ = new ExternalInfoImpl(parsedSysid);
@@ -921,8 +925,11 @@ ExternalInfoImpl::ExternalInfoImpl(ParsedSystemId &parsedSysid)
 : currentIndex_(0), position_(parsedSysid.size())
 {
   parsedSysid.swap(parsedSysid_);
-  if (parsedSysid_.size() > 0)
+  if (parsedSysid_.size() > 0) {
     notrack_ = parsedSysid_[0].notrack;
+  } else {
+    notrack_ = false;
+  }
 }
 
 StringC &ExternalInfoImpl::id(size_t i)
index 56ed885b33b79f36ccb0eb625c847ff5f107e172..78349a55a736ef1fe328792719e7c0742e86e97d 100644 (file)
@@ -61,7 +61,7 @@ void ExternalId::setLocation(const Location &loc)
 }
 
 PublicId::PublicId()
-: formal_(0)
+: formal_(0), ownerType_(ISO), textClass_(CAPACITY), unavailable_(false), haveDisplayVersion_(false)
 {
 }
 
index d4983c8a8a36ab2707870846c03a5adbec3fa02e..cd5f0d3ea3fe68d0a8e88e60e91a10def2e99637 100644 (file)
@@ -44,7 +44,7 @@ namespace SP_NAMESPACE {
 
 class GroupToken {
 public:
-  GroupToken() { }
+  GroupToken() : type(invalid) { }
   enum Type {
     invalid,
     nameToken,
index c13f8ea99d796c1a191dcb547c662251c240dd90..666d7885f19f114220752d6494724ab93ed3b9bd 100644 (file)
@@ -38,7 +38,8 @@ namespace SP_NAMESPACE {
 InputSource::InputSource(InputSourceOrigin *origin, const Char *start,
                         const Char *end)
 : origin_(origin), start_(start), end_(end), cur_(start), accessError_(0),
-  startLocation_(origin, 0), multicode_(0), scanSuppress_(0)
+  startLocation_(origin, 0), multicode_(0), scanSuppress_(0),
+  scanSuppressSingle_(false), scanSuppressIndex_(0)
 {
 }
 
index aad193405114083b087234dd05d307ccc5d1180e..1a0c78378fa5173147d334affb92da3771f1a4a2 100644 (file)
@@ -35,6 +35,7 @@ namespace SP_NAMESPACE {
 #endif
 
 Location::Location()
+: index_(0)
 {
 }
 
@@ -272,6 +273,7 @@ ExternalInfo::~ExternalInfo()
 RTTI_DEF0(ExternalInfo)
 
 NamedCharRef::NamedCharRef()
+: refStartIndex_(0), refEndType_(endOmitted)
 {
 }
 
index 607d37e07ab185bee49c28d31fb1a93147fc0ce8..54bb0990f038f19f6717f57f42f2e2f07ffaa954 100644 (file)
@@ -45,7 +45,8 @@ MessageFragment::MessageFragment(unsigned module, unsigned number, const char *
 #ifndef SP_NO_MESSAGE_TEXT
   text_(text),
 #endif
-  number_(number)
+  number_(number),
+  spare_(0)
 {
 }
 
@@ -124,11 +125,12 @@ OpenElementInfo::OpenElementInfo()
 }
 
 Message::Message()
+: type(NULL)
 {
 }
 
 Message::Message(int nArgs)
-: args(nArgs)
+: args(nArgs), type(NULL)
 {
 }
 
index 20f444fc0c817f1da89ff806758cca5bd7834217..a8fa09f9d353594df1fe1b853d935f5631848811 100644 (file)
@@ -94,7 +94,7 @@ OutputCharStream &OutputCharStream::operator<<(int n)
 
 
 IosOutputCharStream::IosOutputCharStream()
-: buf_(0), byteStream_(0)
+: buf_(0), byteStream_(0), encoder_(NULL)
 {
 }
 
index c3d2348a0d51c8323743baafbd1409f4591b710f..8e51f2c7df4910ec30a9098e3c81edaaf9ed8f62 100644 (file)
@@ -37,6 +37,7 @@ namespace SP_NAMESPACE {
 #endif
 
 OutputState::OutputState()
+: re_(0)
 {
   init();
 }
@@ -49,7 +50,7 @@ void OutputState::init()
 }
 
 OutputStateLevel::OutputStateLevel()
-: state(OutputState::afterStartTag)
+: state(OutputState::afterStartTag), reSerial(0)
 {
 }
 
index 37887a36b3e7fe33695eebf4d2ec08b9e225c605..3d55a56854c5f641344463762b9341dd45b8b52b 100644 (file)
@@ -53,7 +53,7 @@ class ElementType;
 
 class Param {
 public:
-  Param() { }
+  Param() : type(invalid), lita(false) { }
   typedef unsigned char Type;
   enum {
     invalid,
index 55a39bd3bbd2e1da92399e171f77cdc349bc58dd..e8f23950d7836162b3c85257f4f33f4872581023 100644 (file)
@@ -97,7 +97,10 @@ ParserState::ParserState(const Ptr<EntityManager> &em,
   currentMarkup_(0),
   cancelPtr_(&dummyCancel_),
   finalPhase_(finalPhase),
-  hadAfdrDecl_(0)
+  hadAfdrDecl_(0),
+  pass2StartOffset_(0),
+  phase_(noPhase),
+  specialParseMode_()
 {
 }
 
index 00d520cc1b9bce9e7615986a9f119d5b97d9e999..513b1dfbcd8d0440aa95c05645f83f9fac2b6371 100644 (file)
@@ -108,7 +108,8 @@ private:
 
 PosixBaseStorageObject::PosixBaseStorageObject(int fd, Boolean mayRewind)
 : fd_(fd), eof_(0),
-  RewindStorageObject(mayRewind, mayRewind && canSeek(fd))
+  RewindStorageObject(mayRewind, mayRewind && canSeek(fd)),
+  startOffset_(0)
 {
 }
 
@@ -391,7 +392,10 @@ PosixStorageObject::PosixStorageObject(int fd,
   PosixBaseStorageObject(fd, mayRewind),
   suspended_(0),
   filename_(filename),
-  cfilename_(cfilename)
+  cfilename_(cfilename),
+  suspendPos_(0),
+  suspendFailedMessage_(NULL),
+  suspendErrno_(0)
 {
 }
 
index 679690556c80003c8b58f80dfccc0958fe6806de..3522ebdd182558bb0eb06d51040e201012785d06 100644 (file)
@@ -38,7 +38,8 @@ namespace SP_NAMESPACE {
 
 RewindStorageObject::RewindStorageObject(Boolean mayRewind, Boolean canSeek)
 : mayRewind_(mayRewind), canSeek_(canSeek),
-  savingBytes_(mayRewind && canSeek), readingSaved_(0)
+  savingBytes_(mayRewind && canSeek), readingSaved_(0),
+  nBytesRead_(0)
 {
 }
 
index 3f6f86b30ae4450b0166f1e484e1f74713756559..718140eba8cd20ca170228b268debeac74d7087a 100644 (file)
@@ -400,7 +400,7 @@ void SOCatalogManagerImpl::addCatalogsForDocument(CatalogParser &parser,
 
 SOEntityCatalog::SOEntityCatalog(Ptr<ExtendEntityManager> em)
 : em_(em), catalogNumber_(0), haveSgmlDecl_(0), haveDocument_(0),
-  haveCurrentBase_(0)
+  haveCurrentBase_(0), sgmlDeclBaseNumber_(0), documentBaseNumber_(0)
 {
 }
 
index ba2d5a67256a9ed3e48ca38aba4064050eb894a3..848dcb991b12efb8658448158be2e33c0f796581 100644 (file)
@@ -35,6 +35,7 @@ namespace SP_NAMESPACE {
 #endif
 
 SdText::SdText()
+: lita_(false)
 {
 }
 
@@ -78,6 +79,7 @@ Location SdText::endDelimLocation() const
 }
 
 SdTextItem::SdTextItem()
+: index(0)
 {
 }
 
index 77abf02229f89c8b184a5afe5c53be8cbbc90e32..9231334523e27c54b5dda4887919520cc204cf13 100644 (file)
@@ -102,7 +102,7 @@ SgmlsEventHandler::SgmlsEventHandler(const SgmlParser *parser,
   outputId_((outputFlags & outputId) != 0),
   outputNotationSysid_((outputFlags & outputNotationSysid) != 0),
   outputIncluded_((outputFlags & outputIncluded) != 0),
-  haveData_(0), lastSos_(0)
+  haveData_(0), lastSos_(0), lastLineno_(0)
 {
   os_->setEscaper(escape);
 }
index a1434e2d7ede7ffc218dcb64867c7af1eab707fb..6b941b2d40193388322ced719264762891ab1241 100644 (file)
@@ -41,7 +41,7 @@ ShortReferenceMap::ShortReferenceMap()
 }
 
 ShortReferenceMap::ShortReferenceMap(const StringC &name)
-: Named(name)
+: Named(name), used_(false)
 {
 }
 
index f5a64622bbd18fe50674a9fe5c594ecc6db6606d..205963885b402ec4e4b9ab24a822301bcb0a2ee4 100644 (file)
@@ -64,7 +64,9 @@ Syntax::Syntax(const Sd &sd)
   categoryTable_(otherCategory),
   shuncharControls_(0),
   multicode_(0),
-  markupScanTable_(MarkupScan::normal)
+  markupScanTable_(MarkupScan::normal),
+  namecaseGeneral_(false),
+  namecaseEntity_(false)
 {
   static const char lcletter[] = "abcdefghijklmnopqrstuvwxyz";
   static const char ucletter[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
index 37f3aad209fecd2131ff5b6342f16a6dfbc6518e..54cd2041b01b87d69f554559a2f2a2dc6d4c9ceb 100644 (file)
@@ -248,6 +248,7 @@ Boolean Text::delimType(Boolean &lita) const
 }
 
 TextItem::TextItem()
+: type(data), c(0), index(0)
 {
 }
 
index 0e026f2b6c7471b9259c9d7ca8c2a0a545fb7944..c6b1bb6e992813efd3178fecc633ae23783f59e3 100644 (file)
@@ -42,7 +42,7 @@ class BlankTrie;
 
 class Trie {
 public:
-  Trie() : next_(0), nCodes_(0) { }
+  Trie() : next_(0), nCodes_(0), token_(0), tokenLength_(0), priority_(Priority::data) { }
   Trie(const Trie &);
   ~Trie();
   Trie &operator=(const Trie &);
@@ -66,7 +66,7 @@ private:
 
 class BlankTrie : public Trie {
 public:
-  BlankTrie() { }
+  BlankTrie() : additionalLength_(0), maxBlanksToScan_(0) { }
   Boolean codeIsBlank(EquivCode c) const { return codeIsBlank_[c]; }
   // maximum number of blanks to scan (minimum is 0)
   size_t maxBlanksToScan() const { return maxBlanksToScan_; }