Просмотр исходного кода

More fixes from running cppcheck

As well as cosmetic changes, there were two potential bugs.
- Dereferencing an array by a char in the qstring code
- Using a length instead of asize for a utf8 filter string (fileview)

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 13 лет назад
Родитель
Сommit
af7a27ce3d

+ 1 - 0
common/fileview2/fvdisksource.cpp

@@ -588,6 +588,7 @@ IndirectDiskDataSource::IndirectDiskDataSource(const char * _logicalName, IHqlEx
     username.set(_username);
     password.set(_password);
     extraFieldsSize = sizeof(offset_t) + sizeof(unsigned short);
+    totalSize = 0;
 }
 
 IndirectDiskDataSource::~IndirectDiskDataSource()

+ 1 - 2
common/fileview2/fvrelate.ipp

@@ -31,7 +31,6 @@ typedef IArrayOf<ViewFile> ViewFileArray;
 typedef CIArrayOf<ViewRelation> ViewRelationArray;
 typedef CopyCIArrayOf<ViewFile> ViewFileCopyArray;
 typedef CopyCIArrayOf<ViewRelation> ViewRelationCopyArray;
-typedef ICopyArrayOf<IAtom> AtomArray;
 
 //---------------------------------------------------------------------------
 
@@ -330,7 +329,7 @@ interface IErDiagramBuilder
 class FILEVIEW_API ViewERdiagramVisitor : public IViewFileWebVisitor, public ISchemaBuilder
 {
 public:
-    ViewERdiagramVisitor(IErDiagramBuilder & _builder) : builder(_builder) {}
+    ViewERdiagramVisitor(IErDiagramBuilder & _builder) : builder(_builder) { activeFieldCount = 0; }
 
 // IViewFileWebVisitor
     virtual void visit(ViewFile * file);

+ 6 - 2
common/fileview2/fvresultset.cpp

@@ -2215,6 +2215,9 @@ void buildCursorIndex(unsigned & numElements, unsigned * & elements, CResultSetC
 
 CResultSetSortedCursor::CResultSetSortedCursor(const CResultSetMetaData & _meta, IExtendedNewResultSet * _resultSet, unsigned _column, bool _desc) : CResultSetCursor(_meta, _resultSet, false)
 {
+    numEntries = 0;
+    elements = NULL;
+    lastRow = 0;
     column = _column;
     desc = _desc;
     buildIndex();
@@ -2222,6 +2225,9 @@ CResultSetSortedCursor::CResultSetSortedCursor(const CResultSetMetaData & _meta,
 
 CResultSetSortedCursor::CResultSetSortedCursor(const CResultSetMetaData & _meta, IExtendedNewResultSet * _resultSet, unsigned _column, bool _desc, MemoryBuffer & buffer) : CResultSetCursor(_meta, _resultSet, false)
 { 
+    numEntries = 0;
+    elements = NULL;
+    lastRow = 0;
     column = _column;
     desc = _desc;
     buildIndex();
@@ -2670,7 +2676,6 @@ __int64 CFilteredResultSet::translateRow(__int64 row)
             nextPos = validPositions.tos()+1;
 
         MemoryBuffer tempBuffer;
-        unsigned numSkipped = 0;
         unsigned startTime = msTick();
         while (row >= validPositions.ordinality())
         {
@@ -2682,7 +2687,6 @@ __int64 CFilteredResultSet::translateRow(__int64 row)
             if (rowMatchesFilter((byte *)tempBuffer.toByteArray()))
             {
                 validPositions.append(nextPos);
-                numSkipped = 0;
             }
             else
             {

+ 1 - 2
common/fileview2/fvresultset.ipp

@@ -183,7 +183,6 @@ protected:
     CResultSetMetaData  meta;
     Linked<IFvDataSource> dataSource;
     BoolArray mappedFields;
-    __int64 numRows;
     CriticalSection cs;
 };
 
@@ -193,7 +192,7 @@ class CColumnFilter : public CInterface
 public:
     CColumnFilter(unsigned _whichColumn, ITypeInfo * _type, bool _isMappedIndexField)
         : whichColumn(_whichColumn)
-    { type.set(_type); optimized = false; isMappedIndexField = _isMappedIndexField; }
+    { type.set(_type); optimized = false; isMappedIndexField = _isMappedIndexField; subLen = 0; }
 
     void addValue(unsigned lenText, const char * value);
 

+ 2 - 0
common/fileview2/fvsource.cpp

@@ -524,12 +524,14 @@ RowBlock::RowBlock(MemoryBuffer & _buffer, __int64 _start, __int64 _startOffset)
     buffer.swapWith(_buffer);
     start = _start;
     startOffset = _startOffset;
+    numRows = 0;
 }
 
 RowBlock::RowBlock(__int64 _start, __int64 _startOffset)
 {
     start = _start;
     startOffset = _startOffset;
+    numRows = 0;
 }
 
 void RowBlock::getNextStoredOffset(__int64 & row, offset_t & offset)

+ 8 - 2
common/fileview2/fvtransform.cpp

@@ -140,7 +140,7 @@ void ViewFieldTransformer::transform(MemoryAttr & utfTarget, const MemoryAttr &
     transform(lenTarget, target, lenSource, source);
 
     unsigned sizeTarget = rtlUtf8Size(lenTarget, target);
-    utfTarget.setOwn(lenTarget, target);
+    utfTarget.setOwn(sizeTarget, target);
 }
 
 
@@ -553,7 +553,13 @@ class MappingParser
 {
     enum { TokEof=256, TokId, TokInt, TokString };
 public:
-    MappingParser(const IResultSetMetaData & _fieldMeta, bool _datasetSelectorAllowed) : fieldMeta(_fieldMeta), datasetSelectorAllowed(_datasetSelectorAllowed) {}
+    MappingParser(const IResultSetMetaData & _fieldMeta, bool _datasetSelectorAllowed) : fieldMeta(_fieldMeta), datasetSelectorAllowed(_datasetSelectorAllowed)
+    {
+        tokenType = TokEof;
+        lenInput = 0;
+        input = NULL;
+        offset = 0;
+    }
 
     void parseColumnMappingList(FieldTransformInfoArray & results, unsigned len, const char * text);
 

+ 0 - 1
common/fileview2/fvtransform.ipp

@@ -224,7 +224,6 @@ protected:
 
 //---------------------------------------------------------------------------
 
-typedef CIArrayOf<ViewFieldTransformer> ViewFieldTransformerArray;
 void translateValue(MemoryAttr & result, const MemoryAttr & value, const ViewFieldTransformerArray & transforms);
 
 bool containsFail(const ViewFieldTransformerArray & transforms);

+ 0 - 1
common/fileview2/fvwugen.cpp

@@ -205,7 +205,6 @@ IHqlExpression * PositionTransformer::createTransformed(IHqlExpression * _expr)
             if (grouping && (grouping->getOperator() != no_attr))
                 fail();
             IHqlExpression * record = transformed->queryRecord();
-            unsigned max = record->numChildren();
             HqlExprArray fields;
             unwindChildren(fields, transformed->queryChild(1));
             ForEachChild(idx, record)

+ 2 - 3
common/remote/rmtsmtp.cpp

@@ -28,7 +28,7 @@
 class CSMTPValidator
 {
 public:
-    CSMTPValidator() : scanlist(false) {}
+    CSMTPValidator() : scanlist(false), value(NULL), finger(NULL), label(NULL) {}
 
     void validateValue(char const * _value, char const * _label)
     {
@@ -360,7 +360,6 @@ private:
     char const * finger;
     char const * label;
     bool scanlist;
-    bool scanmore;
 };
 
 // escapes text for mail transfer, returns true if quoted-printable encoding was required
@@ -487,7 +486,7 @@ class CMailInfo
     static char const * senderHeader;
 public:
     CMailInfo(char const * _to, char const * _subject, char const * _mailServer, unsigned _port, char const * _sender, StringArray *_warnings) 
-        : subject(_subject), mailServer(_mailServer), port(_port), sender(_sender), lastAction("process initialization")
+        : subject(_subject), mailServer(_mailServer), port(_port), sender(_sender), lastAction("process initialization"), inlen(0)
     {
         warnings = _warnings;
         CSMTPValidator validator;

+ 3 - 2
common/remote/rmtspawn.cpp

@@ -252,6 +252,9 @@ ISocket * spawnRemoteChild(SpawnKind kind, const char * exe, const SocketEndpoin
 
 CRemoteParentInfo::CRemoteParentInfo()
 {
+    replyTag = 0;
+    kind = SPAWNlast;
+    port = 0;
 }
 
 
@@ -311,7 +314,6 @@ bool CRemoteParentInfo::sendReply(unsigned version)
                         readBuffer(connect, buffer.clear());
                         buffer.read(connectVersion);
                         bool same = false;
-                        unsigned replyVersion = version;
                         IpAddress masterIP;
                         masterIP.ipdeserialize(buffer);
                         buffer.read(connectKind);
@@ -332,7 +334,6 @@ bool CRemoteParentInfo::sendReply(unsigned version)
                             if (connectKind != kind)
                             {
                                 LOG(MCdebugInfo(1000), unknownJob, "Connection for wrong slave kind (%u vs %u)- ignore", connectKind, kind);
-                                replyVersion = connectVersion;
                             }
                         }
 

+ 1 - 0
common/remote/rmtssh.cpp

@@ -177,6 +177,7 @@ public:
         strict = false;
         verbose = false;
         dryrun = false;
+        useplink = false;
         replicationoffset = 0;
     }
 

+ 3 - 1
common/remote/sockfile.cpp

@@ -1288,9 +1288,12 @@ public:
         // an extended difference iterator starts with 2 (for bwd compatibility)
         ep = _ep;
         curisdir = false;
+        curvalid = false;
         cursize = 0;
         curidx = (unsigned)-1;
         mask = 0;
+        numflags = 0;
+        flags = NULL;
     }
 
     bool appendBuf(MemoryBuffer &_buf)
@@ -3341,7 +3344,6 @@ public:
         msg.read(name->text).read(mode).read(share);  
         try {
             Owned<IFile> file = createIFile(name->text);
-            unsigned smode = 0;
             switch ((compatIFSHmode)share) {
             case compatIFSHnone:
                 file->setCreateFlags(S_IRUSR|S_IWUSR); 

+ 1 - 3
common/roxiehelper/roxiehelper.cpp

@@ -378,8 +378,6 @@ bool CRHLimitedCompareHelper::getGroup(OwnedRowArray &group, const void *left)
     }
     while (high-low>(int)atmost) 
     {
-        CRHRollingCacheElem *rl = cache->mid(low);
-        CRHRollingCacheElem *rh = cache->mid(high-1);
         int vl = iabs(cache->mid(low)->cmp);
         int vh = iabs(cache->mid(high-1)->cmp);
         int v;
@@ -852,7 +850,7 @@ void FlushingStringBuffer::append(unsigned len, const char *data)
     catch (IException *E)
     {
         logctx.logOperatorException(E, __FILE__, __LINE__, NULL);
-        throw E;
+        throw;
     }
 }
 

+ 3 - 0
common/thorhelper/csvsplitter.cpp

@@ -34,6 +34,8 @@ CSVSplitter::CSVSplitter()
     data = NULL;
     numQuotes = 0;
     unquotedBuffer = NULL;
+    maxColumns = 0;
+    curUnquoted = NULL;
 }
 
 CSVSplitter::~CSVSplitter()
@@ -72,6 +74,7 @@ void CSVSplitter::reset()
     data = NULL;
     numQuotes = 0;
     unquotedBuffer = NULL;
+    maxCsvSize = 0;
 }
 
 void CSVSplitter::init(unsigned _maxColumns, ICsvParameters * csvInfo, const char * dfsQuotes, const char * dfsSeparators, const char * dfsTerminators)

+ 3 - 2
common/thorhelper/thorcommon.cpp

@@ -367,6 +367,8 @@ CStreamMerger::CStreamMerger(bool _pullConsumes)
     dedup = false;
     activeInputs = 0;
     pullConsumes = _pullConsumes;
+    numInputs = 0;
+    first = true;
 }
 
 CStreamMerger::~CStreamMerger()
@@ -1414,9 +1416,9 @@ public:
     void putRow(const void *row)
     {
         if (row) {
-            byte b = 0;
             serializer->serialize(*this,(const byte *)row);
             if (grouped) {
+                byte b = 0;
                 if (bufpos<ROW_WRITER_BUFFERSIZE) 
                     buf[bufpos++] = b;
                 else 
@@ -1538,7 +1540,6 @@ IExtRowWriter *createRowWriter(IFileIOStream *strm,IOutputRowSerializer *seriali
 class CDiskMerger : public CInterface, implements IDiskMerger
 {
     IArrayOf<IFile> tempfiles;
-    unsigned numstrms;
     IRowStream **strms;
     Linked<IRecordSize> irecsize;
     StringAttr tempnamebase;

+ 3 - 3
common/thorhelper/thorcommon.ipp

@@ -46,9 +46,9 @@ public:
     
 private: 
     /* these overloaded operators are the devil of memory leak. Use set, setown instead. */
-    inline OwnedConstRow(const OwnedConstRow & other)   { }
-    void operator = (void * _row)                { }
-    void operator = (const OwnedConstRow & other) { }
+    inline OwnedConstRow(const OwnedConstRow & other)   { row = NULL; }
+    void operator = (void * _row)                { row = NULL; }
+    void operator = (const OwnedConstRow & other) { row = NULL; }
 
     /* this causes -ve memory leak */
     void setown(const OwnedConstRow &other) {  }

+ 9 - 13
common/thorhelper/thorparse.cpp

@@ -141,15 +141,6 @@ NlpMatchPath::~NlpMatchPath()
 void NlpMatchPath::init()
 {
     maxDepth = ids.ordinality();
-    unsigned firstUnbounded = maxDepth;
-    for (unsigned depth=0; depth < maxDepth; depth++)
-    {
-        if (indices.item(depth) == UNKNOWN_INSTANCE)
-        {
-            firstUnbounded = depth;
-            break;
-        }
-    }
     searchIndices = new unsigned[maxDepth];
 }
 
@@ -259,6 +250,7 @@ void CMatchedResultInfo::serialize(MemoryBuffer & out) const
 
 CMatchedResults::CMatchedResults(CMatchedResultInfo * _def)
 {
+    in = NULL;
     def = _def;
     unsigned num = def->matchResults.ordinality();
     matched = new IMatchedElement *[num];
@@ -358,8 +350,8 @@ void CMatchedResults::getMatchText(size32_t & outlen, char * & out, unsigned idx
 void CMatchedResults::getMatchUnicode(size32_t & outlen, UChar * & out, unsigned idx)
 {
     const IMatchedElement * cur = matched[idx];
-    const byte * start = matched[idx]->queryStartPtr(); 
-    size32_t size = (size32_t)(matched[idx]->queryEndPtr() - start);
+    const byte * start = cur->queryStartPtr();
+    size32_t size = (size32_t)(cur->queryEndPtr() - start);
 
     switch (def->inputFormat)
     {
@@ -383,8 +375,8 @@ void CMatchedResults::getMatchUnicode(size32_t & outlen, UChar * & out, unsigned
 void CMatchedResults::getMatchUtf8(size32_t & outlen, char * & out, unsigned idx)
 {
     const IMatchedElement * cur = matched[idx];
-    const byte * start = matched[idx]->queryStartPtr(); 
-    size32_t size = (size32_t)(matched[idx]->queryEndPtr() - start);
+    const byte * start = cur->queryStartPtr();
+    size32_t size = (size32_t)(cur->queryEndPtr() - start);
 
     switch (def->inputFormat)
     {
@@ -633,6 +625,10 @@ NlpAlgorithm::NlpAlgorithm(CMatchedResultInfo * _matched)
     chooseMax = false;
     chooseBest = false;
     singleChoicePerLine = false;
+    inputFormat = NlpAscii;
+    keepLimit = UINT_MAX;
+    atMostLimit = UINT_MAX;
+    charWidth = sizeof(char);
 }
 
 NlpAlgorithm::~NlpAlgorithm()

+ 1 - 0
common/thorhelper/thorpipe.cpp

@@ -157,6 +157,7 @@ public:
         : CBufferedReadRowStream(_rowAllocator), csvTransformer(_csvTransformer)
     {
         ICsvParameters * csvInfo = csvTransformer->queryCsvParameters();
+        //MORE: This value is never used.  Should it be asserting(headerLines == 0)
         unsigned int headerLines = csvInfo->queryHeaderLen();
         size32_t max = csvInfo->queryMaxSize();
 

+ 0 - 1
common/thorhelper/thorrparse.cpp

@@ -1159,7 +1159,6 @@ void RegexUtf8IPattern::toXMLattr(StringBuffer & out, RegexXmlState & state)
 
 inline bool RegexUtf8IPattern::doMatch(RegexState & state)
 {
-    const byte * start = state.cur;
     const byte * end = state.end;
 
     unsigned size = lower.length();

+ 4 - 4
common/thorhelper/thorsoapcall.cpp

@@ -104,7 +104,7 @@ public:
             return MakeStringExceptionDirect(e->errorCode(), text.str());
     }
 
-    Url()
+    Url() : port(0)
     {
     }
 
@@ -469,7 +469,7 @@ MODULE_EXIT()
 class ColumnProvider : public CInterface, public IColumnProvider
 {
 public:
-    ColumnProvider(unsigned _callLatencyMs) : callLatencyMs(_callLatencyMs) {}
+    ColumnProvider(unsigned _callLatencyMs) : callLatencyMs(_callLatencyMs), base(NULL) {}
     IMPLEMENT_IINTERFACE;
     virtual bool        getBool(const char * path) { return base->getBool(path); }
     virtual void        getData(size32_t len, void * text, const char * path) { base->getData(len, text, path); }
@@ -1751,7 +1751,7 @@ public:
                     {
                         StringBuffer s;
                         master->logctx.CTXLOG("%sCALL exiting: Roxie Abort : %s",master->wscType == STsoap ? "SOAP" : "HTTP",e->errorMessage(s).str());
-                        throw e;
+                        throw;
                     }
 
                     do 
@@ -1848,7 +1848,7 @@ public:
                 {
                     StringBuffer s;
                     master->logctx.CTXLOG("%sCALL exiting: Roxie Abort : %s",master->wscType == STsoap ? "SOAP" : "HTTP",e->errorMessage(s).str());
-                    throw e;
+                    throw;
                 }
 
                 // other IException ... retry up to maxRetries

+ 22 - 1
common/thorhelper/thorstep.cpp

@@ -55,7 +55,6 @@ unsigned getNumMatchingFields(ISteppingMeta * inputStepping, ISteppingMeta * cal
     if (inputStepping && callerStepping)
     {
         //Determine where the stepping fields overlap, and work out the extent.
-        unsigned parentCount = callerStepping->getNumFields();
         unsigned inputCount = inputStepping->getNumFields();
         for (unsigned i=0; i < inputCount; i++)
         {
@@ -603,6 +602,15 @@ void CFilteredInputBuffer::reset()
 
 CFilteredSteppedMerger::CFilteredSteppedMerger()
 {
+    matches = NULL;
+    joinKind = 0;
+    numInputs = 0;
+    equalCompare = NULL;
+    extraCompare = NULL;
+    globalCompare = NULL;
+    minMatches = 0;
+    maxMatches = 0;
+    fullyMatchedLevel = 0;
 }
 
 CFilteredSteppedMerger::~CFilteredSteppedMerger()
@@ -854,6 +862,8 @@ CMergeJoinProcessor::CMergeJoinProcessor(IHThorNWayMergeJoinArg & _arg) : helper
     combineConjunctions = true;
     allInputsAreOuterInputs = false;
     maxSeekRecordSize = 0;
+    numInputs = 0;
+    eof = true;
 
     assertex(helper.numOrderFields() == mergeSteppingMeta->getNumFields());
     bool hasPostfilter = false;
@@ -1528,6 +1538,9 @@ CMofNMergeJoinProcessor::CMofNMergeJoinProcessor(IHThorNWayMergeJoinArg & _arg)
     combineConjunctions = false;
     alive = NULL;
     candidateMask = NULL;
+    minMatches = 0;
+    maxMatches = 0;
+    numActive = 0;
 }
 
 
@@ -1734,6 +1747,11 @@ CNaryJoinLookaheadQueue::CNaryJoinLookaheadQueue(IEngineRowAllocator * _inputAll
     input.set(_input);
     activeRowPtr = _activeRowPtr;
     left = _left;
+    equalityRow = NULL;
+    curRow = 0;
+    maxRow = 0;
+    numSkipped = 0;
+    done = true;
 }
 
 bool CNaryJoinLookaheadQueue::beforeProcessCandidates(const void * _equalityRow, bool needToVerifyNext)
@@ -1971,6 +1989,8 @@ bool CNaryJoinLookaheadQueue::flushUnmatched()
 CProximityJoinProcessor::CProximityJoinProcessor(IHThorNWayMergeJoinArg & _helper) :
     CMergeJoinProcessor(_helper)
 {
+    maxRightBeforeLeft = 0;
+    maxLeftBeforeRight = 0;
 }
 
 void CProximityJoinProcessor::beforeProcessing(IEngineRowAllocator * _inputAllocator, IEngineRowAllocator * _outputAllocator)
@@ -2120,6 +2140,7 @@ unsigned CProximityJoinProcessor::getBestToSeekFrom(unsigned seekInput) const
 CJoinGenerator::CJoinGenerator(IEngineRowAllocator * _inputAllocator, IEngineRowAllocator * _outputAllocator, IHThorNWayMergeJoinArg & _helper, CSteppedInputLookaheadArray & _inputs) : 
     helper(_helper), inputAllocator(_inputAllocator), outputAllocator(_outputAllocator)
 {
+    state = JSdone;
     unsigned flags = helper.getJoinFlags();
     stepCompare = helper.querySteppingMeta()->queryCompare();
     globalCompare = NULL;

+ 20 - 3
common/thorhelper/thorstep.ipp

@@ -70,7 +70,18 @@ interface ISteppedJoinRowGenerator : public IInterface
 class THORHELPER_API CSteppingMeta : public CInterface, implements IInputSteppingMeta
 {
 public:
-    CSteppingMeta() { numFields = 0; fields = NULL; rangeCompare = NULL; distance = NULL; stepFlags = 0; priority = 0; distributed = false; }
+    CSteppingMeta()
+    {
+        numFields = 0;
+        fields = NULL;
+        rangeCompare = NULL;
+        distance = NULL;
+        stepFlags = 0;
+        priority = 0;
+        distributed = false;
+        postFiltered = false;
+        hadStepExtra = false;
+    }
 
     void intersect(IInputSteppingMeta * inputMeta);
     void init(ISteppingMeta * meta, bool _postFiltered)
@@ -301,7 +312,13 @@ protected:
 class THORHELPER_API CSteppedCandidateMerger : public CStreamMerger
 {
 public:
-    CSteppedCandidateMerger(unsigned _numEqualFields) : CStreamMerger(true) { numEqualFields = _numEqualFields; candidateRow = NULL; }
+    CSteppedCandidateMerger(unsigned _numEqualFields) : CStreamMerger(true)
+    {
+        numEqualFields = _numEqualFields;
+        candidateRow = NULL;
+        inputArray = NULL;
+        equalCompare = NULL;
+    }
     ~CSteppedCandidateMerger() { assertex(!candidateRow); }
 
     void init(IEngineRowAllocator * _allocator, ICompare * _equalCompare, ICompare * _mergeCompare, bool _dedup, IRangeCompare * _rangeCompare)
@@ -482,7 +499,7 @@ typedef CIArrayOf<CFilteredInputBuffer> CFilteredInputBufferArray;
 class THORHELPER_API CFilteredMerger : public CStreamMerger
 {
 public:
-    CFilteredMerger() : CStreamMerger(true) {}
+    CFilteredMerger() : CStreamMerger(true) { inputArray = NULL; rowAllocator = NULL; }
 
     void init(IEngineRowAllocator * _allocator, ICompare * _mergeCompare, bool _dedup, IRangeCompare * _rangeCompare)
     {

+ 1 - 0
common/thorhelper/thorstep2.cpp

@@ -239,6 +239,7 @@ CSteppedConjunctionOptimizer::CSteppedConjunctionOptimizer(IEngineRowAllocator *
     inputHasPostfilter = false;
     inputIsDistributed = false;
     eof = false;
+    maxOptimizeInput = 0;
 }
 
 CSteppedConjunctionOptimizer::~CSteppedConjunctionOptimizer()

+ 2 - 2
common/thorhelper/thortalgo.ipp

@@ -65,8 +65,8 @@ public:
 class THORHELPER_API TomitaMatchPath : public NlpMatchPath
 {
 public:
-    TomitaMatchPath(MemoryBuffer & in) : NlpMatchPath(in) {}
-    TomitaMatchPath(const UnsignedArray & _ids, const UnsignedArray & _indices) : NlpMatchPath(_ids, _indices) {}
+    TomitaMatchPath(MemoryBuffer & in) : NlpMatchPath(in) { choices = NULL; }
+    TomitaMatchPath(const UnsignedArray & _ids, const UnsignedArray & _indices) : NlpMatchPath(_ids, _indices) { choices = NULL; }
 
     IMatchedElement * getMatch(GrammarSymbol * top, PackedSymbolChoice & choice);
 

+ 0 - 2
common/thorhelper/thortparse.ipp

@@ -136,8 +136,6 @@ protected:
     bool cachedIsNull;
 };
 
-typedef CIArrayOf<GrammarSymbol> GrammarSymbolArray;
-
 class PackedSymbol : public GrammarSymbol
 {
 public:

+ 2 - 0
common/thorhelper/thorxmlread.cpp

@@ -1632,6 +1632,8 @@ class CXMLParse : public CInterface, implements IXMLParse
         {
             lastMatchKeptLevel = 0;
             lastMatchKeptNode = lastMatchKeptNodeParent = NULL;
+            maker = NULL;
+            utf8Translator = NULL;
         }
         ~CXMLMaker()
         {

+ 0 - 1
common/thorhelper/thorxmlwrite.cpp

@@ -342,7 +342,6 @@ inline void outputEncodedXmlData(unsigned len, const void *_field, const char *f
 
 inline void outputEncoded64XmlData(unsigned len, const void *_field, const char *fieldname, StringBuffer &out)
 {
-    const unsigned char *field = (const unsigned char *) _field;
     if (fieldname)
         out.append('<').append(fieldname).append(" xsi:type=\"xsd:base64Binary\">");
     JBASE64_Encode(_field, len, out, false);

+ 0 - 1
common/thorhelper/thorxmlwrite.hpp

@@ -145,7 +145,6 @@ public:
     void newline();
 protected:
     StringBuffer out;
-    bool csv;
 };
 
 class thorhelper_decl CommonFieldProcessor : public CInterface, implements IFieldProcessor

+ 1 - 2
common/workunit/workunit.cpp

@@ -229,6 +229,7 @@ public:
         rootPath.append("/GraphProgress/").append(wuid).append('/').append(graphName).append('/');
         connected = connectedWrite = false;
         formatVersion = 0;
+        progress = NULL;
     }
     void connect()
     {
@@ -1802,7 +1803,6 @@ mapEnums sortFields[] =
 class asyncRemoveDllWorkItem: public CInterface, implements IWorkQueueItem // class only used in asyncRemoveDll
 {
     StringAttr name;
-    unsigned version;
     bool removeDlls;
     bool removeDirectory;
 public:
@@ -3328,7 +3328,6 @@ void CLocalWorkUnit::remoteCheckAccess(IUserDescriptor *user, bool writeaccess)
                 perm = 0;
         }
     }
-    IDFS_Exception *e = NULL;
     if (!HASREADPERMISSION(perm)) {
         SCMStringBuffer wuid;
         getWuid(wuid);

+ 2 - 1
dali/base/dafdesc.cpp

@@ -314,7 +314,7 @@ void ClusterPartDiskMapSpec::setDefaultReplicateDir(const char *dir)
 }
 
 
-void ClusterPartDiskMapSpec::operator=(const ClusterPartDiskMapSpec &other)
+ClusterPartDiskMapSpec & ClusterPartDiskMapSpec::operator=(const ClusterPartDiskMapSpec &other)
 {
     replicateOffset = other.replicateOffset;
     defaultCopies = other.defaultCopies;
@@ -325,6 +325,7 @@ void ClusterPartDiskMapSpec::operator=(const ClusterPartDiskMapSpec &other)
     repeatedPart = other.repeatedPart;
     setDefaultBaseDir(other.defaultBaseDir);
     setDefaultReplicateDir(other.defaultReplicateDir);
+    return *this;
 }
 
 

+ 1 - 1
dali/base/dafdesc.hpp

@@ -79,7 +79,7 @@ public:
     void deserialize(MemoryBuffer &mb);
     unsigned numCopies(unsigned part,unsigned clusterwidth,unsigned filewidth);
 
-    void operator=(const ClusterPartDiskMapSpec &other);
+    ClusterPartDiskMapSpec & operator=(const ClusterPartDiskMapSpec &other);
 
 };
 

+ 0 - 2
system/jlib/jmisc.hpp

@@ -294,10 +294,8 @@ private:
 
 class NoQuickEditSection
 {
-#ifdef _WIN32
     DWORD savedmode;
     bool saved;
-#endif
 public:
     NoQuickEditSection()
     {