Skip to content

Commit 1ed4787

Browse files
committed
Fixing conversion warnings for mysql_options() on some systems
1 parent ed4a16e commit 1ed4787

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/connection.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,29 @@ void node_db_mysql::Connection::open() throw(node_db::Exception&) {
5959
}
6060

6161
if (this->compress) {
62-
mysql_options(this->connection, MYSQL_OPT_COMPRESS, 0);
62+
mysql_options(this->connection, MYSQL_OPT_COMPRESS, (const char*) 0);
6363
}
6464

6565
if (!this->initCommand.empty()) {
6666
mysql_options(this->connection, MYSQL_INIT_COMMAND, this->initCommand.c_str());
6767
}
6868

6969
if (this->readTimeout > 0) {
70-
mysql_options(this->connection, MYSQL_OPT_READ_TIMEOUT, &this->readTimeout);
70+
mysql_options(this->connection, MYSQL_OPT_READ_TIMEOUT, (const char*) &this->readTimeout);
7171
}
7272

7373
#if MYSQL_VERSION_ID >= 50013
74-
mysql_options(this->connection, MYSQL_OPT_RECONNECT, &this->reconnect);
74+
mysql_options(this->connection, MYSQL_OPT_RECONNECT, (const char*) &this->reconnect);
7575
#endif
7676

77-
mysql_options(this->connection, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &this->sslVerifyServer);
77+
mysql_options(this->connection, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char*) &this->sslVerifyServer);
7878

7979
if (this->timeout > 0) {
80-
mysql_options(this->connection, MYSQL_OPT_CONNECT_TIMEOUT, &this->timeout);
80+
mysql_options(this->connection, MYSQL_OPT_CONNECT_TIMEOUT, (const char*) &this->timeout);
8181
}
8282

8383
if (this->writeTimeout > 0) {
84-
mysql_options(this->connection, MYSQL_OPT_WRITE_TIMEOUT, &this->writeTimeout);
84+
mysql_options(this->connection, MYSQL_OPT_WRITE_TIMEOUT, (const char*) &this->writeTimeout);
8585
}
8686

8787
this->opened = mysql_real_connect(
@@ -96,7 +96,7 @@ void node_db_mysql::Connection::open() throw(node_db::Exception&) {
9696

9797
#if MYSQL_VERSION_ID >= 50013 && MYSQL_VERSION_ID < 50019
9898
// MySQL incorrectly resets the MYSQL_OPT_RECONNECT option to its default value before MySQL 5.0.19
99-
mysql_options(this->connection, MYSQL_OPT_RECONNECT, &this->reconnect);
99+
mysql_options(this->connection, MYSQL_OPT_RECONNECT, (const char*) &this->reconnect);
100100
#endif
101101

102102
if (!this->opened) {

0 commit comments

Comments
 (0)