Remove "using namespace std;".

This commit is contained in:
John Hood
2018-08-15 01:56:53 -04:00
parent fb23168ed9
commit 756f4f8e98
13 changed files with 16 additions and 24 deletions
-1
View File
@@ -44,7 +44,6 @@
#include "fatal_assert.h"
#include "prng.h"
using namespace std;
using namespace Crypto;
long int myatoi( const char *str )
+4 -5
View File
@@ -37,7 +37,6 @@
#include "crypto.h"
using namespace Crypto;
using namespace std;
int main( int argc, char *argv[] )
{
@@ -51,8 +50,8 @@ int main( int argc, char *argv[] )
Session session( key );
/* Read input */
ostringstream input;
input << cin.rdbuf();
std::ostringstream input;
input << std::cin.rdbuf();
/* Decrypt message */
@@ -60,9 +59,9 @@ int main( int argc, char *argv[] )
fprintf( stderr, "Nonce = %ld\n",
(long)message.nonce.val() );
cout << message.text;
std::cout << message.text;
} catch ( const CryptoException &e ) {
cerr << e.what() << endl;
std::cerr << e.what() << std::endl;
exit( 1 );
}
+5 -6
View File
@@ -37,7 +37,6 @@
#include "crypto.h"
using namespace Crypto;
using namespace std;
int main( int argc, char *argv[] )
{
@@ -52,18 +51,18 @@ int main( int argc, char *argv[] )
Nonce nonce( myatoi( argv[ 1 ] ) );
/* Read input */
ostringstream input;
input << cin.rdbuf();
std::ostringstream input;
input << std::cin.rdbuf();
/* Encrypt message */
string ciphertext = session.encrypt( Message( nonce, input.str() ) );
cerr << "Key: " << key.printable_key() << endl;
std::cerr << "Key: " << key.printable_key() << std::endl;
cout << ciphertext;
std::cout << ciphertext;
} catch ( const CryptoException &e ) {
cerr << e.what() << endl;
std::cerr << e.what() << std::endl;
exit( 1 );
}
+1 -2
View File
@@ -107,7 +107,6 @@ static int run_server( const char *desired_ip, const char *desired_port,
const string &command_path, char *command_argv[],
const int colors, unsigned int verbose, bool with_motd );
using namespace std;
static void print_version( FILE *file )
{
@@ -150,7 +149,7 @@ static string get_SSH_IP( void )
fputs( "Warning: SSH_CONNECTION not found; binding to any interface.\n", stderr );
return string( "" );
}
istringstream ss( SSH_CONNECTION );
std::istringstream ss( SSH_CONNECTION );
string dummy, local_interface_IP;
ss >> dummy >> dummy >> local_interface_IP;
if ( !ss ) {
+2
View File
@@ -63,6 +63,8 @@
#include "networktransport-impl.h"
using std::wstring;
void STMClient::resume( void )
{
/* Restore termios state */
-1
View File
@@ -36,7 +36,6 @@
#include "dos_assert.h"
using namespace Network;
using namespace std;
string Compressor::compress_str( const string &input )
{
-1
View File
@@ -60,7 +60,6 @@
#define AI_NUMERICSERV 0
#endif
using namespace std;
using namespace Network;
using namespace Crypto;
-1
View File
@@ -38,7 +38,6 @@
#include "transportsender-impl.h"
using namespace Network;
using namespace std;
template <class MyState, class RemoteState>
Transport<MyState, RemoteState>::Transport( MyState &initial_state, RemoteState &initial_remote,
-1
View File
@@ -45,7 +45,6 @@
#include <limits.h>
using namespace Network;
using namespace std;
template <class MyState>
TransportSender<MyState>::TransportSender( Connection *s_connection, MyState &initial_state )
+1 -1
View File
@@ -161,7 +161,7 @@ bool Complete::set_echo_ack( uint64_t now )
void Complete::register_input_frame( uint64_t n, uint64_t now )
{
input_history.push_back( make_pair( n, now ) );
input_history.push_back( std::make_pair( n, now ) );
}
int Complete::wait_time( uint64_t now ) const
-1
View File
@@ -40,7 +40,6 @@
#include "parseraction.h"
using namespace Terminal;
using namespace std;
/* Terminal functions -- routines activated by CSI, escape or a control char */
+1 -1
View File
@@ -34,7 +34,7 @@
#include "terminaluserinput.h"
using namespace Terminal;
using namespace std;
using std::string;
string UserInput::input( const Parser::UserByte *act,
bool application_mode_cursor_keys )
+2 -3
View File
@@ -45,12 +45,11 @@
#include "locale_utils.h"
using namespace std;
const string LocaleVar::str( void ) const
const std::string LocaleVar::str( void ) const
{
if ( name.empty() ) {
return string( "[no charset variables]" );
return std::string( "[no charset variables]" );
}
return name + "=" + value;
}