Skip to content

Commit 415f9ae

Browse files
committed
Fix shadow warnings
1 parent cbdf49d commit 415f9ae

File tree

11 files changed

+56
-56
lines changed

11 files changed

+56
-56
lines changed

include/tao/json/events/cbor/to_stream.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ namespace tao
2727
std::ostream& os;
2828

2929
public:
30-
explicit to_stream( std::ostream& os ) noexcept
31-
: os( os )
30+
explicit to_stream( std::ostream& in_os ) noexcept
31+
: os( in_os )
3232
{
3333
}
3434

include/tao/json/events/debug.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ namespace tao
3131
std::ostream& os;
3232

3333
public:
34-
explicit debug( std::ostream& os ) noexcept
35-
: os( os )
34+
explicit debug( std::ostream& in_os ) noexcept
35+
: os( in_os )
3636
{
3737
}
3838

include/tao/json/events/msgpack/to_stream.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ namespace tao
2626
std::ostream& os;
2727

2828
public:
29-
explicit to_stream( std::ostream& os ) noexcept
30-
: os( os )
29+
explicit to_stream( std::ostream& in_os ) noexcept
30+
: os( in_os )
3131
{
3232
}
3333

include/tao/json/events/to_pretty_stream.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ namespace tao
4949
}
5050

5151
public:
52-
to_pretty_stream( std::ostream& os, const std::size_t indent )
53-
: os( os ),
54-
indent( indent ),
52+
to_pretty_stream( std::ostream& in_os, const std::size_t in_indent )
53+
: os( in_os ),
54+
indent( in_indent ),
5555
first( true )
5656
{
5757
}

include/tao/json/events/to_stream.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ namespace tao
3939
}
4040

4141
public:
42-
explicit to_stream( std::ostream& os ) noexcept
43-
: os( os ),
42+
explicit to_stream( std::ostream& in_os ) noexcept
43+
: os( in_os ),
4444
first( true )
4545
{
4646
}

include/tao/json/events/ubjson/to_stream.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ namespace tao
2626
std::ostream& os;
2727

2828
public:
29-
explicit to_stream( std::ostream& os ) noexcept
30-
: os( os )
29+
explicit to_stream( std::ostream& in_os ) noexcept
30+
: os( in_os )
3131
{
3232
}
3333

include/tao/json/internal/sha256.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,15 @@ namespace tao
189189

190190
process();
191191

192-
for( std::size_t i = 0; i < 4; ++i ) {
193-
buffer[ i ] = ( H[ 0 ] >> ( 24 - i * 8 ) ) & 0xff;
194-
buffer[ i + 4 ] = ( H[ 1 ] >> ( 24 - i * 8 ) ) & 0xff;
195-
buffer[ i + 8 ] = ( H[ 2 ] >> ( 24 - i * 8 ) ) & 0xff;
196-
buffer[ i + 12 ] = ( H[ 3 ] >> ( 24 - i * 8 ) ) & 0xff;
197-
buffer[ i + 16 ] = ( H[ 4 ] >> ( 24 - i * 8 ) ) & 0xff;
198-
buffer[ i + 20 ] = ( H[ 5 ] >> ( 24 - i * 8 ) ) & 0xff;
199-
buffer[ i + 24 ] = ( H[ 6 ] >> ( 24 - i * 8 ) ) & 0xff;
200-
buffer[ i + 28 ] = ( H[ 7 ] >> ( 24 - i * 8 ) ) & 0xff;
192+
for( std::size_t j = 0; j < 4; ++j ) {
193+
buffer[ j ] = ( H[ 0 ] >> ( 24 - j * 8 ) ) & 0xff;
194+
buffer[ j + 4 ] = ( H[ 1 ] >> ( 24 - j * 8 ) ) & 0xff;
195+
buffer[ j + 8 ] = ( H[ 2 ] >> ( 24 - j * 8 ) ) & 0xff;
196+
buffer[ j + 12 ] = ( H[ 3 ] >> ( 24 - j * 8 ) ) & 0xff;
197+
buffer[ j + 16 ] = ( H[ 4 ] >> ( 24 - j * 8 ) ) & 0xff;
198+
buffer[ j + 20 ] = ( H[ 5 ] >> ( 24 - j * 8 ) ) & 0xff;
199+
buffer[ j + 24 ] = ( H[ 6 ] >> ( 24 - j * 8 ) ) & 0xff;
200+
buffer[ j + 28 ] = ( H[ 7 ] >> ( 24 - j * 8 ) ) & 0xff;
201201
}
202202
}
203203

