base: Stop "using namespace std".

As the std namespace expands, it becomes more and more likely that
blanketly importing all its symbols will cause a collision. Also, when
it was imported, the std:: was used or left off arbitrarily, sometimes
inconsistently even in the same function signature.

Change-Id: Ie30cbab154b00c60433908a206c229230d2b109f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39536
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
This commit is contained in:
Gabe Black
2021-01-20 22:41:42 -08:00
parent ee0fdc948a
commit f5c18ada1b
19 changed files with 183 additions and 216 deletions

View File

@@ -43,8 +43,6 @@
#include "base/types.hh"
#include "sim/byteswap.hh"
using namespace std;
bool ListenSocket::listeningDisabled = false;
bool ListenSocket::anyListening = false;
@@ -121,7 +119,7 @@ ListenSocket::listen(int port, bool reuse)
htobe<in_addr_t>(bindToLoopback ? INADDR_LOOPBACK : INADDR_ANY);
sockaddr.sin_port = htons(port);
// finally clear sin_zero
memset(&sockaddr.sin_zero, 0, sizeof(sockaddr.sin_zero));
std::memset(&sockaddr.sin_zero, 0, sizeof(sockaddr.sin_zero));
int ret = ::bind(fd, (struct sockaddr *)&sockaddr, sizeof (sockaddr));
if (ret != 0) {
if (ret == -1 && errno != EADDRINUSE)