Skip to content

Commit

Permalink
HPCC-16813 Fix various gcc warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
  • Loading branch information
ghalliday committed Jan 4, 2017
1 parent 3c7ecb4 commit a1b4886
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion common/thorhelper/layouttrans.cpp
Expand Up @@ -794,7 +794,7 @@ class RecordLayoutTranslatorTest : public CppUnit::TestFixture
Owned<ITypeInfo> type;
IAtom * name;
size32_t size;
unsigned keyed;
unsigned keyed = 0;
unsigned f;
for(f = 0; getFieldData(m, f, type, name, size, keyed); ++f)
{
Expand Down
4 changes: 2 additions & 2 deletions deployment/deploy/DeployTask.cpp
Expand Up @@ -1089,8 +1089,8 @@ class CDeployTask : public CInterface, implements IDeployTask
Owned<IFile> pDstFile = createIFile(target);
CDateTime dtSrc;
CDateTime dtDst;
offset_t szSrc;
offset_t szDst;
offset_t szSrc = 0;
offset_t szDst = 0;

if (!getFileAttributes(pSrcFile, dtSrc, szSrc, mode) ||
!getFileAttributes(pDstFile, dtDst, szDst, mode))
Expand Down
2 changes: 1 addition & 1 deletion esp/bindings/SOAP/Platform/soapmessage.cpp
Expand Up @@ -326,7 +326,7 @@ IRpcMessage* createRpcMessage(const char* rootTag, StringBuffer& xml)
{
CRpcMessage* rpc = new CRpcMessage(rootTag);

auto_ptr<XmlPullParser> xpp(new XmlPullParser(xml.str(), xml.length()));
std::unique_ptr<XmlPullParser> xpp(new XmlPullParser(xml.str(), xml.length()));
xpp->setSupportNamespaces(true);

rpc->unmarshall(xpp.get());
Expand Down
2 changes: 1 addition & 1 deletion esp/bindings/SOAP/client/soapclient.cpp
Expand Up @@ -237,7 +237,7 @@ int CSoapClient::postRequest(const char* contenttype, const char* soapaction, IR
return rt;

// DBGLOG("response SoapClient got from soap server = \n%s", responsebuf.str());
auto_ptr<XmlPullParser> xpp(new XmlPullParser());
std::unique_ptr<XmlPullParser> xpp(new XmlPullParser());
int bufSize = responsebuf.length();
xpp->setSupportNamespaces(true);
xpp->setInput(responsebuf.str(), bufSize);
Expand Down
2 changes: 1 addition & 1 deletion esp/esdllib/esdl_def.cpp
Expand Up @@ -1838,7 +1838,7 @@ class EsdlDefLoader : public CInterface

if (xmlDef.length())
{
auto_ptr<XmlPullParser> xpp(new XmlPullParser());
std::unique_ptr<XmlPullParser> xpp(new XmlPullParser());

int bufSize = xmlDef.length();
xpp->setSupportNamespaces(true);
Expand Down
2 changes: 1 addition & 1 deletion esp/esdllib/esdl_transformer2.cpp
Expand Up @@ -1781,7 +1781,7 @@ static const char * gotoNextHPCCDataset(XmlPullParser &xppx, StartTag &stag)

void Esdl2Transformer::processHPCCResult(IEspContext &ctx, IEsdlDefMethod &mthdef, const char *xml, IXmlWriterExt* writer, StringBuffer &logdata, unsigned int flags, const char *ns, const char *schema_location)
{
auto_ptr<XmlPullParser> xpp(new XmlPullParser());
std::unique_ptr<XmlPullParser> xpp(new XmlPullParser());

xpp->setSupportNamespaces(true);
xpp->setInput(xml, strlen(xml));
Expand Down
1 change: 1 addition & 0 deletions esp/platform/tokenserialization.hpp
Expand Up @@ -159,6 +159,7 @@ class TokenDeserializer
skipWhitespace(ptr);
if (!*ptr)
{
value = false;
result = Deserialization_INVALID_TOKEN;
}
else
Expand Down
14 changes: 7 additions & 7 deletions plugins/couchbase/couchbaseembed.cpp
Expand Up @@ -492,7 +492,7 @@ namespace couchbaseembed

double CouchbaseEmbedFunctionContext::getRealResult()
{
double mydouble;
double mydouble = 0.0;
auto value = nextResultScalar();
handleDeserializeOutcome(m_tokenDeserializer.deserialize(value, mydouble), "real", value);

Expand All @@ -501,7 +501,7 @@ namespace couchbaseembed

__int64 CouchbaseEmbedFunctionContext::getSignedResult()
{
__int64 myint64;
__int64 myint64 = 0;
auto value = nextResultScalar();
handleDeserializeOutcome(m_tokenDeserializer.deserialize(value, myint64), "signed", value);

Expand All @@ -510,7 +510,7 @@ namespace couchbaseembed

unsigned __int64 CouchbaseEmbedFunctionContext::getUnsignedResult()
{
unsigned __int64 myuint64;
unsigned __int64 myuint64 = 0;
auto value = nextResultScalar();
handleDeserializeOutcome(m_tokenDeserializer.deserialize(value, myuint64), "unsigned", value);

Expand Down Expand Up @@ -806,7 +806,7 @@ namespace couchbaseembed
return p.doubleResult;
}

double mydouble;
double mydouble = 0.0;
couchbaseembed::handleDeserializeOutcome(m_tokenDeserializer.deserialize(value, mydouble), "real", value);
return mydouble;
}
Expand All @@ -820,7 +820,7 @@ namespace couchbaseembed
return p.uintResult;
}

__int64 myint64;
__int64 myint64 = 0;
couchbaseembed::handleDeserializeOutcome(m_tokenDeserializer.deserialize(value, myint64), "signed", value);
return myint64;
}
Expand All @@ -834,14 +834,14 @@ namespace couchbaseembed
return p.uintResult;
}

unsigned __int64 myuint64;
unsigned __int64 myuint64 = 0;
couchbaseembed::handleDeserializeOutcome(m_tokenDeserializer.deserialize(value, myuint64), "unsigned", value);
return myuint64;
}

void CouchbaseRowBuilder::getStringResult(const RtlFieldInfo *field, size32_t &chars, char * &result)
{
const char * value = nextField(field);
const char * value = nextField(field);

if (!value || !*value)
{
Expand Down
2 changes: 1 addition & 1 deletion system/security/LdapSecurity/ldapconnection.cpp
Expand Up @@ -329,7 +329,7 @@ class CLdapConfig : implements ILdapConfig, public CInterface
else
m_ldap_secure_port = atoi(portbuf.str());

int rc;
int rc = LDAP_OTHER;
StringBuffer hostbuf, dcbuf;
const char * ldapDomain = cfg->queryProp(".//@ldapDomain");
for (int numHosts=0; numHosts < getHostCount(); numHosts++)
Expand Down
2 changes: 1 addition & 1 deletion testing/unittests/jlibtests.cpp
Expand Up @@ -124,7 +124,7 @@ class JlibSemTestStress : public CppUnit::TestFixture
sem.signal();
if (!sem.wait(1000))
{
VStringBuffer errMsg("Semaphore stalled (%s:%s)", sanitizeSourceFile(__FILE__), __LINE__);
VStringBuffer errMsg("Semaphore stalled (%s:%d)", sanitizeSourceFile(__FILE__), __LINE__);
CPPUNIT_FAIL(errMsg.str());
}
testTimedElapsed(sem, 5, 1000);
Expand Down

0 comments on commit a1b4886

Please sign in to comment.