include/tao/json/patch.hpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@ namespace tao
1515
namespace json
1616
{
1717
template< template< typename... > class Traits >
18-
void patch_inplace( basic_value< Traits >& value, const basic_value< Traits >& patch )
18+
void patch_inplace( basic_value< Traits >& v, const basic_value< Traits >& patch )
1919
{
2020
for( const auto& entry : patch.get_array() ) {
2121
const auto& op = entry.at( "op" ).get_string();
2222
const auto& path = entry.at( "path" ).get_string();
2323
const pointer path_pointer( path );
2424
if( op == "test" ) {
25-
if( value.at( path_pointer ) != entry.at( "value" ) ) {
25+
if( v.at( path_pointer ) != entry.at( "value" ) ) {
2626
throw std::runtime_error( "test failed for: " + path );
2727
}
2828
}
2929
else if( op == "remove" ) {
30-
value.erase( path_pointer );
30+
v.erase( path_pointer );
3131
}
3232
else if( op == "add" ) {
33-
value.insert( path_pointer, entry.at( "value" ) );
33+
v.insert( path_pointer, entry.at( "value" ) );
3434
}
3535
else if( op == "replace" ) {
36-
value.at( path_pointer ) = entry.at( "value" );
36+
v.at( path_pointer ) = entry.at( "value" );
3737
}
3838
else if( op == "move" ) {
3939
const pointer from( entry.at( "from" ).get_string() );
40-
auto v = std::move( value.at( from ) );
41-
value.erase( from );
42-
value.insert( path_pointer, std::move( v ) );
40+
auto t = std::move( v.at( from ) );
41+
v.erase( from );
42+
v.insert( path_pointer, std::move( t ) );
4343
}
4444
else if( op == "copy" ) {
4545
const pointer from( entry.at( "from" ).get_string() );
46-
value.insert( path_pointer, value.at( from ) );
46+
v.insert( path_pointer, v.at( from ) );
4747
}
4848
else {
4949
throw std::runtime_error( "unknown patch operation: '" + op + '\'' );
@@ -52,35 +52,35 @@ namespace tao
5252
}
5353

5454
template< template< typename... > class Traits >
55-
void patch_inplace( basic_value< Traits >& value, basic_value< Traits >&& patch )
55+
void patch_inplace( basic_value< Traits >& v, basic_value< Traits >&& patch )
5656
{
5757
for( const auto& entry : patch.get_array() ) {
5858
const auto& op = entry.at( "op" ).get_string();
5959
const auto& path = entry.at( "path" ).get_string();
6060
const pointer path_pointer( path );
6161
if( op == "test" ) {
62-
if( value.at( path_pointer ) != entry.at( "value" ) ) {
62+
if( v.at( path_pointer ) != entry.at( "value" ) ) {
6363
throw std::runtime_error( "test failed for: " + path );
6464
}
6565
}
6666
else if( op == "remove" ) {
67-
value.erase( path_pointer );
67+
v.erase( path_pointer );
6868
}
6969
else if( op == "add" ) {
70-
value.insert( path_pointer, std::move( entry.at( "value" ) ) );
70+
v.insert( path_pointer, std::move( entry.at( "value" ) ) );
7171
}
7272
else if( op == "replace" ) {
73-
value.at( path_pointer ) = std::move( entry.at( "value" ) );
73+
v.at( path_pointer ) = std::move( entry.at( "value" ) );
7474
}
7575
else if( op == "move" ) {
7676
const pointer from( entry.at( "from" ).get_string() );
77-
auto v = std::move( value.at( from ) );
78-
value.erase( from );
79-
value.insert( path_pointer, std::move( v ) );
77+
auto t = std::move( v.at( from ) );
78+
v.erase( from );
79+
v.insert( path_pointer, std::move( t ) );
8080
}
8181
else if( op == "copy" ) {
8282
const pointer from( entry.at( "from" ).get_string() );
83-
value.insert( path_pointer, value.at( from ) );
83+
v.insert( path_pointer, v.at( from ) );
8484
}
8585
else {
8686
throw std::runtime_error( "unknown patch operation: '" + op + '\'' );
@@ -89,17 +89,17 @@ namespace tao
8989
}
9090

9191
template< template< typename... > class Traits >
92-
basic_value< Traits > patch( basic_value< Traits > value, const basic_value< Traits >& patch )
92+
basic_value< Traits > patch( basic_value< Traits > v, const basic_value< Traits >& patch )
9393
{
94-
patch_inplace( value, patch );
95-
return std::move( value );
94+
patch_inplace( v, patch );
95+
return std::move( v );
9696
}
9797

9898
template< template< typename... > class Traits >
99-
basic_value< Traits > patch( basic_value< Traits > value, basic_value< Traits >&& patch )
99+
basic_value< Traits > patch( basic_value< Traits > v, basic_value< Traits >&& patch )
100100
{
101-
patch_inplace( value, std::move( patch ) );
102-
return std::move( value );
101+
patch_inplace( v, std::move( patch ) );
102+
return std::move( v );
103103
}
104104

105105
} // namespace json

include/tao/json/reference.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ namespace tao
6969
p = p->at( it->index() ).skip_raw_ptr();
7070
break;
7171
case type::OBJECT:
72-
if( const auto* r = p->find( "$ref" ) ) {
73-
if( r->is_string() ) {
72+
if( const auto* t = p->find( "$ref" ) ) {
73+
if( t->is_string() ) {
7474
throw std::runtime_error( "invalid JSON Reference: referencing additional data members is invalid" );
7575
}
7676
}

include/tao/json/schema.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,8 @@ namespace tao
727727
try {
728728
m_pattern_properties.emplace_back( std::regex( e.first ), e.second.skip_raw_ptr() );
729729
}
730-
catch( const std::regex_error& e ) {
731-
throw std::runtime_error( "invalid JSON Schema: keys in object \"patternProperties\" must be regular expressions: " + std::string( e.what() ) );
730+
catch( const std::regex_error& ex ) {
731+
throw std::runtime_error( "invalid JSON Schema: keys in object \"patternProperties\" must be regular expressions: " + std::string( ex.what() ) );
732732
}
733733
m_referenced_pointers.insert( e.second.skip_raw_ptr() );
734734
}

0 commit comments

Comments
 (0)