Commit 6d8392e7e17d81ef96294ef5dd91adce3fb005ee

Authored by Matti Virkkunen
1 parent b330e2b0

Use standard C++ shared_ptrs

.gitignore
... ... @@ -4,3 +4,4 @@ thrift_static
4 4 libline.so
5 5 .depend
6 6 *.geany
  7 +.vscode
7 8 \ No newline at end of file
... ...
libpurple/poller.cpp
... ... @@ -9,7 +9,7 @@
9 9 Poller::Poller(PurpleLine &parent)
10 10 : parent(parent)
11 11 {
12   - client = boost::make_shared<ThriftClient>(parent.acct, parent.conn, LINE_POLL_PATH);
  12 + client = std::make_shared<ThriftClient>(parent.acct, parent.conn, LINE_POLL_PATH);
13 13 client->set_auto_reconnect(true);
14 14 }
15 15  
... ...
libpurple/poller.hpp
... ... @@ -15,7 +15,7 @@ class Poller {
15 15  
16 16 PurpleLine &parent;
17 17  
18   - boost::shared_ptr<ThriftClient> client;
  18 + std::shared_ptr<ThriftClient> client;
19 19 int64_t local_rev;
20 20  
21 21 public:
... ...
libpurple/purpleline.cpp
... ... @@ -49,7 +49,7 @@ PurpleLine::PurpleLine(PurpleConnection *conn, PurpleAccount *acct) :
49 49 pin_verifier(*this),
50 50 next_purple_id(1)
51 51 {
52   - c_out = boost::make_shared<ThriftClient>(acct, conn, LINE_LOGIN_PATH);
  52 + c_out = std::make_shared<ThriftClient>(acct, conn, LINE_LOGIN_PATH);
53 53 os_http.set_auto_reconnect(true);
54 54 }
55 55  
... ...
libpurple/purpleline.hpp
... ... @@ -66,7 +66,7 @@ class PurpleLine {
66 66 PurpleConnection *conn;
67 67 PurpleAccount *acct;
68 68  
69   - boost::shared_ptr<ThriftClient> c_out;
  69 + std::shared_ptr<ThriftClient> c_out;
70 70  
71 71 HTTPClient http;
72 72  
... ...
libpurple/purpleline_write.cpp
  1 +#include <algorithm>
  2 +
1 3 #include "purpleline.hpp"
2 4  
3 5 static std::string get_sticker_id(line::Message &msg) {
... ...
libpurple/thriftclient.cpp
... ... @@ -8,11 +8,11 @@
8 8  
9 9 ThriftClient::ThriftClient(PurpleAccount *acct, PurpleConnection *conn, std::string path)
10 10 : line::TalkServiceClient(
11   - boost::make_shared<apache::thrift::protocol::TCompactProtocol>(
12   - boost::make_shared<LineHttpTransport>(acct, conn, LINE_THRIFT_SERVER, 443, true))),
  11 + std::make_shared<apache::thrift::protocol::TCompactProtocol>(
  12 + std::make_shared<LineHttpTransport>(acct, conn, LINE_THRIFT_SERVER, 443, true))),
13 13 path(path)
14 14 {
15   - http = boost::static_pointer_cast<LineHttpTransport>(getInputProtocol()->getTransport());
  15 + http = std::static_pointer_cast<LineHttpTransport>(getInputProtocol()->getTransport());
16 16 }
17 17  
18 18 void ThriftClient::set_path(std::string path) {
... ...
libpurple/thriftclient.hpp
... ... @@ -3,9 +3,6 @@
3 3 #include <string>
4 4 #include <deque>
5 5  
6   -#include <boost/shared_ptr.hpp>
7   -#include <boost/make_shared.hpp>
8   -
9 6 #include <debug.h>
10 7 #include <plugin.h>
11 8 #include <prpl.h>
... ... @@ -17,7 +14,7 @@
17 14 class ThriftClient : public line::TalkServiceClient {
18 15  
19 16 std::string path;
20   - boost::shared_ptr<LineHttpTransport> http;
  17 + std::shared_ptr<LineHttpTransport> http;
21 18  
22 19 public:
23 20  
... ...
libpurple/wrapper.hpp
... ... @@ -8,8 +8,6 @@
8 8  
9 9 #include <cmds.h>
10 10  
11   -#include <boost/shared_ptr.hpp>
12   -
13 11 // Template magic to wrap instance methods as C function pointers
14 12  
15 13 template<typename Sig, Sig F>
... ...