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

@ -14,59 +14,60 @@ namespace
class PrintIt
{
public:
PrintIt(ostream& os) : fOs(os)
{
fOs.fill('0');
fOs.flags(ios::hex);
}
~PrintIt() { }
PrintIt(ostream& os) : fOs(os)
{
fOs.fill('0');
fOs.flags(ios::hex);
}
~PrintIt() { }
void operator()(const int i) const
{
unsigned u = static_cast<unsigned>(i & 0xff);
fOs << setw(2) << u;
}
void operator()(const int i) const
{
unsigned u = static_cast<unsigned>(i & 0xff);
fOs << setw(2) << u;
}
private:
//Defaults okay
//PrintIt(const PrintIt& rhs);
//PrintIt& operator=(const PrintIt& rhs);
//Defaults okay
//PrintIt(const PrintIt& rhs);
//PrintIt& operator=(const PrintIt& rhs);
ostream& fOs;
ostream& fOs;
};
}
int main(int argc, char** argv)
{
int c;
unsigned long long numRows = 20000000;
int c;
unsigned long long numRows = 20000000;
opterr = 0;
opterr = 0;
while ((c = getopt(argc, argv, "r:h")) != -1)
switch (c)
{
case 'r':
numRows = strtoull(optarg, 0, 0);
break;
case 'h':
case '?':
default:
break;
}
while ((c = getopt(argc, argv, "r:h")) != -1)
switch (c)
{
case 'r':
numRows = strtoull(optarg, 0, 0);
break;
MyRand mrwidth(100, 800);
case 'h':
case '?':
default:
break;
}
for (unsigned long long i = 0; i < numRows; i++)
{
int w = mrwidth.generate();
vector<int> vi(w);
generate(vi.begin(), vi.end(), MyRand(0, 255));
cout << "0|";
for_each(vi.begin(), vi.end(), PrintIt(cout));
cout << '|' << endl;
}
MyRand mrwidth(100, 800);
return 0;
for (unsigned long long i = 0; i < numRows; i++)
{
int w = mrwidth.generate();
vector<int> vi(w);
generate(vi.begin(), vi.end(), MyRand(0, 255));
cout << "0|";
for_each(vi.begin(), vi.end(), PrintIt(cout));
cout << '|' << endl;
}
return 0;
}