Skip to content

Commit 2392f34

Browse files
committed
GH pocoproject#127: Eliminate -Wshadow warnings
- fixed GH pocoproject#127: Eliminate -Wshadow warnings - SocketAddress small object optimization
1 parent 42ff341 commit 2392f34

27 files changed

Lines changed: 538 additions & 277 deletions

‎CHANGELOG‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Release 1.5.2 (2013-03-??)
2727
- added PrintHandler
2828
- renamed DefaultHandler to ParseHandler
2929
- redefined DefaultHandler as typedef to ParseHandler
30+
- fixed GH #127: Eliminate -Wshadow warnings
31+
- SocketAddress small object optimization
3032

3133
Release 1.5.1 (2013-01-11)
3234
==========================

‎Foundation/include/Poco/Timespan.h‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Foundation_API Timespan
6363
/// Creates a Timespan. Useful for creating
6464
/// a Timespan from a struct timeval.
6565

66-
Timespan(int days, int hours, int minutes, int seconds, int microseconds);
66+
Timespan(int days, int hours, int minutes, int seconds, int microSeconds);
6767
/// Creates a Timespan.
6868

6969
Timespan(const Timespan& timespan);
@@ -78,7 +78,7 @@ class Foundation_API Timespan
7878
Timespan& operator = (TimeDiff microseconds);
7979
/// Assignment operator.
8080

81-
Timespan& assign(int days, int hours, int minutes, int seconds, int microseconds);
81+
Timespan& assign(int days, int hours, int minutes, int seconds, int microSeconds);
8282
/// Assigns a new span.
8383

8484
Timespan& assign(long seconds, long microseconds);
@@ -95,22 +95,22 @@ class Foundation_API Timespan
9595
bool operator < (const Timespan& ts) const;
9696
bool operator <= (const Timespan& ts) const;
9797

98-
bool operator == (TimeDiff microseconds) const;
99-
bool operator != (TimeDiff microseconds) const;
100-
bool operator > (TimeDiff microseconds) const;
101-
bool operator >= (TimeDiff microseconds) const;
102-
bool operator < (TimeDiff microseconds) const;
103-
bool operator <= (TimeDiff microseconds) const;
98+
bool operator == (TimeDiff microSeconds) const;
99+
bool operator != (TimeDiff microSeconds) const;
100+
bool operator > (TimeDiff microSeconds) const;
101+
bool operator >= (TimeDiff microSeconds) const;
102+
bool operator < (TimeDiff microSeconds) const;
103+
bool operator <= (TimeDiff microSeconds) const;
104104

105105
Timespan operator + (const Timespan& d) const;
106106
Timespan operator - (const Timespan& d) const;
107107
Timespan& operator += (const Timespan& d);
108108
Timespan& operator -= (const Timespan& d);
109109

110-
Timespan operator + (TimeDiff microseconds) const;
111-
Timespan operator - (TimeDiff microseconds) const;
112-
Timespan& operator += (TimeDiff microseconds);
113-
Timespan& operator -= (TimeDiff microseconds);
110+
Timespan operator + (TimeDiff microSeconds) const;
111+
Timespan operator - (TimeDiff microSeconds) const;
112+
Timespan& operator += (TimeDiff microSeconds);
113+
Timespan& operator -= (TimeDiff microSeconds);
114114

115115
int days() const;
116116
/// Returns the number of days.
@@ -272,39 +272,39 @@ inline bool Timespan::operator <= (const Timespan& ts) const
272272
}
273273

274274

275-
inline bool Timespan::operator == (TimeDiff microseconds) const
275+
inline bool Timespan::operator == (TimeDiff microSeconds) const
276276
{
277-
return _span == microseconds;
277+
return _span == microSeconds;
278278
}
279279

280280

281-
inline bool Timespan::operator != (TimeDiff microseconds) const
281+
inline bool Timespan::operator != (TimeDiff microSeconds) const
282282
{
283-
return _span != microseconds;
283+
return _span != microSeconds;
284284
}
285285

