Skip to content

Commit

Permalink
Merge pull request #19074 from richardkchapman/hidlwarn
Browse files Browse the repository at this point in the history
HPCC-32596 Fix warnings in ecl subdirectory

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Sep 25, 2024
2 parents 318d964 + 2e1c274 commit 58b0e60
Show file tree
Hide file tree
Showing 22 changed files with 81 additions and 70 deletions.
2 changes: 2 additions & 0 deletions ecl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
project (ecl)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STRICT_CXX_FLAGS}")
HPCC_ADD_SUBDIRECTORY (agentexec "PLATFORM")
HPCC_ADD_SUBDIRECTORY (eclagent "PLATFORM")
HPCC_ADD_SUBDIRECTORY (eclcc)
Expand Down
1 change: 0 additions & 1 deletion ecl/agentexec/agentexec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ class WaitThread : public CInterfaceOf<IPooledThread>
if (isContainerized() && !useChildProcesses)
{
sharedK8sJob = true;
constexpr unsigned queueWaitingTimeoutMs = 10000;
constexpr unsigned queueWaitingCheckPeriodMs = 1000;
if (!owner.lingerQueue || !queueJobIfQueueWaiting(owner.lingerQueue, item, queueWaitingCheckPeriodMs, queueWaitingCheckPeriodMs))
{
Expand Down
1 change: 0 additions & 1 deletion ecl/ecl-bundle/ecl-bundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,6 @@ class EclCmdBundleBase : public EclCmdCommon
if (optVerbose)
printf("mkdir %s\n", tmp.str());

const char *ext = pathExtension(url);
if (isGitUrl(url))
{
fetchedLocation.append(tmp).append(PATHSEPCHAR);
Expand Down
4 changes: 2 additions & 2 deletions ecl/eclcc/eclcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ static bool extractOption(StringBuffer & option, IProperties * globals, const ch
return false;
}

#ifndef _CONTAINERIZED
static bool extractOption(StringAttr & option, IProperties * globals, const char * envName, const char * propertyName, const char * defaultPrefix, const char * defaultSuffix)
{
if (option)
Expand All @@ -221,6 +222,7 @@ static bool extractOption(StringAttr & option, IProperties * globals, const char
option.set(temp.str());
return ret;
}
#endif

static bool getHomeFolder(StringBuffer & homepath)
{
Expand Down Expand Up @@ -2128,8 +2130,6 @@ void EclCC::generateOutput(EclCompileInstance & instance)

void EclCC::processReference(EclCompileInstance & instance, const char * queryAttributePath, const char * queryAttributePackage)
{
const char * outputFilename = instance.outputFilename;

instance.wu.setown(createLocalWorkUnit());
if (optArchive || optGenerateDepend || optSaveQueryArchive)
instance.archive.setown(createAttributeArchive());
Expand Down
13 changes: 2 additions & 11 deletions ecl/eclccserver/eclccserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,6 @@ class AbortPipeWaiter
// A threadpool is used to allow multiple compiles to be submitted at once. Threads are reused when compilation completes.
//------------------------------------------------------------------------------------------------------------------

static bool getHomeFolder(StringBuffer & homepath)
{
if (!getHomeDir(homepath))
return false;
addPathSepChar(homepath);
#ifndef WIN32
homepath.append('.');
#endif
homepath.append(hpccBuildInfo.dirName);
return true;
}

static bool guardGitUpdates = false;
static StringBuffer gitLockKey;
Expand Down Expand Up @@ -1118,6 +1107,7 @@ class EclccCompileThread : implements IPooledThread, implements IErrorReporter,
}
};

#ifndef _CONTAINERIZED
#ifndef _WIN32
static void generatePrecompiledHeader()
{
Expand Down Expand Up @@ -1150,6 +1140,7 @@ static void removePrecompiledHeader()
removeFileTraceIfFail("eclinclude4.hpp.gch");
}
#endif
#endif

//------------------------------------------------------------------------------------------------------------------
// Class EclccServer manages a pool of compile threads
Expand Down
9 changes: 2 additions & 7 deletions ecl/eclcmd/eclcmd_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ class EclCmdDeploy : public EclCmdWithEclTarget

for (; !iter.done(); iter.next())
{
const char *arg = iter.query();
if (iter.matchOption(optName, ECLOPT_JOB_NAME)||iter.matchOption(optName, ECLOPT_NAME)||iter.matchOption(optName, ECLOPT_NAME_S))
continue;
if (iter.matchFlag(optProtect, ECLOPT_PROTECT))
Expand Down Expand Up @@ -1496,7 +1495,6 @@ class EclCmdAbort : public EclCmdCommon

for (; !iter.done(); iter.next())
{
const char *arg = iter.query();
if (iter.matchOption(optName, ECLOPT_WUID)||iter.matchOption(optName, ECLOPT_WUID_S))
{
optObj.type = eclObjWuid;
Expand Down Expand Up @@ -1532,7 +1530,7 @@ class EclCmdAbort : public EclCmdCommon
reqQ->setJobname(optName.get());

Owned<IClientWUQueryResponse> respQ = client->WUQuery(reqQ);
int res = respQ->queryClientStatus();
[[maybe_unused]] int res = respQ->queryClientStatus();

if (!respQ->getCount_isNull())
{
Expand Down Expand Up @@ -1628,7 +1626,6 @@ class EclCmdGetName : public EclCmdCommon

for (; !iter.done(); iter.next())
{
const char *arg = iter.query();
if (iter.matchOption(optName, ECLOPT_WUID)||iter.matchOption(optName, ECLOPT_WUID_S))
{
optObj.type = eclObjWuid;
Expand Down Expand Up @@ -1714,7 +1711,6 @@ class EclCmdGetWuid : public EclCmdCommon

for (; !iter.done(); iter.next())
{
const char *arg = iter.query();
if (iter.matchOption(optName, ECLOPT_NAME)||iter.matchOption(optName, ECLOPT_NAME_S))
{
retVal = EclCmdOptionMatch;
Expand Down Expand Up @@ -1799,7 +1795,6 @@ class EclCmdStatus : public EclCmdCommon

for (; !iter.done(); iter.next())
{
const char *arg = iter.query();
if (iter.matchOption(optName, ECLOPT_WUID)||iter.matchOption(optName, ECLOPT_WUID_S))
{
optObj.type = eclObjWuid;
Expand Down Expand Up @@ -1847,7 +1842,7 @@ class EclCmdStatus : public EclCmdCommon
req->setJobname(optName.get());

Owned<IClientWUQueryResponse> resp = client->WUQuery(req);
int res = resp->queryClientStatus();
[[maybe_unused]] int res = resp->queryClientStatus();

IArrayOf<IConstECLWorkunit>& wus = resp->getWorkunits();

Expand Down
1 change: 0 additions & 1 deletion ecl/eclcmd/queries/ecl-queries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ class EclCmdQueryFiles : public EclCmdCommon
int ret = outputMultiExceptionsEx(resp->getExceptions());
if (ret == 0)
{
IArrayOf<IConstFileUsedByQuery> &files = resp->getFiles();
if (optQuery.length())
outputQueryFiles(optQuery.str(), resp->getFiles(), resp->getSuperFiles());
else
Expand Down
2 changes: 0 additions & 2 deletions ecl/eclplus/ViewHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ bool ViewHelper::doit(FILE * fp)
if (w->getStateID() == WUStateFailed)
return false;

int queryid = 0;

IArrayOf<IConstECLResult>& results = w->getResults();
ForEachItemIn(res_ind, results)
{
Expand Down
4 changes: 1 addition & 3 deletions ecl/eclplus/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ void promptFor(const char *prompt, const char *prop, bool hide, IProperties * gl
}
SetConsoleMode(hStdIn, dwInputMode);
#else
int fn = fileno(stdin);
#if defined (__linux__)
int fn = fileno(stdin);
struct termio t;
/* If ioctl fails, we're probably not connected to a terminal. */
if(!ioctl(fn, TCGETA, &t))
Expand Down Expand Up @@ -147,8 +147,6 @@ bool build_globals(int argc, const char *argv[], IProperties * globals)
if (arg[0] == '-')
{
StringBuffer name;
const char * value = NULL;

if (arg[1] == 'f')
{
if (eq)
Expand Down
2 changes: 0 additions & 2 deletions ecl/eclscheduler/eclscheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include "wujobq.hpp"
#include "eventqueue.hpp"

static unsigned traceLevel;

//=========================================================================================
//////////////////////////////////////////////////////////////////////////////////////////////
extern "C" void caughtSIGPIPE(int sig)
Expand Down
2 changes: 2 additions & 0 deletions esp/bindings/SOAP/Platform/soapmessage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
limitations under the License.
############################################################################## */

#ifdef _MSC_VER
#pragma warning( disable : 4786)
#endif

#ifndef _SOAPMESSAGE_HPP__
#define _SOAPMESSAGE_HPP__
Expand Down
8 changes: 4 additions & 4 deletions esp/bindings/SOAP/Platform/soapparam.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ class SoapEnumParamNew
{
if (s)
{
int tempval = enumstrings.find(s);
aindex_t tempval = enumstrings.find(s);

if (tempval == NotFound)
throw MakeStringException(-1, "Invalid value for type %s: %s", typeName_.get(), s);
Expand Down Expand Up @@ -956,7 +956,7 @@ class SoapEnumParamNew
{
if (s)
{
int tempval = enumstrings.find(s);
aindex_t tempval = enumstrings.find(s);
if (tempval != NotFound)
return (enumtype)tempval;
}
Expand Down Expand Up @@ -987,7 +987,7 @@ class SoapEnumParamNew
{
if (s)
{
int tempval = enumstrings.find(s);
aindex_t tempval = enumstrings.find(s);
if (tempval == NotFound)
throw MakeStringException(-1, "Invalid value for type %s: %s", typeName_.get(), s);
else
Expand Down Expand Up @@ -1022,7 +1022,7 @@ class SoapEnumParamNew

void marshall(IRpcMessage &rpc_call, const char *tagname, const char* itemname, const char* elementtype="",const char *basepath="", const char *prefix="")
{
if ((value >= 0) && (value < enumstrings.length()))
if (enumstrings.isItem(value))
rpc_call.add_value(basepath, prefix, tagname, "string", enumstrings.item(value));
}

Expand Down
2 changes: 1 addition & 1 deletion esp/bindings/SOAP/xpp/fxpp/FragmentedXmlPullParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class CFragmentedXmlPullParser : public IFragmentedXmlPullParser
return parserRef().getColumnNumber();
}

virtual const bool whitespaceContent() const override
virtual bool whitespaceContent() const override
{
DataFrame* df = peekDataFrame();
if (!df)
Expand Down
5 changes: 4 additions & 1 deletion esp/bindings/SOAP/xpp/sxt/XmlTokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ typedef char SXT_CHAR;
//#define SXT_TRACING false;
//#define SXT_TEST_VALIDATING false;

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4290)
#endif

namespace sxt {

Expand Down Expand Up @@ -377,7 +379,6 @@ namespace sxt {
} else { // it must be STag or ETag
//bool prevMixSeenContent = seenContent;
bool prevMixInElement = mixInElement;
bool prevMixSeenContent = seenContent;
if(ch == _MYT('/')) {
state = STATE_SCAN_ETAG_NAME;
mixInElement = false;
Expand Down Expand Up @@ -1080,7 +1081,9 @@ inline ostream& operator<<(ostream& output,

} // namespace

#ifdef _MSC_VER
#pragma warning(pop)
#endif

#endif // SXT_XML_TOKENIZER_H_

30 changes: 22 additions & 8 deletions esp/bindings/SOAP/xpp/xpp/XmlPullParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace xpp {
virtual const SXT_STRING getPosDesc() const = 0;
virtual int getLineNumber() const = 0;
virtual int getColumnNumber() const = 0;
virtual const bool whitespaceContent() const = 0;
virtual bool whitespaceContent() const = 0;
};

class XmlPullParser : implements IXmlPullParser {
Expand Down Expand Up @@ -379,15 +379,15 @@ namespace xpp {


}
} catch(XmlTokenizerException ex) {
} catch(XmlTokenizerException const &ex) {
throw XmlPullParserException(string("tokenizer exception: ")
+ ex.getMessage());
}
throw XmlPullParserException(string("illegal parser state"));
}


virtual const bool whitespaceContent() const override {
virtual bool whitespaceContent() const override {
if(eventType != CONTENT) {
throw XmlPullParserException("no content available to read");
}
Expand Down Expand Up @@ -588,7 +588,7 @@ namespace xpp {
+to_string(token));
}
}
} catch(XmlTokenizerException ex) {
} catch(XmlTokenizerException const &ex) {
throw XmlPullParserException(string("tokenizer exception: ")
+ ex.getMessage());
}
Expand Down Expand Up @@ -759,8 +759,8 @@ namespace xpp {
if(elStackSize < newSize) {
ElementContent* newStack = new ElementContent[newSize];
if(elStack != NULL) {
//System.arraycopy(elStack, 0, newStack, 0, elStackDepth);
memcpy(newStack, elStack, elStackDepth * sizeof(newStack[0]));
for(int i = 0; i < elStackDepth; ++i)
new(newStack+i) ElementContent(std::move(elStack[i]));
delete [] elStack;
elStack = NULL;
}
Expand All @@ -773,8 +773,7 @@ namespace xpp {
}
}

void ensureNsBufSpace(int addSpace) {
addSpace = addSpace;
void ensureNsBufSpace(int) {
/*
// NOTE: unfortunately it can not be used as i was storing char* pointers
// to this block of memory, storing relative offsets though will work - but later!
Expand Down Expand Up @@ -879,6 +878,21 @@ namespace xpp {
prevNsBufPos = -1;
}

ElementContent(ElementContent &&src) {
qName = src.qName;
uri = src.uri;
localName = src.localName;
prefix = src.prefix;
defaultNs = src.defaultNs;
prevNsBufPos = src.prevNsBufPos;
prefixesEnd = src.prefixesEnd;
prefixesSize = src.prefixesSize;
prefixes = src.prefixes;
src.prefixes = NULL;
prefixPrevNs = src.prefixPrevNs;
src.prefixPrevNs = NULL;
}

~ElementContent() {
if(prefixes != NULL) {
delete [] prefixes;
Expand Down
2 changes: 2 additions & 0 deletions esp/bindings/bindutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
limitations under the License.
############################################################################## */

#ifdef _MSC_VER
#pragma warning( disable : 4786)
#endif

#include "platform.h"
#define BINDUTIL_EXPORT DECL_EXPORT
Expand Down
8 changes: 4 additions & 4 deletions esp/platform/esp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ interface IEspContext : extends IInterface

virtual void setServiceName(const char *name)=0;
virtual const char * queryServiceName(const char *name)=0;
virtual const unsigned queryCreationTime()=0;
virtual unsigned queryCreationTime()=0;
virtual void setProcessingTime()=0;
virtual const unsigned queryProcessingTime()=0;
virtual unsigned queryProcessingTime()=0;
virtual void setException(int exceptionCode)=0;
virtual const bool queryException(int& exceptionCode, unsigned& exceptionTime)=0;
virtual const bool queryHasException()=0;
virtual bool queryException(int& exceptionCode, unsigned& exceptionTime)=0;
virtual bool queryHasException()=0;

virtual IProperties * queryRequestParameters()=0;
virtual void setRequestParameters(IProperties * Parameters)=0;
Expand Down
Loading

0 comments on commit 58b0e60

Please sign in to comment.