1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

nsgmls: resolve coverity warnings related to uninitialed members in C++ classes

This commit is contained in:
Peter Howkins 2018-04-20 01:00:01 +01:00
parent 6e7e9d91e1
commit 3464e80165
25 changed files with 73 additions and 34 deletions

View 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)
{
}

View 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)
{
}

View 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)
{
}

View 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)
{
}

View 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)
{
}

View 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;

View 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)

View 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)
{
}

View file

@ -44,7 +44,7 @@ namespace SP_NAMESPACE {
class GroupToken {
public:
GroupToken() { }
GroupToken() : type(invalid) { }
enum Type {
invalid,
nameToken,

View 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)
{
}

View 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)
{
}

View 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)
{
}

View file

@ -94,7 +94,7 @@ OutputCharStream &OutputCharStream::operator<<(int n)
IosOutputCharStream::IosOutputCharStream()
: buf_(0), byteStream_(0)
: buf_(0), byteStream_(0), encoder_(NULL)
{
}

View 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)
{
}

View file

@ -53,7 +53,7 @@ class ElementType;
class Param {
public:
Param() { }
Param() : type(invalid), lita(false) { }
typedef unsigned char Type;
enum {
invalid,

View 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_()
{
}

View 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)
{
}

View 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)
{
}

View 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)
{
}

View 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)
{
}

View 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);
}

View file

@ -41,7 +41,7 @@ ShortReferenceMap::ShortReferenceMap()
}
ShortReferenceMap::ShortReferenceMap(const StringC &name)
: Named(name)
: Named(name), used_(false)
{
}

View 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";

View file

@ -248,6 +248,7 @@ Boolean Text::delimType(Boolean &lita) const
}
TextItem::TextItem()
: type(data), c(0), index(0)
{
}

View 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_; }