286286

287-
inline bool Timespan::operator > (TimeDiff microseconds) const
287+
inline bool Timespan::operator > (TimeDiff microSeconds) const
288288
{
289-
return _span > microseconds;
289+
return _span > microSeconds;
290290
}
291291

292292

293-
inline bool Timespan::operator >= (TimeDiff microseconds) const
293+
inline bool Timespan::operator >= (TimeDiff microSeconds) const
294294
{
295-
return _span >= microseconds;
295+
return _span >= microSeconds;
296296
}
297297

298298

299-
inline bool Timespan::operator < (TimeDiff microseconds) const
299+
inline bool Timespan::operator < (TimeDiff microSeconds) const
300300
{
301-
return _span < microseconds;
301+
return _span < microSeconds;
302302
}
303303

304304

305-
inline bool Timespan::operator <= (TimeDiff microseconds) const
305+
inline bool Timespan::operator <= (TimeDiff microSeconds) const
306306
{
307-
return _span <= microseconds;
307+
return _span <= microSeconds;
308308
}
309309

310310

‎Foundation/src/Timespan.cpp‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ Timespan::Timespan():
5454
}
5555

5656

57-
Timespan::Timespan(TimeDiff microseconds):
58-
_span(microseconds)
57+
Timespan::Timespan(TimeDiff microSeconds):
58+
_span(microSeconds)
5959
{
6060
}
6161

6262

63-
Timespan::Timespan(long seconds, long microseconds):
64-
_span(TimeDiff(seconds)*SECONDS + microseconds)
63+
Timespan::Timespan(long seconds, long microSeconds):
64+
_span(TimeDiff(seconds)*SECONDS + microSeconds)
6565
{
6666
}
6767

6868

69-
Timespan::Timespan(int days, int hours, int minutes, int seconds, int microseconds):
70-
_span(TimeDiff(microseconds) + TimeDiff(seconds)*SECONDS + TimeDiff(minutes)*MINUTES + TimeDiff(hours)*HOURS + TimeDiff(days)*DAYS)
69+
Timespan::Timespan(int days, int hours, int minutes, int seconds, int microSeconds):
70+
_span(TimeDiff(microSeconds) + TimeDiff(seconds)*SECONDS + TimeDiff(minutes)*MINUTES + TimeDiff(hours)*HOURS + TimeDiff(days)*DAYS)
7171
{
7272
}
7373

@@ -90,23 +90,23 @@ Timespan& Timespan::operator = (const Timespan& timespan)
9090
}
9191

9292

93-
Timespan& Timespan::operator = (TimeDiff microseconds)
93+
Timespan& Timespan::operator = (TimeDiff microSeconds)
9494
{
95-
_span = microseconds;
95+
_span = microSeconds;
9696
return *this;
9797
}
9898

9999

100-
Timespan& Timespan::assign(int days, int hours, int minutes, int seconds, int microseconds)
100+
Timespan& Timespan::assign(int days, int hours, int minutes, int seconds, int microSeconds)
101101
{
102-
_span = TimeDiff(microseconds) + TimeDiff(seconds)*SECONDS + TimeDiff(minutes)*MINUTES + TimeDiff(hours)*HOURS + TimeDiff(days)*DAYS;
102+
_span = TimeDiff(microSeconds) + TimeDiff(seconds)*SECONDS + TimeDiff(minutes)*MINUTES + TimeDiff(hours)*HOURS + TimeDiff(days)*DAYS;
103103
return *this;
104104
}
105105

106106

107-
Timespan& Timespan::assign(long seconds, long microseconds)
107+
Timespan& Timespan::assign(long seconds, long microSeconds)
108108
{
109-
_span = TimeDiff(seconds)*SECONDS + TimeDiff(microseconds);
109+
_span = TimeDiff(seconds)*SECONDS + TimeDiff(microSeconds);
110110
return *this;
111111
}
112112

