]> git.saurik.com Git - wxWidgets.git/commitdiff
fix (harmless) VC7 warnings about auto_ptr assignment
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 23 Nov 2008 00:09:34 +0000 (00:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 23 Nov 2008 00:09:34 +0000 (00:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/net/socket.cpp

index 332b3976e120724c9618ba34bb50166272d06b4e..0a8200f649f2f2f7db6521cd243e8b95a8073b28 100644 (file)
@@ -72,26 +72,21 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SocketTestCase, "SocketTestCase" );
 
 wxSockAddressPtr SocketTestCase::GetServer() const
 {
-    wxSockAddressPtr ptr;
-    if ( !gs_serverHost.empty() )
-    {
-        wxIPV4address *addr = new wxIPV4address;
-        addr->Hostname(gs_serverHost);
-        addr->Service("www");
+    if ( gs_serverHost.empty() )
+        return wxSockAddressPtr();
 
-        ptr = wxSockAddressPtr(addr);
-    }
+    wxIPV4address *addr = new wxIPV4address;
+    addr->Hostname(gs_serverHost);
+    addr->Service("www");
 
-    return ptr;
+    return wxSockAddressPtr(addr);
 }
 
 wxSocketClientPtr SocketTestCase::GetHTTPSocket(int flags) const
 {
-    wxSocketClientPtr ptr;
-
     wxSockAddressPtr addr = GetServer();
     if ( !addr.get() )
-        return ptr;
+        return wxSocketClientPtr();
 
     wxSocketClient *sock = new wxSocketClient(flags);
     sock->SetTimeout(1);
@@ -104,8 +99,7 @@ wxSocketClientPtr SocketTestCase::GetHTTPSocket(int flags) const
 
     sock->Write(httpGetRoot.ToAscii(), httpGetRoot.length());
 
-    ptr = wxSocketClientPtr(sock);
-    return ptr;
+    return wxSocketClientPtr(sock);
 }
 
 void SocketTestCase::BlockingConnect()