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

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -39,9 +39,9 @@ using namespace joblist;
namespace
{
void reverse( char *start, char *end )
void reverse( char* start, char* end )
{
while( start < end )
while ( start < end )
{
char c = *start;
*start++ = *end;
@ -56,31 +56,31 @@ namespace funcexp
CalpontSystemCatalog::ColType Func_reverse::operationType(FunctionParm& fp, CalpontSystemCatalog::ColType& resultType)
{
// operation type is not used by this functor
return fp[0]->data()->resultType();
// operation type is not used by this functor
return fp[0]->data()->resultType();
}
std::string Func_reverse::getStrVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType&)
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType&)
{
string str = stringValue(fp[0], row, isNull);
string str = stringValue(fp[0], row, isNull);
// We used to reverse in the string buffer, but that doesn't
// work for all compilers as some re-use the buffer on simple
// string assignment and implement a ref-count. Reversing in the
// string buffer has the affect of reversing all strings from
// which this one derived.
int len = str.length();
char* pbuf = new char[len+1];
strncpy(pbuf, str.c_str(), len);
pbuf[len] = 0;
char *end = pbuf+len-1;
reverse(pbuf, end);
string rstr = pbuf;
delete [] pbuf;
return rstr;
// We used to reverse in the string buffer, but that doesn't
// work for all compilers as some re-use the buffer on simple
// string assignment and implement a ref-count. Reversing in the
// string buffer has the affect of reversing all strings from
// which this one derived.
int len = str.length();
char* pbuf = new char[len + 1];
strncpy(pbuf, str.c_str(), len);
pbuf[len] = 0;
char* end = pbuf + len - 1;
reverse(pbuf, end);
string rstr = pbuf;
delete [] pbuf;
return rstr;
}