MDEV-35632 HandlerSocket uses deprecated C++98 auto_ptr
Change uses of auto_ptr to unique_ptr
This commit is contained in:
parent
78157c4765
commit
86b257f870
@ -927,7 +927,7 @@ hs_longrun_main(int argc, char **argv)
|
|||||||
shared.verbose = shared.conf.get_int("verbose", 1);
|
shared.verbose = shared.conf.get_int("verbose", 1);
|
||||||
const int table_size = shared.conf.get_int("table_size", 10000);
|
const int table_size = shared.conf.get_int("table_size", 10000);
|
||||||
for (int i = 0; i < table_size; ++i) {
|
for (int i = 0; i < table_size; ++i) {
|
||||||
std::auto_ptr<record_value> rec(new record_value());
|
std::unique_ptr<record_value> rec(new record_value());
|
||||||
rec->key = to_stdstring(i);
|
rec->key = to_stdstring(i);
|
||||||
shared.records.push_back_ptr(rec);
|
shared.records.push_back_ptr(rec);
|
||||||
}
|
}
|
||||||
@ -966,7 +966,7 @@ hs_longrun_main(int argc, char **argv)
|
|||||||
int id = thrs.size();
|
int id = thrs.size();
|
||||||
const hs_longrun_thread_hs::arg_type arg(id, e.type, e.op, e.lock,
|
const hs_longrun_thread_hs::arg_type arg(id, e.type, e.op, e.lock,
|
||||||
shared);
|
shared);
|
||||||
std::auto_ptr<hs_longrun_thread_base> thr;
|
std::unique_ptr<hs_longrun_thread_base> thr;
|
||||||
if (e.hs) {
|
if (e.hs) {
|
||||||
thr.reset(new hs_longrun_thread_hs(arg));
|
thr.reset(new hs_longrun_thread_hs(arg));
|
||||||
} else {
|
} else {
|
||||||
|
@ -561,7 +561,7 @@ hstest_thread::test_9(int test_num)
|
|||||||
flds += std::string(buf);
|
flds += std::string(buf);
|
||||||
}
|
}
|
||||||
int connected = 0;
|
int connected = 0;
|
||||||
std::auto_ptr<auto_mysql_stmt> stmt;
|
std::unique_ptr<auto_mysql_stmt> stmt;
|
||||||
string_buffer wbuf;
|
string_buffer wbuf;
|
||||||
for (int i = 0; i < num; ++i) {
|
for (int i = 0; i < num; ++i) {
|
||||||
const double tm1 = gettimeofday_double();
|
const double tm1 = gettimeofday_double();
|
||||||
@ -1474,7 +1474,7 @@ hstest_main(int argc, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
const int num_thrs = shared.num_threads;
|
const int num_thrs = shared.num_threads;
|
||||||
typedef thread<hstest_thread> thread_type;
|
typedef thread<hstest_thread> thread_type;
|
||||||
typedef std::auto_ptr<thread_type> thread_ptr;
|
typedef std::unique_ptr<thread_type> thread_ptr;
|
||||||
typedef auto_ptrcontainer< std::vector<thread_type *> > thrs_type;
|
typedef auto_ptrcontainer< std::vector<thread_type *> > thrs_type;
|
||||||
thrs_type thrs;
|
thrs_type thrs;
|
||||||
for (int i = 0; i < num_thrs; ++i) {
|
for (int i = 0; i < num_thrs; ++i) {
|
||||||
|
@ -175,7 +175,7 @@ struct dbcontext : public dbcontext_i, private noncopyable {
|
|||||||
THD *thd;
|
THD *thd;
|
||||||
MYSQL_LOCK *lock;
|
MYSQL_LOCK *lock;
|
||||||
bool lock_failed;
|
bool lock_failed;
|
||||||
std::auto_ptr<expr_user_lock> user_lock;
|
std::unique_ptr<expr_user_lock> user_lock;
|
||||||
int user_level_lock_timeout;
|
int user_level_lock_timeout;
|
||||||
bool user_level_lock_locked;
|
bool user_level_lock_locked;
|
||||||
bool commit_error;
|
bool commit_error;
|
||||||
|
@ -9,11 +9,6 @@
|
|||||||
#ifndef DENA_DATABASE_HPP
|
#ifndef DENA_DATABASE_HPP
|
||||||
#define DENA_DATABASE_HPP
|
#define DENA_DATABASE_HPP
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
/* auto_ptr is deprecated */
|
|
||||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -26,10 +21,10 @@
|
|||||||
namespace dena {
|
namespace dena {
|
||||||
|
|
||||||
struct database_i;
|
struct database_i;
|
||||||
typedef std::auto_ptr<volatile database_i> database_ptr;
|
typedef std::unique_ptr<volatile database_i> database_ptr;
|
||||||
|
|
||||||
struct dbcontext_i;
|
struct dbcontext_i;
|
||||||
typedef std::auto_ptr<dbcontext_i> dbcontext_ptr;
|
typedef std::unique_ptr<dbcontext_i> dbcontext_ptr;
|
||||||
|
|
||||||
struct database_i {
|
struct database_i {
|
||||||
virtual ~database_i() = default;
|
virtual ~database_i() = default;
|
||||||
|
@ -76,7 +76,7 @@ daemon_handlersocket_init(void *p)
|
|||||||
conf["readsize"] = to_stdstring(handlersocket_readsize);
|
conf["readsize"] = to_stdstring(handlersocket_readsize);
|
||||||
conf["accept_balance"] = to_stdstring(handlersocket_accept_balance);
|
conf["accept_balance"] = to_stdstring(handlersocket_accept_balance);
|
||||||
conf["wrlock_timeout"] = to_stdstring(handlersocket_wrlock_timeout);
|
conf["wrlock_timeout"] = to_stdstring(handlersocket_wrlock_timeout);
|
||||||
std::auto_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
|
std::unique_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
|
||||||
if (handlersocket_port != 0 && handlersocket_port_wr != handlersocket_port) {
|
if (handlersocket_port != 0 && handlersocket_port_wr != handlersocket_port) {
|
||||||
conf["port"] = handlersocket_port;
|
conf["port"] = handlersocket_port;
|
||||||
if (handlersocket_plain_secret) {
|
if (handlersocket_plain_secret) {
|
||||||
|
@ -115,7 +115,7 @@ hstcpsvr::start_listen()
|
|||||||
arg.cshared = &cshared;
|
arg.cshared = &cshared;
|
||||||
arg.vshared = &vshared;
|
arg.vshared = &vshared;
|
||||||
arg.worker_id = i;
|
arg.worker_id = i;
|
||||||
std::auto_ptr< thread<worker_throbj> > thr(
|
std::unique_ptr< thread<worker_throbj> > thr(
|
||||||
new thread<worker_throbj>(arg, stack_size));
|
new thread<worker_throbj>(arg, stack_size));
|
||||||
threads.push_back_ptr(thr);
|
threads.push_back_ptr(thr);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ struct hstcpsvr_shared_v : public mutex {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct hstcpsvr_i;
|
struct hstcpsvr_i;
|
||||||
typedef std::auto_ptr<hstcpsvr_i> hstcpsvr_ptr;
|
typedef std::unique_ptr<hstcpsvr_i> hstcpsvr_ptr;
|
||||||
|
|
||||||
struct hstcpsvr_i {
|
struct hstcpsvr_i {
|
||||||
virtual ~hstcpsvr_i() = default;
|
virtual ~hstcpsvr_i() = default;
|
||||||
|
@ -451,7 +451,7 @@ hstcpsvr_worker::run_one_nb()
|
|||||||
{
|
{
|
||||||
pollfd& pfd = pfds[nfds - 1];
|
pollfd& pfd = pfds[nfds - 1];
|
||||||
if ((pfd.revents & mask_in) != 0) {
|
if ((pfd.revents & mask_in) != 0) {
|
||||||
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
||||||
c->nonblocking = true;
|
c->nonblocking = true;
|
||||||
c->readsize = cshared.readsize;
|
c->readsize = cshared.readsize;
|
||||||
c->accept(cshared);
|
c->accept(cshared);
|
||||||
@ -498,7 +498,7 @@ hstcpsvr_worker::run_one_ep()
|
|||||||
/* listener */
|
/* listener */
|
||||||
++accept_count;
|
++accept_count;
|
||||||
DBG_EP(fprintf(stderr, "IN listener\n"));
|
DBG_EP(fprintf(stderr, "IN listener\n"));
|
||||||
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
||||||
c->nonblocking = true;
|
c->nonblocking = true;
|
||||||
c->readsize = cshared.readsize;
|
c->readsize = cshared.readsize;
|
||||||
c->accept(cshared);
|
c->accept(cshared);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
namespace dena {
|
namespace dena {
|
||||||
|
|
||||||
struct hstcpsvr_worker_i;
|
struct hstcpsvr_worker_i;
|
||||||
typedef std::auto_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
|
typedef std::unique_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
|
||||||
|
|
||||||
struct hstcpsvr_worker_arg {
|
struct hstcpsvr_worker_arg {
|
||||||
const hstcpsvr_shared_c *cshared;
|
const hstcpsvr_shared_c *cshared;
|
||||||
|
@ -19,11 +19,6 @@
|
|||||||
#include "string_ref.hpp"
|
#include "string_ref.hpp"
|
||||||
#include "string_buffer.hpp"
|
#include "string_buffer.hpp"
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
/* auto_ptr is deprecated */
|
|
||||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace dena {
|
namespace dena {
|
||||||
|
|
||||||
struct hstcpcli_filter {
|
struct hstcpcli_filter {
|
||||||
@ -35,7 +30,7 @@ struct hstcpcli_filter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct hstcpcli_i;
|
struct hstcpcli_i;
|
||||||
typedef std::auto_ptr<hstcpcli_i> hstcpcli_ptr;
|
typedef std::unique_ptr<hstcpcli_i> hstcpcli_ptr;
|
||||||
|
|
||||||
struct hstcpcli_i {
|
struct hstcpcli_i {
|
||||||
virtual ~hstcpcli_i() = default;
|
virtual ~hstcpcli_i() = default;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user