From: Steinar H. Gunderson Date: Fri, 7 Aug 2015 22:20:00 +0000 (+0200) Subject: Remove std:: from all code in .cpp files, for consistency. X-Git-Tag: 1.2.1~5 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=b757a4a2ce9d24835b52a185134835762af2f50c Remove std:: from all code in .cpp files, for consistency. --- diff --git a/httpinput.cpp b/httpinput.cpp index 7853388..374441c 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -200,7 +200,7 @@ int HTTPInput::lookup_and_connect(const string &host, const string &port) return -1; } -bool HTTPInput::parse_response(const std::string &request) +bool HTTPInput::parse_response(const string &request) { vector lines = split_lines(response); if (lines.empty()) { diff --git a/input.cpp b/input.cpp index f5d8d5e..bbd2c3a 100644 --- a/input.cpp +++ b/input.cpp @@ -94,7 +94,7 @@ bool parse_url(const string &url, string *protocol, string *user, string *host, return true; } -Input *create_input(const std::string &url) +Input *create_input(const string &url) { string protocol, user, host, port, path; if (!parse_url(url, &protocol, &user, &host, &port, &path)) { diff --git a/log.cpp b/log.cpp index b20a89f..409639f 100644 --- a/log.cpp +++ b/log.cpp @@ -17,9 +17,9 @@ using namespace std; #define SYSLOG_FAKE_FILE (static_cast(NULL)) bool logging_started = false; -std::vector log_destinations; +vector log_destinations; -void add_log_destination_file(const std::string &filename) +void add_log_destination_file(const string &filename) { FILE *fp = fopen(filename.c_str(), "a"); if (fp == NULL) { diff --git a/main.cpp b/main.cpp index ef75277..98d0948 100644 --- a/main.cpp +++ b/main.cpp @@ -248,7 +248,7 @@ void open_logs(const vector &log_destinations) start_logging(); } -bool dry_run_config(const std::string &argv0, const std::string &config_filename) +bool dry_run_config(const string &argv0, const string &config_filename) { char *argv0_copy = strdup(argv0.c_str()); char *config_filename_copy = strdup(config_filename.c_str()); diff --git a/server.cpp b/server.cpp index 9ff4758..72664e3 100644 --- a/server.cpp +++ b/server.cpp @@ -149,7 +149,7 @@ void Server::do_work() // If this client doesn't exist anymore, just ignore it // (it was deleted earlier). - std::map::iterator client_it = clients.find(connect_time_and_fd.second); + map::iterator client_it = clients.find(connect_time_and_fd.second); if (client_it == clients.end()) { clients_ordered_by_connect_time.pop(); continue; @@ -286,7 +286,7 @@ void Server::add_client_from_serialized(const ClientProto &client) } } -int Server::lookup_stream_by_url(const std::string &url) const +int Server::lookup_stream_by_url(const string &url) const { map::const_iterator url_it = url_map.find(url); if (url_it == url_map.end()) { @@ -472,7 +472,7 @@ sending_header_or_error_again: Stream *stream = client->stream; if (client->stream_pos == size_t(-2)) { // Start sending from the beginning of the backlog. - client->stream_pos = std::min( + client->stream_pos = min( stream->bytes_received - stream->backlog_size, 0); client->state = Client::SENDING_DATA; diff --git a/serverpool.cpp b/serverpool.cpp index a834e8c..a598ecd 100644 --- a/serverpool.cpp +++ b/serverpool.cpp @@ -67,7 +67,7 @@ void ServerPool::add_client_from_serialized(const ClientProto &client) servers[clients_added++ % num_servers].add_client_from_serialized(client); } -int ServerPool::lookup_stream_by_url(const std::string &url) const +int ServerPool::lookup_stream_by_url(const string &url) const { assert(servers != NULL); return servers[0].lookup_stream_by_url(url); diff --git a/stats.cpp b/stats.cpp index 5cfa669..661a17b 100644 --- a/stats.cpp +++ b/stats.cpp @@ -17,7 +17,7 @@ using namespace std; extern ServerPool *servers; -StatsThread::StatsThread(const std::string &stats_file, int stats_interval) +StatsThread::StatsThread(const string &stats_file, int stats_interval) : stats_file(stats_file), stats_interval(stats_interval) { diff --git a/stream.cpp b/stream.cpp index d416803..64bf2e8 100644 --- a/stream.cpp +++ b/stream.cpp @@ -144,7 +144,7 @@ void Stream::put_client_to_sleep(Client *client) vector collect_iovecs(const vector &data, size_t bytes_wanted) { vector ret; - size_t max_iovecs = std::min(data.size(), IOV_MAX); + size_t max_iovecs = min(data.size(), IOV_MAX); for (size_t i = 0; i < max_iovecs && bytes_wanted > 0; ++i) { if (data[i].data.iov_len <= bytes_wanted) { // Consume the entire iovec. @@ -264,7 +264,7 @@ void Stream::add_data_deferred(const char *data, size_t bytes, StreamStartSuitab void Stream::process_queued_data() { - std::vector queued_data_copy; + vector queued_data_copy; // Hold the lock for as short as possible, since add_data_raw() can possibly // write to disk, which might disturb the input thread. diff --git a/util.cpp b/util.cpp index 8f42a98..a85de44 100644 --- a/util.cpp +++ b/util.cpp @@ -16,7 +16,7 @@ using namespace std; -int make_tempfile(const std::string &contents) +int make_tempfile(const string &contents) { int fd = open("/tmp", O_RDWR | O_TMPFILE, 0600); if (fd == -1) { @@ -52,14 +52,14 @@ int make_tempfile(const std::string &contents) return fd; } -bool read_tempfile_and_close(int fd, std::string *contents) +bool read_tempfile_and_close(int fd, string *contents) { bool ok = read_tempfile(fd, contents); safe_close(fd); // Implicitly deletes the file. return ok; } -bool read_tempfile(int fd, std::string *contents) +bool read_tempfile(int fd, string *contents) { ssize_t ret, has_read;