@@ -143,28 +143,28 @@ Timespan& Timespan::operator -= (const Timespan& d)
143143
}
144144

145145

146-
Timespan Timespan::operator + (TimeDiff microseconds) const
146+
Timespan Timespan::operator + (TimeDiff microSeconds) const
147147
{
148-
return Timespan(_span + microseconds);
148+
return Timespan(_span + microSeconds);
149149
}
150150

151151

152-
Timespan Timespan::operator - (TimeDiff microseconds) const
152+
Timespan Timespan::operator - (TimeDiff microSeconds) const
153153
{
154-
return Timespan(_span - microseconds);
154+
return Timespan(_span - microSeconds);
155155
}
156156

157157

158-
Timespan& Timespan::operator += (TimeDiff microseconds)
158+
Timespan& Timespan::operator += (TimeDiff microSeconds)
159159
{
160-
_span += microseconds;
160+
_span += microSeconds;
161161
return *this;
162162
}
163163

164164

165-
Timespan& Timespan::operator -= (TimeDiff microseconds)
165+
Timespan& Timespan::operator -= (TimeDiff microSeconds)
166166
{
167-
_span -= microseconds;
167+
_span -= microSeconds;
168168
return *this;
169169
}
170170

‎Net/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SHAREDOPT_CXX += -DNet_EXPORTS
1212

1313
objects = \
1414
DNS HTTPResponse HostEntry Socket \
15-
DatagramSocket HTTPServer IPAddress IPAddressImpl SocketAddress \
15+
DatagramSocket HTTPServer IPAddress IPAddressImpl SocketAddress SocketAddress \
1616
HTTPBasicCredentials HTTPCookie HTMLForm MediaType DialogSocket \
1717
DatagramSocketImpl FilePartSource HTTPServerConnection MessageHeader \
1818
HTTPChunkedStream HTTPServerConnectionFactory MulticastSocket SocketStream \

‎Net/Net_CE_vs90.vcproj‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@
448448
RelativePath=".\include\Poco\Net\NetworkInterface.h"/>
449449
<File
450450
RelativePath=".\include\Poco\Net\SocketAddress.h"/>
451+
<File
452+
RelativePath=".\include\Poco\Net\SocketAddressImpl.h"/>
451453
<File
452454
RelativePath=".\include\Poco\Net\SocketDefs.h"/>
453455
</Filter>
@@ -469,6 +471,8 @@
469471
RelativePath=".\src\NetworkInterface.cpp"/>
470472
<File
471473
RelativePath=".\src\SocketAddress.cpp"/>
474+
<File
475+
RelativePath=".\src\SocketAddressImpl.cpp"/>
472476
</Filter>
473477
</Filter>
474478
<Filter

‎Net/Net_vs100.vcxproj‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@
278278
<ClInclude Include="include\Poco\Net\ParallelSocketReactor.h" />
279279
<ClInclude Include="include\Poco\Net\PartStore.h" />
280280
<ClInclude Include="include\Poco\Net\SocketAddress.h" />
281+
<ClInclude Include="include\Poco\Net\SocketAddressImpl.h" />
281282
<ClInclude Include="include\Poco\Net\SocketDefs.h" />
282283
<ClInclude Include="include\Poco\Net\DatagramSocket.h" />
283284
<ClInclude Include="include\Poco\Net\DatagramSocketImpl.h" />
@@ -386,6 +387,7 @@
386387
<ClCompile Include="src\ServerSocket.cpp" />
387388
<ClCompile Include="src\ServerSocketImpl.cpp" />
388389
<ClCompile Include="src\Socket.cpp" />
390+
<ClCompile Include="src\SocketAddressImpl.cpp" />
389391
<ClCompile Include="src\SocketImpl.cpp" />
390392
<ClCompile Include="src\SocketStream.cpp" />
391393
<ClCompile Include="src\StreamSocket.cpp" />

