1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4010 - fixes compilation errors on x64 w/-Werror

Merged in Sergei's patch.
This commit is contained in:
Patrick LeBlanc
2020-06-01 12:52:43 -04:00
parent a8f5d353bd
commit 4bddc92092
9 changed files with 16 additions and 33 deletions

View File

@ -337,7 +337,7 @@ void storeNumericField(Field** f, int64_t value, CalpontSystemCatalog::ColType&
if (ct.colDataType == CalpontSystemCatalog::DECIMAL)
dataconvert::DataConvert::decimalToString(value, (unsigned)ct.scale, tmp, 25, ct.colDataType);
else
snprintf(tmp, 25, "%ld", value);
snprintf(tmp, 25, "%lld", (long long)value);
f2->store(tmp, strlen(tmp), f2->charset());
break;

View File

@ -442,7 +442,7 @@ ReturnedColumn* buildWindowFunctionColumn(Item* item, gp_walk_info& gwi, bool& n
{
case Item_sum::UDF_SUM_FUNC:
{
uint64_t bRespectNulls = (ac->getUDAFContext().getRunFlag(mcsv1sdk::UDAF_IGNORE_NULLS)) ? 0 : 1;
unsigned long bRespectNulls = (ac->getUDAFContext().getRunFlag(mcsv1sdk::UDAF_IGNORE_NULLS)) ? 0 : 1;
char sRespectNulls[18];
sprintf(sRespectNulls, "%lu", bRespectNulls);
srcp.reset(new ConstantColumn(sRespectNulls, (uint64_t)bRespectNulls, ConstantColumn::NUM)); // IGNORE/RESPECT NULLS. 1 => RESPECT

View File

@ -74,7 +74,7 @@ bool AppendTask::run()
while (readCount < cmd->count)
{
uint toRead = min(cmd->count - readCount, bufsize);
uint toRead = min(static_cast<uint>(cmd->count - readCount), bufsize);
success = read(&databuf[0], toRead);
check_error("AppendTask read data", false);
if (success==0)

View File

@ -174,7 +174,7 @@ string use_envvar(const boost::smatch &envvar)
string expand_numbers(const boost::smatch &match)
{
long num = stol(match[1].str());
long long num = stol(match[1].str());
char suffix = (char) ::tolower(match[2].str()[0]);
if (suffix == 't')

View File

@ -461,8 +461,8 @@ void MetadataFile::printObjects() const
{
BOOST_FOREACH(const boost::property_tree::ptree::value_type &v, jsontree->get_child("objects"))
{
printf("Name: %s Length: %lu Offset: %lu\n", v.second.get<string>("key").c_str(),
v.second.get<size_t>("length"), v.second.get<off_t>("offset"));
printf("Name: %s Length: %zu Offset: %lld\n", v.second.get<string>("key").c_str(),
v.second.get<size_t>("length"), (long long)v.second.get<off_t>("offset"));
}
}

View File

@ -74,7 +74,7 @@ bool WriteTask::run()
while (readCount < cmd->count)
{
uint toRead = min(cmd->count - readCount, bufsize);
uint toRead = min(static_cast<uint>(cmd->count - readCount), bufsize);
success = read(&databuf[0], toRead);
check_error("WriteTask read data", false);
if (success==0)

View File

@ -433,7 +433,7 @@ bool writetask()
WriteTask w(clientSock, hdr->payloadLen);
ssize_t result = ::write(sessionSock, cmd, hdr->payloadLen);
assert(result==(hdr->payloadLen));
assert(result == static_cast<ssize_t>(hdr->payloadLen));
w.run();
@ -1065,7 +1065,7 @@ bool copytask(bool connectionTest=false)
len -= 2;
ssize_t result = ::write(sessionSock, buf, len);
assert(result==len);
assert(result==static_cast<ssize_t>(len));
int err=0;
@ -1805,7 +1805,7 @@ void shortMsg()
WriteTask w(clientSock, hdrWrite->payloadLen);
ssize_t result = ::write(sessionSock, cmdWrite, hdrWrite->payloadLen);
assert(result==(hdrWrite->payloadLen));
assert(result==static_cast<ssize_t>(hdrWrite->payloadLen));
w.run();

View File

@ -132,35 +132,18 @@ namespace helpers
const char* convNumToStr(int64_t val, char* dst, int radix)
{
if (radix == 16 || radix == -16)
#ifdef _MSC_VER
sprintf(dst, "%llX", val);
sprintf(dst, "%llX", (long long)val);
#else
sprintf(dst, "%lX", val);
#endif
else if (radix == 8 || radix == -8)
#ifdef _MSC_VER
sprintf(dst, "%llo", val);
sprintf(dst, "%llo", (long long)val);
#else
sprintf(dst, "%lo", val);
#endif
else if (radix == 10)
{
uint64_t uval = static_cast<uint64_t>(val);
#ifdef _MSC_VER
sprintf(dst, "%llu", uval);
#else
sprintf(dst, "%lu", uval);
#endif
sprintf(dst, "%llu", (unsigned long long)val);
}
else if (radix == -10)
#ifdef _MSC_VER
sprintf(dst, "%lld", val);
sprintf(dst, "%lld", (long long)val);
#else
sprintf(dst, "%ld", val);
#endif
else if (radix == 2 || radix == -2)
{
char tmp[65];

View File

@ -122,7 +122,7 @@ protected:
// [ the default format in treenode.h is fixed-point notation ]
char buf[20];
long double floatVal;
int64_t exponent;
int exponent;
long double base;
switch (fp->data()->resultType().colDataType)
@ -157,7 +157,7 @@ protected:
{
snprintf(buf, 20, "%.5Lf", base);
fFloatStr = execplan::removeTrailing0(buf, 20);
snprintf(buf, 20, "e%02ld", exponent);
snprintf(buf, 20, "e%02d", exponent);
fFloatStr += buf;
}