From 880ae66bd9aeb072b35b17168adec45aa6e22b9c Mon Sep 17 00:00:00 2001 From: Euler Taveira de Oliveira Date: Wed, 18 Dec 2013 20:33:31 -0300 Subject: [PATCH] Replace C++ comments. --- src/client.c | 14 +++++++++----- src/janitor.c | 2 +- src/objects.c | 8 ++++---- src/sbuf.c | 6 +++--- test/asynctest.c | 6 +++--- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/client.c b/src/client.c index 8ad9b17..8eff818 100644 --- a/src/client.c +++ b/src/client.c @@ -268,8 +268,10 @@ bool handle_auth_response(PgSocket *client, PktHdr *pkt) { return false; } if (length == (uint32_t)-1) { - // NULL - set an md5 password with an impossible value, - // so that nothing will ever match + /* + * NULL - set an md5 password with an impossible value, + * so that nothing will ever match + */ password = "md5"; length = 3; } else { @@ -305,9 +307,11 @@ bool handle_auth_response(PgSocket *client, PktHdr *pkt) { client->link->resetting = true; sbuf_continue(&client->sbuf); } - // either sbuf_continue or disconnect_client could disconnect the server - // way down in their bowels of other callbacks. so check that, and - // return appropriately (similar to reuse_on_release) + /* + * either sbuf_continue or disconnect_client could disconnect the server + * way down in their bowels of other callbacks. so check that, and + * return appropriately (similar to reuse_on_release) + */ if (server->state == SV_FREE || server->state == SV_JUSTFREE) return false; return true; diff --git a/src/janitor.c b/src/janitor.c index b51fbdd..167a62e 100644 --- a/src/janitor.c +++ b/src/janitor.c @@ -334,7 +334,7 @@ static void pool_client_maint(PgPool *pool) Assert(client->state == CL_WAITING || client->state == CL_WAITING_LOGIN); if (client->query_start == 0) { age = now - client->request_time; - //log_warning("query_start==0"); + /* log_warning("query_start==0"); */ } else age = now - client->query_start; diff --git a/src/objects.c b/src/objects.c index c321fa3..7ce1566 100644 --- a/src/objects.c +++ b/src/objects.c @@ -949,7 +949,7 @@ static void dns_connect(struct PgSocket *server) sa = (struct sockaddr *)&sa_un; sa_len = sizeof(sa_un); res = 1; - } else if (strchr(host, ':')) { // assume IPv6 address on any : in addr + } else if (strchr(host, ':')) { /* assume IPv6 address on any : in addr */ slog_noise(server, "inet6 socket: %s", db->host); memset(&sa_in6, 0, sizeof(sa_in6)); sa_in6.sin6_family = AF_INET6; @@ -957,7 +957,7 @@ static void dns_connect(struct PgSocket *server) sa_in6.sin6_port = htons(db->port); sa = (struct sockaddr *)&sa_in6; sa_len = sizeof(sa_in6); - } else { // else try IPv4 + } else { /* else try IPv4 */ slog_noise(server, "inet socket: %s", db->host); memset(&sa_in, 0, sizeof(sa_in)); sa_in.sin_family = AF_INET; @@ -1002,7 +1002,7 @@ bool evict_connection(PgDatabase *db) if (pool->db != db) continue; oldest_connection = compare_connections_by_time(oldest_connection, last_socket(&pool->idle_server_list)); - // only evict testing connections if nobody's waiting + /* only evict testing connections if nobody's waiting */ if (statlist_empty(&pool->waiting_client_list)) { oldest_connection = compare_connections_by_time(oldest_connection, last_socket(&pool->used_server_list)); oldest_connection = compare_connections_by_time(oldest_connection, last_socket(&pool->tested_server_list)); @@ -1059,7 +1059,7 @@ void launch_new_connection(PgPool *pool) allow_new: total = database_max_connections(pool->db); if (total > 0) { - // try to evict unused connections first + /* try to evict unused connections first */ while (pool->db->connection_count >= total) { if (!evict_connection(pool->db)) { break; diff --git a/src/sbuf.c b/src/sbuf.c index fe657f4..0a37584 100644 --- a/src/sbuf.c +++ b/src/sbuf.c @@ -260,7 +260,7 @@ void sbuf_prepare_send(SBuf *sbuf, SBuf *dst, unsigned amount) { AssertActive(sbuf); Assert(sbuf->pkt_remain == 0); - //Assert(sbuf->pkt_action == ACT_UNSET || sbuf->pkt_action == ACT_SEND || iobuf_amount_pending(&sbuf->io)); + /* Assert(sbuf->pkt_action == ACT_UNSET || sbuf->pkt_action == ACT_SEND || iobuf_amount_pending(&sbuf->io)); */ Assert(amount > 0); sbuf->pkt_action = ACT_SEND; @@ -273,7 +273,7 @@ void sbuf_prepare_skip(SBuf *sbuf, unsigned amount) { AssertActive(sbuf); Assert(sbuf->pkt_remain == 0); - //Assert(sbuf->pkt_action == ACT_UNSET || iobuf_send_pending_avail(&sbuf->io)); + /* Assert(sbuf->pkt_action == ACT_UNSET || iobuf_send_pending_avail(&sbuf->io)); */ Assert(amount > 0); sbuf->pkt_action = ACT_SKIP; @@ -285,7 +285,7 @@ void sbuf_prepare_fetch(SBuf *sbuf, unsigned amount) { AssertActive(sbuf); Assert(sbuf->pkt_remain == 0); - //Assert(sbuf->pkt_action == ACT_UNSET || iobuf_send_pending_avail(&sbuf->io)); + /* Assert(sbuf->pkt_action == ACT_UNSET || iobuf_send_pending_avail(&sbuf->io)); */ Assert(amount > 0); sbuf->pkt_action = ACT_CALL; diff --git a/test/asynctest.c b/test/asynctest.c index d6777cb..a290d97 100644 --- a/test/asynctest.c +++ b/test/asynctest.c @@ -35,9 +35,9 @@ typedef struct DbConn { PGconn *con; bool logged_in; - //time_t connect_time; + /* time_t connect_time; */ int query_count; - //const char *query; + /* const char *query; */ int _arglen; } DbConn; @@ -232,7 +232,7 @@ static bool another_result(DbConn *db) switch (PQresultStatus(res)) { case PGRES_TUPLES_OK: - // todo: check result + /* todo: check result */ if (db->_arglen > 0) { int curlen = strlen(PQgetvalue(res, 0, 0)); if (curlen != db->_arglen) { -- 2.39.5