Skip to content

Commit 227af3e

Browse files
pcanalktf
authored andcommitted
coding conventions
1 parent 3c10192 commit 227af3e

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

core/meta/src/TClingCallFunc.cxx

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,20 @@ using namespace llvm;
8080
using namespace clang;
8181
using namespace std;
8282

83-
static unsigned long long wrapper_serial = 0LL;
84-
static const string indent_string(" ");
83+
static unsigned long long gWrapperSerial = 0LL;
84+
static const string kIndentString(" ");
8585

86-
static map<const FunctionDecl *, void *> wrapper_store;
87-
static map<const Decl *, void *> ctor_wrapper_store;
88-
static map<const Decl *, void *> dtor_wrapper_store;
86+
static map<const FunctionDecl *, void *> gWrapperStore;
87+
static map<const Decl *, void *> gCtorWrapperStore;
88+
static map<const Decl *, void *> gDtorWrapperStore;
8989

9090
static
9191
inline
9292
void
9393
indent(ostringstream &buf, int indent_level)
9494
{
9595
for (int i = 0; i < indent_level; ++i) {
96-
buf << indent_string;
96+
buf << kIndentString;
9797
}
9898
}
9999

@@ -285,29 +285,29 @@ void TClingCallFunc::collect_type_info(QualType &QT, ostringstream &typedefbuf,
285285
string fp_typedef_name;
286286
{
287287
ostringstream nm;
288-
nm << "FP" << wrapper_serial++;
288+
nm << "FP" << gWrapperSerial++;
289289
type_name = nm.str();
290290
raw_string_ostream OS(fp_typedef_name);
291291
QT.print(OS, Policy, type_name);
292292
OS.flush();
293293
}
294294
for (int i = 0; i < indent_level; ++i) {
295-
typedefbuf << indent_string;
295+
typedefbuf << kIndentString;
296296
}
297297
typedefbuf << "typedef " << fp_typedef_name << ";\n";
298298
return;
299299
} else if (QT->isMemberPointerType()) {
300300
string mp_typedef_name;
301301
{
302302
ostringstream nm;
303-
nm << "MP" << wrapper_serial++;
303+
nm << "MP" << gWrapperSerial++;
304304
type_name = nm.str();
305305
raw_string_ostream OS(mp_typedef_name);
306306
QT.print(OS, Policy, type_name);
307307
OS.flush();
308308
}
309309
for (int i = 0; i < indent_level; ++i) {
310-
typedefbuf << indent_string;
310+
typedefbuf << kIndentString;
311311
}
312312
typedefbuf << "typedef " << mp_typedef_name << ";\n";
313313
return;
@@ -323,14 +323,14 @@ void TClingCallFunc::collect_type_info(QualType &QT, ostringstream &typedefbuf,
323323
string ar_typedef_name;
324324
{
325325
ostringstream ar;
326-
ar << "AR" << wrapper_serial++;
326+
ar << "AR" << gWrapperSerial++;
327327
type_name = ar.str();
328328
raw_string_ostream OS(ar_typedef_name);
329329
QT.print(OS, Policy, type_name);
330330
OS.flush();
331331
}
332332
for (int i = 0; i < indent_level; ++i) {
333-
typedefbuf << indent_string;
333+
typedefbuf << kIndentString;
334334
}
335335
typedefbuf << "typedef " << ar_typedef_name << ";\n";
336336
return;
@@ -365,7 +365,7 @@ void TClingCallFunc::make_narg_ctor(const unsigned N, ostringstream &typedefbuf,
365365
} else {
366366
callbuf << "\n";
367367
for (int j = 0; j <= indent_level; ++j) {
368-
callbuf << indent_string;
368+
callbuf << kIndentString;
369369
}
370370
}
371371
}
@@ -429,7 +429,7 @@ void TClingCallFunc::make_narg_call(const unsigned N, ostringstream &typedefbuf,
429429
} else {
430430
callbuf << "\n";
431431
for (int j = 0; j <= indent_level; ++j) {
432-
callbuf << indent_string;
432+
callbuf << kIndentString;
433433
}
434434
}
435435
}
@@ -461,7 +461,7 @@ void TClingCallFunc::make_narg_ctor_with_return(const unsigned N, const string &
461461
// }
462462
//
463463
for (int i = 0; i < indent_level; ++i) {
464-
buf << indent_string;
464+
buf << kIndentString;
465465
}
466466
buf << "if (ret) {\n";
467467
++indent_level;
@@ -472,7 +472,7 @@ void TClingCallFunc::make_narg_ctor_with_return(const unsigned N, const string &
472472
// Write the return value assignment part.
473473
//
474474
for (int i = 0; i < indent_level; ++i) {
475-
callbuf << indent_string;
475+
callbuf << kIndentString;
476476
}
477477
callbuf << "(*(" << class_name << "**)ret) = ";
478478
//
@@ -484,7 +484,7 @@ void TClingCallFunc::make_narg_ctor_with_return(const unsigned N, const string &
484484
//
485485
callbuf << ";\n";
486486
for (int i = 0; i < indent_level; ++i) {
487-
callbuf << indent_string;
487+
callbuf << kIndentString;
488488
}
489489
callbuf << "return;\n";
490490
//
@@ -494,31 +494,31 @@ void TClingCallFunc::make_narg_ctor_with_return(const unsigned N, const string &
494494
}
495495
--indent_level;
496496
for (int i = 0; i < indent_level; ++i) {
497-
buf << indent_string;
497+
buf << kIndentString;
498498
}
499499
buf << "}\n";
500500
for (int i = 0; i < indent_level; ++i) {
501-
buf << indent_string;
501+
buf << kIndentString;
502502
}
503503
buf << "else {\n";
504504
++indent_level;
505505
{
506506
ostringstream typedefbuf;
507507
ostringstream callbuf;
508508
for (int i = 0; i < indent_level; ++i) {
509-
callbuf << indent_string;
509+
callbuf << kIndentString;
510510
}
511511
make_narg_ctor(N, typedefbuf, callbuf, class_name, indent_level);
512512
callbuf << ";\n";
513513
for (int i = 0; i < indent_level; ++i) {
514-
callbuf << indent_string;
514+
callbuf << kIndentString;
515515
}
516516
callbuf << "return;\n";
517517
buf << typedefbuf.str() << callbuf.str();
518518
}
519519
--indent_level;
520520
for (int i = 0; i < indent_level; ++i) {
521-
buf << indent_string;
521+
buf << kIndentString;
522522
}
523523
buf << "}\n";
524524
}
@@ -546,18 +546,18 @@ void TClingCallFunc::make_narg_call_with_return(const unsigned N, const string &
546546
ostringstream typedefbuf;
547547
ostringstream callbuf;
548548
for (int i = 0; i < indent_level; ++i) {
549-
callbuf << indent_string;
549+
callbuf << kIndentString;
550550
}
551551
make_narg_call(N, typedefbuf, callbuf, class_name, indent_level);
552552
callbuf << ";\n";
553553
for (int i = 0; i < indent_level; ++i) {
554-
callbuf << indent_string;
554+
callbuf << kIndentString;
555555
}
556556
callbuf << "return;\n";
557557
buf << typedefbuf.str() << callbuf.str();
558558
} else {
559559
for (int i = 0; i < indent_level; ++i) {
560-
buf << indent_string;
560+
buf << kIndentString;
561561
}
562562
buf << "if (ret) {\n";
563563
++indent_level;
@@ -568,7 +568,7 @@ void TClingCallFunc::make_narg_call_with_return(const unsigned N, const string &
568568
// Write the placement part of the placement new.
569569
//
570570
for (int i = 0; i < indent_level; ++i) {
571-
callbuf << indent_string;
571+
callbuf << kIndentString;
572572
}
573573
callbuf << "new (ret) ";
574574
string type_name;
@@ -596,7 +596,7 @@ void TClingCallFunc::make_narg_call_with_return(const unsigned N, const string &
596596
//
597597
callbuf << ");\n";
598598
for (int i = 0; i < indent_level; ++i) {
599-
callbuf << indent_string;
599+
callbuf << kIndentString;
600600
}
601601
callbuf << "return;\n";
602602
//
@@ -606,31 +606,31 @@ void TClingCallFunc::make_narg_call_with_return(const unsigned N, const string &
606606
}
607607
--indent_level;
608608
for (int i = 0; i < indent_level; ++i) {
609-
buf << indent_string;
609+
buf << kIndentString;
610610
}
611611
buf << "}\n";
612612
for (int i = 0; i < indent_level; ++i) {
613-
buf << indent_string;
613+
buf << kIndentString;
614614
}
615615
buf << "else {\n";
616616
++indent_level;
617617
{
618618
ostringstream typedefbuf;
619619
ostringstream callbuf;
620620
for (int i = 0; i < indent_level; ++i) {
621-
callbuf << indent_string;
621+
callbuf << kIndentString;
622622
}
623623
make_narg_call(N, typedefbuf, callbuf, class_name, indent_level);
624624
callbuf << ";\n";
625625
for (int i = 0; i < indent_level; ++i) {
626-
callbuf << indent_string;
626+
callbuf << kIndentString;
627627
}
628628
callbuf << "return;\n";
629629
buf << typedefbuf.str() << callbuf.str();
630630
}
631631
--indent_level;
632632
for (int i = 0; i < indent_level; ++i) {
633-
buf << indent_string;
633+
buf << kIndentString;
634634
}
635635
buf << "}\n";
636636
}
@@ -1022,7 +1022,7 @@ tcling_callfunc_Wrapper_t TClingCallFunc::make_wrapper()
10221022
//string mn;
10231023
//fInterp->maybeMangleDeclName(ND, mn);
10241024
//buf << '_' << mn;
1025-
buf << '_' << wrapper_serial++;
1025+
buf << '_' << gWrapperSerial++;
10261026
wrapper_name = buf.str();
10271027
}
10281028
//
@@ -1045,14 +1045,14 @@ tcling_callfunc_Wrapper_t TClingCallFunc::make_wrapper()
10451045
// possible number of arguments per call.
10461046
for (unsigned N = min_args; N <= num_params; ++N) {
10471047
for (int i = 0; i < indent_level; ++i) {
1048-
buf << indent_string;
1048+
buf << kIndentString;
10491049
}
10501050
buf << "if (nargs == " << N << ") {\n";
10511051
++indent_level;
10521052
make_narg_call_with_return(N, class_name, buf, indent_level);
10531053
--indent_level;
10541054
for (int i = 0; i < indent_level; ++i) {
1055-
buf << indent_string;
1055+
buf << kIndentString;
10561056
}
10571057
buf << "}\n";
10581058
}
@@ -1066,7 +1066,7 @@ tcling_callfunc_Wrapper_t TClingCallFunc::make_wrapper()
10661066
//
10671067
void *F = compile_wrapper(wrapper_name, wrapper);
10681068
if (F) {
1069-
wrapper_store.insert(make_pair(FD, F));
1069+
gWrapperStore.insert(make_pair(FD, F));
10701070
} else {
10711071
Error("TClingCallFunc::make_wrapper",
10721072
"Failed to compile\n ==== SOURCE BEGIN ====\n%s\n ==== SOURCE END ====",
@@ -1145,7 +1145,7 @@ tcling_callfunc_ctor_Wrapper_t TClingCallFunc::make_ctor_wrapper(const TClingCla
11451145
//string mn;
11461146
//fInterp->maybeMangleDeclName(ND, mn);
11471147
//buf << '_dtor_' << mn;
1148-
buf << '_' << wrapper_serial++;
1148+
buf << '_' << gWrapperSerial++;
11491149
wrapper_name = buf.str();
11501150
}
11511151
//
@@ -1231,7 +1231,7 @@ tcling_callfunc_ctor_Wrapper_t TClingCallFunc::make_ctor_wrapper(const TClingCla
12311231
void *F = compile_wrapper(wrapper_name, wrapper,
12321232
/*withAccessControl=*/false);
12331233
if (F) {
1234-
ctor_wrapper_store.insert(make_pair(info->GetDecl(), F));
1234+
gCtorWrapperStore.insert(make_pair(info->GetDecl(), F));
12351235
} else {
12361236
Error("TClingCallFunc::make_ctor_wrapper",
12371237
"Failed to compile\n ==== SOURCE BEGIN ====\n%s\n ==== SOURCE END ====",
@@ -1299,7 +1299,7 @@ TClingCallFunc::make_dtor_wrapper(const TClingClassInfo *info)
12991299
//string mn;
13001300
//fInterp->maybeMangleDeclName(ND, mn);
13011301
//buf << '_dtor_' << mn;
1302-
buf << '_' << wrapper_serial++;
1302+
buf << '_' << gWrapperSerial++;
13031303
wrapper_name = buf.str();
13041304
}
13051305
//
@@ -1395,7 +1395,7 @@ TClingCallFunc::make_dtor_wrapper(const TClingClassInfo *info)
13951395
void *F = compile_wrapper(wrapper_name, wrapper,
13961396
/*withAccessControl=*/false);
13971397
if (F) {
1398-
dtor_wrapper_store.insert(make_pair(info->GetDecl(), F));
1398+
gDtorWrapperStore.insert(make_pair(info->GetDecl(), F));
13991399
} else {
14001400
Error("TClingCallFunc::make_dtor_wrapper",
14011401
"Failed to compile\n ==== SOURCE BEGIN ====\n%s\n ==== SOURCE END ====",
@@ -2303,8 +2303,8 @@ void *TClingCallFunc::InterfaceMethod()
23032303

23042304
R__LOCKGUARD(gInterpreterMutex);
23052305
const FunctionDecl *decl = fMethod->GetMethodDecl();
2306-
map<const FunctionDecl *, void *>::iterator I = wrapper_store.find(decl);
2307-
if (I != wrapper_store.end()) {
2306+
map<const FunctionDecl *, void *>::iterator I = gWrapperStore.find(decl);
2307+
if (I != gWrapperStore.end()) {
23082308
fWrapper = (tcling_callfunc_Wrapper_t) I->second;
23092309
} else {
23102310
fWrapper = make_wrapper();
@@ -2331,8 +2331,8 @@ TInterpreter::CallFuncIFacePtr_t TClingCallFunc::IFacePtr()
23312331

23322332
const FunctionDecl *decl = fMethod->GetMethodDecl();
23332333
map<const FunctionDecl *, void *>::iterator I =
2334-
wrapper_store.find(decl);
2335-
if (I != wrapper_store.end()) {
2334+
gWrapperStore.find(decl);
2335+
if (I != gWrapperStore.end()) {
23362336
fWrapper = (tcling_callfunc_Wrapper_t) I->second;
23372337
} else {
23382338
fWrapper = make_wrapper();

0 commit comments

Comments
 (0)