From: Tomek Mrugalski Date: Wed, 22 Jun 2016 15:24:16 +0000 (+0200) Subject: [github21] Minor clean-up in CQL code X-Git-Tag: trac4283_base~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85f6feb58d2cc3d8f02362c099df047b3a412d82;p=thirdparty%2Fkea.git [github21] Minor clean-up in CQL code --- diff --git a/src/lib/dhcpsrv/cql_connection.cc b/src/lib/dhcpsrv/cql_connection.cc index 3a4b920f27..2b92631184 100644 --- a/src/lib/dhcpsrv/cql_connection.cc +++ b/src/lib/dhcpsrv/cql_connection.cc @@ -119,14 +119,14 @@ CqlConnection::openDatabase() { } if (port != NULL) { - int port_nr; + int port_number; try { - port_nr = boost::lexical_cast(port); + port_number = boost::lexical_cast(port); } catch (const std::exception& ex) { isc_throw(DbOperationError, "Invalid int data: " << port << " : " << ex.what()); } - cass_cluster_set_port(cluster_, port_nr); + cass_cluster_set_port(cluster_, port_number); } session_ = cass_session_new(); @@ -187,7 +187,7 @@ CqlConnection::rollback() { void CqlConnection::checkStatementError(std::string& error, CassFuture* future, - uint32_t stindex, const char* what) const { + uint32_t stindex, const char* what) const { CassError rc; const char* errorMessage; size_t errorMessageSize; @@ -199,15 +199,15 @@ CqlConnection::checkStatementError(std::string& error, CassFuture* future, if (rc != CASS_OK) { stream.str(std::string()); - stream << what << " for: " << tagged_statements_[stindex].name_ << - " reason: " << errorMessage << " error code: " << rc; + stream << what << " for: " << tagged_statements_[stindex].name_ + << " reason: " << errorMessage << " error code: " << rc; } error = stream.str(); } void CqlConnection::checkStatementError(std::string& error, CassFuture* future, - const char* what) const { + const char* what) const { CassError rc; const char* errorMessage; size_t errorMessageSize; diff --git a/src/lib/dhcpsrv/cql_lease_mgr.cc b/src/lib/dhcpsrv/cql_lease_mgr.cc index 630110c57c..e788976bf7 100644 --- a/src/lib/dhcpsrv/cql_lease_mgr.cc +++ b/src/lib/dhcpsrv/cql_lease_mgr.cc @@ -39,6 +39,8 @@ static const size_t ADDRESS6_TEXT_MAX_LEN = 39U; /// @name CqlBind auxiliary methods for binding data into Cassandra format: /// @{ + +/// @todo These void* cast are unsafe. See ticket #4525. static CassError CqlBindNone(CassStatement* statement, size_t index, void*) { return cass_statement_bind_null(statement, index); }