1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-02-11 12:24:40 +00:00
parent 509f005be7
commit 7c808317dc
1367 changed files with 394342 additions and 413129 deletions

View File

@@ -16,90 +16,81 @@ using namespace std;
extern int optind, opterr, optopt;
*/
int main(int argc, char** argv)
{
opterr = 0;
int c;
bool invalid = false;
bool aflg = false;
bool bflg = false;
bool cflg = false;
bool dflg = false;
string dval;
bool eflg = false;
string eval;
char invchar = 0;
opterr = 0;
int c;
bool invalid = false;
bool aflg = false;
bool bflg = false;
bool cflg = false;
bool dflg = false;
string dval;
bool eflg = false;
string eval;
char invchar = 0;
#if defined(TEST1)
char* opts = "";
char* av[] = { 0 };
char* opts = "";
char* av[] = {0};
#elif defined(TEST2)
char* opts = "-a+bcd:e:";
char* opts = "-a+bcd:e:";
// char* av[] = { "prg", "-ab", "-dfoo", "-xe", "bar", "file1", "file2", 0 };
// char* av[] = {"prg", "file1", "file2"};
#else
#error Need a test to run!
#endif
// int ac = sizeof(av) / sizeof(av[0]) - 1;
// int ac = sizeof(av) / sizeof(av[0]) - 1;
while ((c = getopt(argc, argv, opts)) != -1)
switch (c)
{
case 'a':
aflg = true;
break;
while ((c = getopt(argc, argv, opts)) != -1)
switch (c)
{
case 'a': aflg = true; break;
case 'b':
bflg = true;
break;
case 'b': bflg = true; break;
case 'c':
cflg = true;
break;
case 'c': cflg = true; break;
case 'd':
dflg = true;
dval = optarg;
break;
case 'd':
dflg = true;
dval = optarg;
break;
case 'e':
eflg = true;
eval = optarg;
break;
case 'e':
eflg = true;
eval = optarg;
break;
case '?':
invalid = true;
invchar = optopt;
break;
case '?':
invalid = true;
invchar = optopt;
break;
default:
invalid = true;
invchar = 0;
break;
}
default:
invalid = true;
invchar = 0;
break;
}
#if defined(TEST1)
assert(!invalid && !aflg && !bflg && !cflg);
assert(optind == 1);
assert(!invalid && !aflg && !bflg && !cflg);
assert(optind == 1);
#elif defined(TEST2)
/* cout << "optind=" << optind << endl;
assert(invalid && aflg && bflg && !cflg);
assert((ac - optind) == 2);
assert(string(av[optind+0]) == "file1");
assert(string(av[optind+1]) == "file2");
assert(dflg);
assert(dval == "foo");
assert(eflg);
assert(eval == "bar");
assert(invchar == 'x');*/
cout << "aflag=" << aflg << " bflag=" << bflg << " cflg=" << cflg
<< " dflag=" << dflg << " eflag=" << eflg << endl;
cout << " eval=" << eval << " dval=" << dval << endl;
cout << " invchar=" << invchar << endl;
cout << " final optind=" << optind << endl;
/* cout << "optind=" << optind << endl;
assert(invalid && aflg && bflg && !cflg);
assert((ac - optind) == 2);
assert(string(av[optind+0]) == "file1");
assert(string(av[optind+1]) == "file2");
assert(dflg);
assert(dval == "foo");
assert(eflg);
assert(eval == "bar");
assert(invchar == 'x');*/
cout << "aflag=" << aflg << " bflag=" << bflg << " cflg=" << cflg << " dflag=" << dflg << " eflag=" << eflg
<< endl;
cout << " eval=" << eval << " dval=" << dval << endl;
cout << " invchar=" << invchar << endl;
cout << " final optind=" << optind << endl;
#endif
return 0;
return 0;
}