‎Net/Net_vs100.vcxproj.filters‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@
426426
<ClInclude Include="include\Poco\Net\PartStore.h">
427427
<Filter>Messages\Header Files</Filter>
428428
</ClInclude>
429+
<ClInclude Include="include\Poco\Net\SocketAddressImpl.h">
430+
<Filter>NetCore\Header Files</Filter>
431+
</ClInclude>
429432
</ItemGroup>
430433
<ItemGroup>
431434
<ClCompile Include="src\DNS.cpp">
@@ -707,6 +710,9 @@
707710
<ClCompile Include="src\PartStore.cpp">
708711
<Filter>Messages\Source Files</Filter>
709712
</ClCompile>
713+
<ClCompile Include="src\SocketAddressImpl.cpp">
714+
<Filter>NetCore\Source Files</Filter>
715+
</ClCompile>
710716
</ItemGroup>
711717
<ItemGroup>
712718
<ResourceCompile Include="..\DLLVersion.rc" />

‎Net/Net_vs110.vcxproj‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@
281281
<ClInclude Include="include\Poco\Net\NetException.h"/>
282282
<ClInclude Include="include\Poco\Net\NetworkInterface.h"/>
283283
<ClInclude Include="include\Poco\Net\SocketAddress.h"/>
284+
<ClInclude Include="include\Poco\Net\SocketAddressImpl.h"/>
284285
<ClInclude Include="include\Poco\Net\SocketDefs.h"/>
285286
<ClInclude Include="include\Poco\Net\DatagramSocket.h"/>
286287
<ClInclude Include="include\Poco\Net\DatagramSocketImpl.h"/>
@@ -382,6 +383,7 @@
382383
<ClCompile Include="src\NetException.cpp"/>
383384
<ClCompile Include="src\NetworkInterface.cpp"/>
384385
<ClCompile Include="src\SocketAddress.cpp"/>
386+
<ClCompile Include="src\SocketAddressImpl.cpp"/>
385387
<ClCompile Include="src\DatagramSocket.cpp"/>
386388
<ClCompile Include="src\DatagramSocketImpl.cpp"/>
387389
<ClCompile Include="src\DialogSocket.cpp"/>

‎Net/Net_vs110.vcxproj.filters‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@
153153
<ClInclude Include="include\Poco\Net\SocketAddress.h">
154154
<Filter>NetCore\Header Files</Filter>
155155
</ClInclude>
156+
<ClInclude Include="include\Poco\Net\SocketAddressImpl.h">
157+
<Filter>NetCore\Header Files</Filter>
158+
</ClInclude>
156159
<ClInclude Include="include\Poco\Net\SocketDefs.h">
157160
<Filter>NetCore\Header Files</Filter>
158161
</ClInclude>
@@ -452,6 +455,9 @@
452455
<ClCompile Include="src\SocketAddress.cpp">
453456
<Filter>NetCore\Source Files</Filter>
454457
</ClCompile>
458+
<ClCompile Include="src\SocketAddressImpl.cpp">
459+
<Filter>NetCore\Source Files</Filter>
460+
</ClCompile>
455461
<ClCompile Include="src\DatagramSocket.cpp">
456462
<Filter>Sockets\Source Files</Filter>
457463
</ClCompile>

‎Net/Net_vs71.vcproj‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@
380380
RelativePath=".\include\Poco\Net\NetworkInterface.h"/>
381381
<File
382382
RelativePath=".\include\Poco\Net\SocketAddress.h"/>
383+
<File
384+
RelativePath=".\include\Poco\Net\SocketAddressImpl.h"/>
383385
<File
384386
RelativePath=".\include\Poco\Net\SocketDefs.h"/>
385387
</Filter>
@@ -401,6 +403,8 @@
401403
RelativePath=".\src\NetworkInterface.cpp"/>
402404
<File
403405
RelativePath=".\src\SocketAddress.cpp"/>
406+
<File
407+
RelativePath=".\src\SocketAddressImpl.cpp"/>
404408
</Filter>
405409
</Filter>
406410
<Filter

0 commit comments

Comments
 (0)