Skip to content

Commit fceb4f8

Browse files
committed
Do not shadow variables
1 parent bed8dd9 commit fceb4f8

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

include/univalue.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class UniValue {
5656
bool setNumStr(const std::string& val);
5757
bool setInt(uint64_t val);
5858
bool setInt(int64_t val);
59-
bool setInt(int val) { return setInt((int64_t)val); }
59+
bool setInt(int val_) { return setInt((int64_t)val_); }
6060
bool setFloat(double val);
6161
bool setStr(const std::string& val);
6262
bool setArray();
@@ -95,28 +95,28 @@ class UniValue {
9595
bool push_backV(const std::vector<UniValue>& vec);
9696

9797
bool pushKV(const std::string& key, const UniValue& val);
98-
bool pushKV(const std::string& key, const std::string& val) {
99-
UniValue tmpVal(VSTR, val);
98+
bool pushKV(const std::string& key, const std::string& val_) {
99+
UniValue tmpVal(VSTR, val_);
100100
return pushKV(key, tmpVal);
101101
}
102102
bool pushKV(const std::string& key, const char *val_) {
103-
std::string val(val_);
104-
return pushKV(key, val);
103+
std::string _val(val_);
104+
return pushKV(key, _val);
105105
}
106-
bool pushKV(const std::string& key, int64_t val) {
107-
UniValue tmpVal(val);
106+
bool pushKV(const std::string& key, int64_t val_) {
107+
UniValue tmpVal(val_);
108108
return pushKV(key, tmpVal);
109109
}
110-
bool pushKV(const std::string& key, uint64_t val) {
111-
UniValue tmpVal(val);
110+
bool pushKV(const std::string& key, uint64_t val_) {
111+
UniValue tmpVal(val_);
112112
return pushKV(key, tmpVal);
113113
}
114-
bool pushKV(const std::string& key, int val) {
115-
UniValue tmpVal((int64_t)val);
114+
bool pushKV(const std::string& key, int val_) {
115+
UniValue tmpVal((int64_t)val_);
116116
return pushKV(key, tmpVal);
117117
}
118-
bool pushKV(const std::string& key, double val) {
119-
UniValue tmpVal(val);
118+
bool pushKV(const std::string& key, double val_) {
119+
UniValue tmpVal(val_);
120120
return pushKV(key, tmpVal);
121121
}
122122
bool pushKVs(const UniValue& obj);

lib/univalue.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,32 +119,32 @@ bool UniValue::setNumStr(const string& val_)
119119
return true;
120120
}
121121

122-
bool UniValue::setInt(uint64_t val)
122+
bool UniValue::setInt(uint64_t val_)
123123
{
124124
string s;
125125
ostringstream oss;
126126

127-
oss << val;
127+
oss << val_;
128128

129129
return setNumStr(oss.str());
130130
}
131131

132-
bool UniValue::setInt(int64_t val)
132+
bool UniValue::setInt(int64_t val_)
133133
{
134134
string s;
135135
ostringstream oss;
136136

137-
oss << val;
137+
oss << val_;
138138

139139
return setNumStr(oss.str());
140140
}
141141

142-
bool UniValue::setFloat(double val)
142+
bool UniValue::setFloat(double val_)
143143
{
144144
string s;
145145
ostringstream oss;
146146

147-
oss << std::setprecision(16) << val;
147+
oss << std::setprecision(16) << val_;
148148

149149
bool ret = setNumStr(oss.str());
150150
typ = VNUM;
@@ -173,12 +173,12 @@ bool UniValue::setObject()
173173
return true;
174174
}
175175

176-
bool UniValue::push_back(const UniValue& val)
176+
bool UniValue::push_back(const UniValue& val_)
177177
{
178178
if (typ != VARR)
179179
return false;
180180

181-
values.push_back(val);
181+
values.push_back(val_);
182182
return true;
183183
}
184184

@@ -192,13 +192,13 @@ bool UniValue::push_backV(const std::vector<UniValue>& vec)
192192
return true;
193193
}
194194

195-
bool UniValue::pushKV(const std::string& key, const UniValue& val)
195+
bool UniValue::pushKV(const std::string& key, const UniValue& val_)
196196
{
197197
if (typ != VOBJ)
198198
return false;
199199

200200
keys.push_back(key);
201-
values.push_back(val);
201+
values.push_back(val_);
202202
return true;
203203
}
204204

0 commit comments

Comments
 (0)