浏览代码

HPCC-21847 Compile Roxie with all warnings as errors

Fix various warnings in Roxie

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 6 年之前
父节点
当前提交
a5587a1afc

+ 1 - 1
common/thorhelper/roxiedebug.cpp

@@ -1382,7 +1382,7 @@ void CBaseServerDebugContext::_continue(WatchState watch)
     }
 }
 
-unsigned CBaseServerDebugContext::checkOption(const char *supplied, const char *name, const char *accepted[])
+unsigned CBaseServerDebugContext::checkOption(const char *supplied, const char *name, const char * const *accepted)
 {
     if (supplied)
     {

+ 5 - 5
common/thorhelper/roxiedebug.hpp

@@ -23,14 +23,14 @@
 #include "jprop.hpp"
 
 // enum BreakpointMode { BreakpointModeNone, BreakpointModeEdge, BreakpointModeNode, BreakpointModeGraph }; in header file
-static const char *BreakpointModes[] = {"none", "edge", "node", "graph", "global", NULL };
+constexpr const char *BreakpointModes[] = {"none", "edge", "node", "graph", "global", NULL };
 // enum BreakpointActionMode { BreakpointActionBreak, BreakpointActionSkip, BreakpointActionLimit, BreakpointActionContinue };
-static const char *BreakpointActionModes[] = {"break", "skip", "limit", "continue", NULL };
+constexpr const char *BreakpointActionModes[] = {"break", "skip", "limit", "continue", NULL };
 enum BreakpointConditionMode { BreakpointConditionNone, BreakpointConditionEquals, BreakpointConditionContains, BreakpointConditionStartsWith, BreakpointConditionLess, 
      BreakpointConditionGreater, BreakpointConditionLessEqual, BreakpointConditionGreaterEqual, BreakpointConditionNotEqual, BreakpointConditionEOG, BreakpointConditionEOF };
-static const char *BreakpointConditionModes[] = {"none", "equals", "contains", "startswith", "<", ">", "<=", ">=", "!=", "eog", "eof", NULL };
+constexpr const char *BreakpointConditionModes[] = {"none", "equals", "contains", "startswith", "<", ">", "<=", ">=", "!=", "eog", "eof", NULL };
 enum BreakpointCountMode { BreakpointCountNone, BreakpointCountEquals, BreakpointCountAtleast };
-static const char *BreakpointCountModes[] = { "none", "equals" , "atleast", NULL };
+constexpr const char *BreakpointCountModes[] = { "none", "equals" , "atleast", NULL };
 
 //=======================================================================================
 
@@ -311,7 +311,7 @@ protected:
     void doStandardResult(IXmlWriter *output) const;
     void _listBreakpoint(IXmlWriter *output, IBreakpointInfo &bp, unsigned idx) const;
     void _continue(WatchState watch) ;
-    static unsigned checkOption(const char *supplied, const char *name, const char *accepted[]);
+    static unsigned checkOption(const char *supplied, const char *name, const char * const *accepted);
     IBreakpointInfo *createDummyBreakpoint();
     IBreakpointInfo *_createBreakpoint(const char *modeString, const char *id, const char *action=NULL,
                                    const char *fieldName = NULL, const char *condition=NULL, const char *value=NULL, bool caseSensitive=false,

+ 1 - 1
dali/base/dasess.hpp

@@ -86,7 +86,7 @@ interface IUserDescriptor: extends serializable
 extern da_decl IUserDescriptor *createUserDescriptor();
 extern da_decl IUserDescriptor *createUserDescriptor(MemoryBuffer &mb);
 
-const static IUserDescriptor * unknownUser = NULL;//use of this should be avoided
+constexpr IUserDescriptor * unknownUser = NULL;//use of this should be avoided
 #define UNKNOWN_USER (IUserDescriptor*)unknownUser
 
 interface ISessionNotify: extends IInterface

+ 1 - 1
dali/ft/filecopy.cpp

@@ -3333,7 +3333,7 @@ dfu_operation FileSprayer::getOperation() const
 
 const char * FileSprayer::getOperationTypeString() const
 {
-    return DfuOperatonStr[operation];
+    return DfuOperationStr[operation];
 }
 
 bool FileSprayer::usePullOperation()

+ 3 - 3
dali/ft/filecopy.hpp

@@ -36,7 +36,7 @@ typedef enum
     FFTlast
  } FileFormatType;
 
-static const char * FileFormatTypeStr[] =
+constexpr const char * FileFormatTypeStr[] =
 {       "FFTunknown",
         "FFTfixed", "FFTvariable", "FFTblocked",
         "FFTcsv",
@@ -57,7 +57,7 @@ typedef enum
     FMTlast
  } FileMarkupType;
 
-static const char * FileMarkupTypeStr[] =
+constexpr const char * FileMarkupTypeStr[] =
 {
     "FMTunknown",
     "FMTxml",
@@ -121,7 +121,7 @@ typedef enum {
         dfu_transfer,
     } dfu_operation;
 
-static const char * DfuOperatonStr[] =
+constexpr const char * DfuOperationStr[] =
     {
         "DFUunknown",
         "DFUcopy",

+ 3 - 3
ecl/eclagent/eclgraph.cpp

@@ -1638,9 +1638,9 @@ void EclAgent::executeThorGraph(const char * graphName)
             e->Release();
             throw MakeStringExceptionDirect(-1, s.str());
         }
-        ThorReplyCodes replyCode;
-        reply.read((unsigned &)replyCode);
-        switch (replyCode)
+        unsigned replyCode;
+        reply.read(replyCode);
+        switch ((ThorReplyCodes) replyCode)
         {
             case DAMP_THOR_REPLY_PAUSED:
             {

+ 8 - 3
roxie/ccd/CMakeLists.txt

@@ -92,11 +92,16 @@ include_directories (
          ${HPCC_SOURCE_DIR}/system/libbase58
     )
 
+if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+  SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-switch -Wno-unused-parameter -Werror -Wno-delete-non-virtual-dtor -Wno-overloaded-virtual")
+endif()
+
 ADD_DEFINITIONS( -D_USRDLL -DCCD_EXPORTS -DSTARTQUERY_EXPORTS )
 
-    if (CMAKE_COMPILER_IS_CLANGXX)
-      SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch-enum -Wno-format-security -Werror=reorder")
-    endif()
+if (CMAKE_COMPILER_IS_CLANGXX)
+  SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch-enum -Wno-format-security -Werror=reorder")
+endif()
+
 
 HPCC_ADD_LIBRARY( ccd SHARED ${SRCS} )
 install ( TARGETS ccd RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} ARCHIVE DESTINATION componentfiles/cl/lib )

+ 1 - 1
roxie/ccd/ccdactivities.cpp

@@ -2018,9 +2018,9 @@ public:
                 RecordLengthType *rowLen = (RecordLengthType *) m.readDirect(sizeof(RecordLengthType));
                 if (!*rowLen)
                     break; 
-                RecordLengthType len = *rowLen;
                 RtlDynamicRowBuilder rowBuilder(rowAllocator);
                 size_t outsize = deserializer->deserialize(rowBuilder, rowSource);
+                dbgassertex(outsize==(size_t) *rowLen);
                 if (!finalBuilder.exists())
                     finalBuilder.swapWith(rowBuilder);
                 else

+ 4 - 4
roxie/ccd/ccdcontext.cpp

@@ -2398,9 +2398,9 @@ protected:
                 e->Release();
                 throw MakeStringExceptionDirect(-1, s.str());
             }
-            ThorReplyCodes replyCode;
-            reply.read((unsigned &)replyCode);
-            switch (replyCode)
+            unsigned replyCode;
+            reply.read(replyCode);
+            switch ((ThorReplyCodes) replyCode)
             {
                 case DAMP_THOR_REPLY_PAUSED:
                 {
@@ -2637,7 +2637,7 @@ public:
                 StringBuffer slaveActivityId;
                 slaveInfo.read(slaveActivityId);
                 IActivityDebugContext *slaveActivityCtx = slaveActivityId.length() ? currentGraph->lookupActivityByEdgeId(slaveActivityId.str()) : NULL;
-                BreakpointActionMode action = checkBreakpoint(slaveState, slaveActivityCtx , NULL);
+                checkBreakpoint(slaveState, slaveActivityCtx , NULL);
             }
         }
         MemoryBuffer mb;

+ 4 - 4
roxie/ccd/ccddali.cpp

@@ -321,13 +321,13 @@ private:
             throw MakeStringException(-1,"Logical name %s invalid",destfilename);
 
         StringBuffer dstpartmask;
-        getPartMask(dstpartmask,destfilename,srcfdesc->numParts());
-        dstfdesc->setPartMask(dstpartmask.str());
         unsigned np = srcfdesc->numParts();
-        dstfdesc->setNumParts(srcfdesc->numParts());
+        getPartMask(dstpartmask,destfilename, np);
+        dstfdesc->setPartMask(dstpartmask.str());
+        dstfdesc->setNumParts(np);
         dstfdesc->setDefaultDir(srcfdesc->queryProperties().queryProp("@cloneFromDir"));
 
-        for (unsigned pn=0;pn<srcfdesc->numParts();pn++) {
+        for (unsigned pn=0; pn<np; pn++) {
             offset_t sz = srcfdesc->queryPart(pn)->queryProperties().getPropInt64("@size",-1);
             if (sz!=(offset_t)-1)
                 dstfdesc->queryPart(pn)->queryProperties().setPropInt64("@size",sz);

+ 1 - 1
roxie/ccd/ccddebug.cpp

@@ -1582,7 +1582,7 @@ public:
         if (!edge)
         {
             const char *channelTail = strrchr(edgeId, '#');
-            if (channelTail && atoi(channelTail+1)==channel)
+            if (channelTail && (unsigned) atoi(channelTail+1)==channel)
             {
                 DebugRequestLookupActivityByEdgeId request(proxyId, edgeId);
                 CommonXmlWriter reply(0);

+ 2 - 3
roxie/ccd/ccdfile.cpp

@@ -1775,7 +1775,7 @@ public:
 template <class X> class PerChannelCacheOf
 {
     IPointerArrayOf<X> cache;
-    IntArray channels;
+    UnsignedArray channels;
 public:
     // NOTE - typically only a couple of entries (but see PerFormatCacheOf below
     void set(X *value, unsigned channel)
@@ -1910,7 +1910,7 @@ public:
             if (traceLevel > 5)
                 DBGLOG("Roxie server adding information for file %s", lfn.get());
             bool tsSet = dFile->getModificationTime(fileTimeStamp);
-            bool csSet = dFile->getFileCheckSum(fileCheckSum);
+            dFile->getFileCheckSum(fileCheckSum);
             assertex(tsSet); // per Nigel, is always set
             IDistributedSuperFile *superFile = dFile->querySuperFile();
             if (superFile)
@@ -2033,7 +2033,6 @@ public:
         UnsignedArray partNos;
         for (unsigned i = 1; i <= numParts; i++)
         {
-            IPartDescriptor *pdesc = fdesc->queryPart(i-1);
             if (getBondedChannel(i)==channel || !isLocal)
             {
                 partNos.append(i-1);

+ 2 - 2
roxie/ccd/ccdlistener.cpp

@@ -830,7 +830,7 @@ public:
         // Note - strictly speaking not threadsafe but any race conditions are (a) unlikely and (b) harmless
         if (cpuCores)
         {
-            if (numCores > 0 && numCores < cpuCores)
+            if (numCores > 0 && numCores < (int) cpuCores)
             {
                 cpu_set_t threadMask;
                 CPU_ZERO(&threadMask);
@@ -844,7 +844,7 @@ public:
                     {
                         CPU_SET(useCore, &threadMask);
                         cores++;
-                        if (cores == numCores)
+                        if ((int) cores == numCores)
                         {
                             lastCore = useCore+1;
                             break;

+ 2 - 5
roxie/ccd/ccdmain.cpp

@@ -351,10 +351,7 @@ static void roxie_common_usage(const char * progName)
 
 class MAbortHandler : implements IExceptionHandler
 {
-    unsigned dummy; // to avoid complaints about an empty class...
 public:
-    MAbortHandler() : dummy(0) {};
-
     virtual bool fireException(IException *e)
     {
         ForEachItemIn(idx, socketListeners)
@@ -962,7 +959,7 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
             if (traceLevel > 3)
                 DBGLOG("Roxie server %u is at %s", nodeIndex, iptext);
         }
-        if (myNodeIndex == -1)
+        if (myNodeIndex == (unsigned) -1)
             throw MakeStringException(MSGAUD_operator, ROXIE_INVALID_TOPOLOGY, "Invalid topology file - current node is not in server list");
 
         // Set multicast base addresses - must be done before generating slave channels
@@ -1120,7 +1117,7 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
                     unsigned listenQueue = roxieFarm.getPropInt("@listenQueue", DEFAULT_LISTEN_QUEUE_SIZE);
                     unsigned numThreads = roxieFarm.getPropInt("@numThreads", numServerThreads);
                     unsigned port = roxieFarm.getPropInt("@port", ROXIE_SERVER_PORT);
-                    unsigned requestArrayThreads = roxieFarm.getPropInt("@requestArrayThreads", 5);
+                    //unsigned requestArrayThreads = roxieFarm.getPropInt("@requestArrayThreads", 5);
                     // NOTE: farmer name [@name=] is not copied into topology
                     const IpAddress &ip = getNodeAddress(myNodeIndex);
                     if (!roxiePort)

+ 2 - 2
roxie/ccd/ccdprotocol.cpp

@@ -150,7 +150,7 @@ public:
         // Note - strictly speaking not threadsafe but any race conditions are (a) unlikely and (b) harmless
         if (cpuCores)
         {
-            if (numCores > 0 && numCores < cpuCores)
+            if (numCores > 0 && numCores < (int) cpuCores)
             {
                 cpu_set_t threadMask;
                 CPU_ZERO(&threadMask);
@@ -164,7 +164,7 @@ public:
                     {
                         CPU_SET(useCore, &threadMask);
                         cores++;
-                        if (cores == numCores)
+                        if ((int) cores == numCores)
                         {
                             lastCore = useCore+1;
                             break;

+ 1 - 1
roxie/ccd/ccdquery.cpp

@@ -620,7 +620,7 @@ protected:
         case TAKjsonwrite:
         case TAKmemoryspillwrite:
         case TAKspillwrite:
-            return createRoxieServerDiskWriteActivityFactory(id, subgraphId, *this, helperFactory, kind, node, isRootAction(node));
+            return createRoxieServerDiskWriteActivityFactory(id, subgraphId, *this, helperFactory, kind, node);
         case TAKindexwrite:
             return createRoxieServerIndexWriteActivityFactory(id, subgraphId, *this, helperFactory, kind, node, isRootAction(node));
         case TAKenth:

+ 4 - 9
roxie/ccd/ccdqueue.cpp

@@ -384,7 +384,7 @@ public:
 
     CRoxieQueryPacket(const void *_data, int lengthRemaining) : data((RoxiePacketHeader *) _data)
     {
-        assertex(lengthRemaining >= sizeof(RoxiePacketHeader));
+        assertex(lengthRemaining >= (int) sizeof(RoxiePacketHeader));
         data->packetlength = lengthRemaining;
         const byte *finger = (const byte *) (data + 1);
         lengthRemaining -= sizeof(RoxiePacketHeader);
@@ -401,7 +401,7 @@ public:
         {
             if (data->continueSequence & ~CONTINUE_SEQUENCE_SKIPTO)
             {
-                assertex(lengthRemaining >= sizeof(unsigned short));
+                assertex(lengthRemaining >= (int) sizeof(unsigned short));
                 continuationLength = *(unsigned short *) finger;
                 continuationData = finger + sizeof(unsigned short);
                 finger = continuationData + continuationLength;
@@ -414,7 +414,7 @@ public:
             }
             if (data->continueSequence & CONTINUE_SEQUENCE_SKIPTO)
             {
-                assertex(lengthRemaining >= sizeof(unsigned short));
+                assertex(lengthRemaining >= (int) sizeof(unsigned short));
                 smartStepInfoLength = *(unsigned short *) finger;
                 smartStepInfoData = finger + sizeof(unsigned short);
                 finger = smartStepInfoData + smartStepInfoLength;
@@ -430,7 +430,7 @@ public:
             lengthRemaining--;
             if (*finger++ & LOGGING_DEBUGGERACTIVE)
             {
-                assertex(lengthRemaining >= sizeof(unsigned short)); 
+                assertex(lengthRemaining >= (int) sizeof(unsigned short));
                 unsigned short debugLen = *(unsigned short *) finger;
                 finger += debugLen + sizeof(unsigned short);
                 lengthRemaining -= debugLen + sizeof(unsigned short);
@@ -2003,11 +2003,6 @@ public:
         int udpQueueSize = topology->getPropInt("@udpQueueSize", UDP_QUEUE_SIZE);
         int udpSendQueueSize = topology->getPropInt("@udpSendQueueSize", UDP_SEND_QUEUE_SIZE);
         int udpMaxSlotsPerClient = topology->getPropInt("@udpMaxSlotsPerClient", 0x7fffffff);
-#ifdef _DEBUG
-        bool udpResendEnabled = topology->getPropBool("@udpResendEnabled", false);
-#else
-        const bool udpResendEnabled = false;  // As long as it is known to be broken, we don't want it accidentally enabled in any release version
-#endif
         maxPacketSize = multicastSocket->get_max_send_size();
         if ((maxPacketSize==0)||(maxPacketSize>65535))
             maxPacketSize = 65535;

+ 25 - 40
roxie/ccd/ccdserver.cpp

@@ -79,7 +79,9 @@
 #define MAX_HTTP_HEADERSIZE 8000
 #define MIN_PAYLOAD_SIZE 800
 
+#ifdef _WIN32
 #pragma warning(disable : 4355)
+#endif
 #define DEFAULT_PARALLEL_LOOP_THREADS       1
 
 #define PROBE
@@ -711,7 +713,7 @@ public:
     {
         if (idx != 0)
             throw MakeStringException(ROXIE_SET_INPUT, "Internal error: id = %d : setInput() parameter out of bounds idx = %d at %s(%d)", id, idx, sanitizeSourceFile(__FILE__), __LINE__);
-        if (input != -1)
+        if (input != (unsigned) -1)
             throw MakeStringException(ROXIE_SET_INPUT, "Internal error: id = %d : setInput() called twice for input = %d source = %d  inputidx = %d  sourceidx = %d at %s(%d)", id, input, source, inputidx, sourceidx, sanitizeSourceFile(__FILE__), __LINE__);
         input = source;
         inputidx = sourceidx;
@@ -1353,7 +1355,7 @@ public:
         //MORE: Create a filtered list and then use asyncfor
         ForEachItemIn(idx, dependencies)
         {
-            if (dependencyControlIds.item(idx) == controlId)
+            if (dependencyControlIds.item(idx) == (int) controlId)
                 dependencies.item(idx).execute(parentExtractSize, parentExtract);
         }
     }
@@ -1362,7 +1364,7 @@ public:
     {
         ForEachItemIn(idx, dependencies)
         {
-            if (dependencyControlIds.item(idx) == controlId)
+            if (dependencyControlIds.item(idx) == (int) controlId)
                 dependencies.item(idx).stop();
         }
     }
@@ -3280,12 +3282,10 @@ public:
 class CRowArrayMessageResult : implements IMessageResult, public CInterface
 {
     ConstPointerArray data;
-    IRowManager &rowManager;
-    bool variableSize;
 
 public:
     IMPLEMENT_IINTERFACE;
-    CRowArrayMessageResult(IRowManager &_rowManager, bool _variableSize) : rowManager(_rowManager), variableSize(_variableSize)
+    CRowArrayMessageResult()
     {
     }
 
@@ -6866,8 +6866,6 @@ public:
 
     virtual void onExecute()
     {
-        unsigned sequence = helper.querySequence();
-
         RtlLinkedDictionaryBuilder builder(rowAllocator, helper.queryHashLookupInfo());
         for (;;)
         {
@@ -7102,13 +7100,12 @@ IRoxieServerActivityFactory *createRoxieServerGraphLoopResultReadActivityFactory
 
 class CRoxieServerGraphLoopResultWriteActivity : public CRoxieServerInternalSinkActivity
 {
-    IHThorGraphLoopResultWriteArg &helper;
     ILocalGraphEx * graph;
     unsigned graphId;
 
 public:
     CRoxieServerGraphLoopResultWriteActivity(IRoxieSlaveContext *_ctx, const IRoxieServerActivityFactory *_factory, IProbeManager *_probeManager, unsigned _graphId, unsigned _numOutputs)
-        : CRoxieServerInternalSinkActivity(_ctx, _factory, _probeManager, _numOutputs), helper((IHThorGraphLoopResultWriteArg &)basehelper), graphId(_graphId)
+        : CRoxieServerInternalSinkActivity(_ctx, _factory, _probeManager, _numOutputs), graphId(_graphId)
     {
         graph = NULL;
     }
@@ -11339,12 +11336,11 @@ IRoxieServerActivityFactory *createRoxieServerHashAggregateActivityFactory(unsig
 
 class CRoxieServerDegroupActivity : public CRoxieServerActivity
 {
-    IHThorDegroupArg &helper;
     bool eof;
 
 public:
     CRoxieServerDegroupActivity(IRoxieSlaveContext *_ctx, const IRoxieServerActivityFactory *_factory, IProbeManager *_probeManager)
-        : CRoxieServerActivity(_ctx, _factory, _probeManager), helper((IHThorDegroupArg &)basehelper)
+        : CRoxieServerActivity(_ctx, _factory, _probeManager)
     {
         eof = false;
     }
@@ -12038,11 +12034,10 @@ public:
 
 class CRoxieServerDiskWriteActivityFactory : public CRoxieServerMultiOutputFactory
 {
-    bool isRoot;
     bool isTemp;
 public:
-    CRoxieServerDiskWriteActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode, bool _isRoot)
-        : CRoxieServerMultiOutputFactory(_id, _subgraphId, _queryFactory, _helperFactory, _kind, _graphNode), isRoot(_isRoot)
+    CRoxieServerDiskWriteActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode)
+        : CRoxieServerMultiOutputFactory(_id, _subgraphId, _queryFactory, _helperFactory, _kind, _graphNode)
     {
         Owned<IHThorDiskWriteArg> helper = (IHThorDiskWriteArg *) helperFactory();
         isTemp = (helper->getFlags() & TDXtemporary) != 0;
@@ -12079,9 +12074,9 @@ public:
 
 };
 
-IRoxieServerActivityFactory *createRoxieServerDiskWriteActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode, bool _isRoot)
+IRoxieServerActivityFactory *createRoxieServerDiskWriteActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode)
 {
-    return new CRoxieServerDiskWriteActivityFactory(_id, _subgraphId, _queryFactory, _helperFactory, _kind, _graphNode, _isRoot);
+    return new CRoxieServerDiskWriteActivityFactory(_id, _subgraphId, _queryFactory, _helperFactory, _kind, _graphNode);
 }
 
 //=================================================================================
@@ -12321,8 +12316,6 @@ public:
 
     virtual void setFileProperties(IFileDescriptor *desc) const
     {
-        IPropertyTree &partProps = desc->queryPart(0)->queryProperties(); //properties of the first file part.
-        IPropertyTree &fileProps = desc->queryProperties(); // properties of the logical file
         // Now publish to name services
         StringBuffer dir,base;
         offset_t indexFileSize = writer->queryFile()->size();
@@ -14062,14 +14055,13 @@ IRoxieServerActivityFactory *createRoxieServerMergeActivityFactory(unsigned _id,
 
 class CRoxieServerRegroupActivity : public CRoxieServerMultiInputActivity
 {
-    IHThorRegroupArg &helper;
     unsigned streamIndex;
     bool eof;
     unsigned __int64 numProcessedLastGroup;
 
 public:
     CRoxieServerRegroupActivity(IRoxieSlaveContext *_ctx, const IRoxieServerActivityFactory *_factory, IProbeManager *_probeManager, unsigned _numInputs)
-        : CRoxieServerMultiInputActivity(_ctx, _factory, _probeManager, _numInputs), helper((IHThorRegroupArg &)basehelper)
+        : CRoxieServerMultiInputActivity(_ctx, _factory, _probeManager, _numInputs)
     {
         streamIndex = 0;
         eof = false;
@@ -14741,7 +14733,6 @@ IRoxieServerActivityFactory *createRoxieServerProjectActivityFactory(unsigned _i
 class CRoxieServerPrefetchProjectActivity : public CRoxieServerActivity, implements IRecordPullerCallback
 {
     unsigned numProcessedLastGroup;
-    bool count;
     bool eof;
     bool allPulled;
     bool isThreaded;
@@ -14776,9 +14767,8 @@ class CRoxieServerPrefetchProjectActivity : public CRoxieServerActivity, impleme
     CriticalSection pulledCrit;
 
 public:
-    CRoxieServerPrefetchProjectActivity(IRoxieSlaveContext *_ctx, const IRoxieServerActivityFactory *_factory, IProbeManager *_probeManager, bool _count)
+    CRoxieServerPrefetchProjectActivity(IRoxieSlaveContext *_ctx, const IRoxieServerActivityFactory *_factory, IProbeManager *_probeManager)
         : CRoxieServerActivity(_ctx, _factory, _probeManager),
-        count(_count),
         helper((IHThorPrefetchProjectArg &) basehelper),
         puller(false)
     {
@@ -14969,7 +14959,7 @@ public:
 
     virtual IRoxieServerActivity *createActivity(IRoxieSlaveContext *_ctx, IProbeManager *_probeManager) const
     {
-        return new CRoxieServerPrefetchProjectActivity(_ctx, this, _probeManager, count);
+        return new CRoxieServerPrefetchProjectActivity(_ctx, this, _probeManager);
     }
 };
 
@@ -17202,7 +17192,6 @@ public:
     virtual void onCreate(IHThorArg *_colocalParent)
     {
         CRoxieServerNaryActivity::onCreate(_colocalParent);
-        ICodeContext * codectx = ctx->queryCodeContext();
         inputAllocator.setown(createRowAllocator(helper.queryInputMeta()));
         outputAllocator.setown(createRowAllocator(helper.queryOutputMeta()));
     }
@@ -24133,7 +24122,7 @@ public:
 
         if (count)
         {
-            Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult(ctx->queryRowManager(), false);
+            Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult();
             if (count > choosenLimit)
                 count = choosenLimit;
 
@@ -24372,7 +24361,7 @@ public:
         {
             size32_t size = meta.getRecordSize(rowBuilder.getSelf());
             const void * recBuffer = rowBuilder.finalizeRowClear(size);
-            Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult(ctx->queryRowManager(), meta.isVariableSize());
+            Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult();
             result->append(recBuffer);
             remote.injectResult(result.getClear());
         }
@@ -24514,7 +24503,7 @@ public:
 
     virtual bool processSingleKey(IKeyIndex *key, const IDynamicTransform * trans) override
     {
-        Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult(ctx->queryRowManager(), meta.isVariableSize());
+        Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult();
         singleAggregator.start(rowAllocator, ctx->queryCodeContext(), activityId);
         ThorActivityKind kind = factory->getKind();
         while (tlk->lookup(true))
@@ -24551,7 +24540,6 @@ public:
             Owned<AggregateRowBuilder> next = singleAggregator.nextResult();
             if (!next)
                 break;
-            size32_t size = next->querySize();
             result->append(next->finalizeRowClear());
         }
         remote.injectResult(result.getClear());
@@ -24673,7 +24661,7 @@ public:
     
             if (readHelper.first(tlk->queryKeyBuffer()))
             {
-                Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult(ctx->queryRowManager(), meta.isVariableSize());
+                Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult();
                 do
                 {
                     if (accepted>=choosenLimit)
@@ -25679,7 +25667,7 @@ public:
                                 // MORE - this code seems to be duplicated in half keyed
                                 unsigned accepted = 0;
                                 unsigned rejected = 0;
-                                Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult(ctx->queryRowManager(), true);
+                                Owned<CRowArrayMessageResult> result = new CRowArrayMessageResult();
                                 jg->notePending();
                                 unsigned candidateCount = 0;
                                 ScopedAtomic<unsigned> indexRecordsRead(::indexRecordsRead);
@@ -26524,7 +26512,7 @@ public:
                                 unsigned rejected = 0;
                                 Owned<CRowArrayMessageResult> result;
                                 if (!isSimple) 
-                                    result.setown(new CRowArrayMessageResult(ctx->queryRowManager(), true));
+                                    result.setown(new CRowArrayMessageResult());
                                 // MORE - This code seems to be duplicated in keyedJoinHead
                                 jg->notePending();
                                 unsigned candidateCount = 0;
@@ -26544,7 +26532,7 @@ public:
                                         CPrefixedRowBuilder pb(KEYEDJOIN_RECORD_SIZE(0), rb);
                                         accepted++;
                                         KLBlobProviderAdapter adapter(tlk);
-                                        size32_t joinFieldsSize = helper.extractJoinFields(pb, indexRow, &adapter);
+                                        helper.extractJoinFields(pb, indexRow, &adapter);
                                         KeyedJoinHeader *rec = (KeyedJoinHeader *) rb.getUnfinalizedClear(); // lack of finalize ok as unserialized data here.
                                         rec->fpos = fpos;
                                         rec->thisGroup = jg;
@@ -28360,8 +28348,8 @@ protected:
         class casyncfor: public CAsyncFor
         {
         public:
-            casyncfor(CcdServerTest *_parent, IRoxieServerActivity *_activity, ArrayOf<IFinalRoxieInput *> &_outputs, char const * const *_input, char const * const *_output, unsigned _repeat)
-            : activity(_activity), outputs(_outputs), input(_input), output(_output), repeat(_repeat), parent(_parent)
+            casyncfor(ArrayOf<IFinalRoxieInput *> &_outputs, char const * const *_output, unsigned _repeat)
+            : outputs(_outputs), output(_output), repeat(_repeat)
             {}
             void Do(unsigned i)
             {
@@ -28403,13 +28391,10 @@ protected:
                 outStream->stop();
             }
         private:
-            IRoxieServerActivity *activity;
             ArrayOf<IFinalRoxieInput *> &outputs;
-            char const * const *input;
             char const * const *output;
             unsigned repeat;
-            CcdServerTest *parent;
-        } afor(this, activity, out, input, output, repeat);
+        } afor(out, output, repeat);
         afor.For(numOutputs, numOutputs);
 
         ASSERT(in.state == TestInput::STATEstopped);

+ 1 - 1
roxie/ccd/ccdserver.hpp

@@ -368,7 +368,7 @@ extern IRoxieServerActivityFactory *createRoxieServerAggregateActivityFactory(un
 extern IRoxieServerActivityFactory *createRoxieServerHashAggregateActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode);
 extern IRoxieServerActivityFactory *createRoxieServerDegroupActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode);
 extern IRoxieServerActivityFactory *createRoxieServerSpillReadActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode);
-extern IRoxieServerActivityFactory *createRoxieServerDiskWriteActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode, bool _isRoot);
+extern IRoxieServerActivityFactory *createRoxieServerDiskWriteActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode);
 extern IRoxieServerActivityFactory *createRoxieServerIndexWriteActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode, bool _isRoot);
 extern IRoxieServerActivityFactory *createRoxieServerJoinActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode);
 extern IRoxieServerActivityFactory *createRoxieServerDenormalizeActivityFactory(unsigned _id, unsigned _subgraphId, IQueryFactory &_queryFactory, HelperFactory *_helperFactory, ThorActivityKind _kind, IPropertyTree &_graphNode);

+ 20 - 20
system/security/shared/seclib.hpp

@@ -55,27 +55,27 @@ enum SecAccessFlags : int
     SecAccess_Full = 255
 };
 
-static const char * getSecAccessFlagName(SecAccessFlags flag)
+inline const char * getSecAccessFlagName(SecAccessFlags flag)
 {
-	switch (flag)
-	{
-		case SecAccess_Unavailable:
-			return "Unavailable";
-		case SecAccess_None:
-			return "None";
-		case SecAccess_Access:
-			return "Access";
-		case SecAccess_Read:
-			return "Read";
-		case SecAccess_Write:
-			return "Write";
-		case SecAccess_Full:
-			return "Full";
-		case SecAccess_Unknown:
-		default:
-			return "Unknown";
-			break;
-	}
+    switch (flag)
+    {
+    case SecAccess_Unavailable:
+        return "Unavailable";
+    case SecAccess_None:
+        return "None";
+    case SecAccess_Access:
+        return "Access";
+    case SecAccess_Read:
+        return "Read";
+    case SecAccess_Write:
+        return "Write";
+    case SecAccess_Full:
+        return "Full";
+    case SecAccess_Unknown:
+    default:
+        return "Unknown";
+        break;
+    }
 }