Skip to content

Commit 7303419

Browse files
committed
Use snake_case consistently
1 parent f6dad72 commit 7303419

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

libchecktestdata.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ long string2int(const string &s)
207207

208208
// forward declarations
209209
value_t eval(const expr&);
210-
bigint evalAsInt(const expr& e);
210+
bigint eval_as_int(const expr& e);
211211

212212
value_t getvar(const expr& var, int use_preset = 0)
213213
{
214214
// Construct index array. The cast to bigint automatically
215215
// verifies that the index value is of type bigint.
216216
vector<bigint> ind;
217217
for(size_t i=0; i<var.nargs(); i++) {
218-
ind.push_back(evalAsInt(var.args[i]));
218+
ind.push_back(eval_as_int(var.args[i]));
219219
}
220220
if ( use_preset ) {
221221
if ( preset.count(var.val) && preset[var.val].count(ind) ) {
@@ -246,7 +246,7 @@ void setvar(const expr& var, value_t val, int use_preset = 0)
246246
// verifies that the index value is of type bigint.
247247
vector<bigint> ind;
248248
for(size_t i=0; i<var.nargs(); i++) {
249-
ind.push_back(evalAsInt(var.args[i]));
249+
ind.push_back(eval_as_int(var.args[i]));
250250
}
251251

252252
map<string,indexmap> *varlist = &variable;
@@ -296,7 +296,7 @@ value_t value(const expr& x)
296296
if ( intval.set_str(x.val,0)==0 ) {
297297
bigint c = bigint(intval);
298298
c.shrink();
299-
x.cachedLong = c.small;
299+
x.cached_long = c.small;
300300
return x.cache = value_t(c);
301301
}
302302
else if ( fltval.set_str(x.val,0)==0 ) {
@@ -508,16 +508,16 @@ value_t eval(const expr& e)
508508
e.cache = res;
509509
if ( res.val.which()==value_int ) {
510510
bigint x = res;
511-
e.cachedLong = x.small;
511+
e.cached_long = x.small;
512512
}
513513
}
514514
return res;
515515
}
516516

517-
bigint evalAsInt(const expr& e)
517+
bigint eval_as_int(const expr& e)
518518
{
519-
if ( e.cachedLong != LONG_MIN ) {
520-
return bigint(e.cachedLong);
519+
if ( e.cached_long != LONG_MIN ) {
520+
return bigint(e.cached_long);
521521
}
522522
return eval(e);
523523
}
@@ -786,17 +786,17 @@ string genregex(const string &exp)
786786
possible.insert(exp[i]);
787787
}
788788
}
789-
vector<char> possibleVec;
789+
vector<char> possible_vec;
790790
if ( inverted ) {
791791
for (char c = ' '; c <= '~'; c++) {
792-
if ( !possible.count(c) ) possibleVec.push_back(c);
792+
if ( !possible.count(c) ) possible_vec.push_back(c);
793793
}
794794
} else {
795-
copy(possible.begin(), possible.end(), std::back_inserter(possibleVec));
795+
copy(possible.begin(), possible.end(), std::back_inserter(possible_vec));
796796
}
797797
int mult = getmult(exp, i);
798798
for (int cnt = 0; cnt < mult; cnt++) {
799-
res += possibleVec[get_random(possibleVec.size())];
799+
res += possible_vec[get_random(possible.size())];
800800
}
801801
}
802802
break;
@@ -990,8 +990,8 @@ void checktoken(const command& cmd)
990990
num += data.readchar();
991991
}
992992

993-
bigint lo = evalAsInt(cmd.args[0]);
994-
bigint hi = evalAsInt(cmd.args[1]);
993+
bigint lo = eval_as_int(cmd.args[0]);
994+
bigint hi = eval_as_int(cmd.args[1]);
995995

996996
// debug("%s <= %s <= %s",lo.get_str().c_str(),num.c_str(),hi.get_str().c_str());
997997
if ( cmd.nargs()>=3 ) debug("'%s' = '%s'",

parsetype.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct parse_t {
8181
~ uninitialized object, to detect unset default arguments
8282
*/
8383

84-
mutable long cachedLong = LONG_MIN;
84+
mutable long cached_long = LONG_MIN;
8585
mutable checktestdata::value_t cache;
8686

8787
parse_t(): val(), args(), op('~') {}

0 commit comments

Comments
 (0)