Skip to content

Commit

Permalink
boost::shared_ptr -> std::shared_ptr
Browse files Browse the repository at this point in the history
and add missing headers
  • Loading branch information
wojdyr committed Aug 7, 2022
1 parent 2b8174e commit 015c731
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 19 deletions.
1 change: 1 addition & 0 deletions fityk/GAfit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define BUILDING_LIBFITYK
#include "GAfit.h"

#include <assert.h>
#include <stdlib.h>
#include <algorithm>
#include <numeric>
Expand Down
1 change: 1 addition & 0 deletions fityk/NMfit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define BUILDING_LIBFITYK
#include "NMfit.h"

#include <assert.h>
#include <stdlib.h>
#include <time.h>
#include <cmath>
Expand Down
3 changes: 2 additions & 1 deletion fityk/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <string>
#include <vector>
#include <cmath>
#include <algorithm> // for find

#include "fityk.h" //ExecuteError

Expand Down Expand Up @@ -91,7 +92,7 @@ std::vector<std::string> split_string(std::string const &s, T delim) {
template<typename T, typename T2>
bool contains_element(T const& vec, T2 const& t)
{
return (find(vec.begin(), vec.end(), t) != vec.end());
return std::find(vec.begin(), vec.end(), t) != vec.end();
}

/// check if string (first arg) contains given substring (second arg)
Expand Down
2 changes: 1 addition & 1 deletion fityk/cparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ void Parser::parse_define_rhs(Lexer& lex, Tplate *tp)
// Tplate
Tplate::Ptr Parser::parse_define_args(Lexer& lex)
{
boost::shared_ptr<Tplate> tp(new Tplate);
std::shared_ptr<Tplate> tp(new Tplate);
// FuncType
tp->name = lex.get_expected_token(kTokenCname).as_string();
tp->docs_fragment = NULL;
Expand Down
5 changes: 1 addition & 4 deletions fityk/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <cmath>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <algorithm>

#include <xylib/xylib.h>
Expand All @@ -21,10 +22,6 @@
using std::string;
using std::vector;

#if XYLIB_VERSION < 10500
typedef shared_ptr<const xylib::DataSet> dataset_shared_ptr;
#endif

namespace fityk {

// filename utils
Expand Down
1 change: 1 addition & 0 deletions fityk/eparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <cstring>
#include <cmath>
#include <algorithm> // for nth_element

#include "lexer.h"
#include "common.h"
Expand Down
3 changes: 2 additions & 1 deletion fityk/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <string.h>
#include <locale.h>
#include <memory> // for unique_ptr
#include <algorithm> // for count

#include "common.h"
#include "data.h"
Expand Down Expand Up @@ -156,7 +157,7 @@ void DataKeeper::import_dataset(int slot, const string& data_path,
const bool new_dataset = (slot == Lexer::kNew);
// split "data_path" (e.g. "foo.dat:1:2,3::") into filename
// and colon-separated indices
int count_colons = ::count(data_path.begin(), data_path.end(), ':');
int count_colons = std::count(data_path.begin(), data_path.end(), ':');
LoadSpec spec;
vector<int> indices[3];
if (count_colons >= 4) {
Expand Down
3 changes: 2 additions & 1 deletion fityk/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define BUILDING_LIBFITYK
#include "runner.h"

#include <algorithm> // for sort
#include <memory> // for unique_ptr

#include "cparser.h"
Expand Down Expand Up @@ -97,7 +98,7 @@ void Runner::command_delete(const vector<Token>& args)
assert(0);
}
if (!dd.empty()) {
sort(dd.rbegin(), dd.rend());
std::sort(dd.rbegin(), dd.rend());
v_foreach (int, j, dd)
F_->dk.remove(*j);
}
Expand Down
1 change: 1 addition & 0 deletions fityk/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "settings.h"

#include <algorithm>
#include <assert.h>
#include <stdlib.h>
#include <ctime> //time()
#ifdef _WIN32
Expand Down
4 changes: 2 additions & 2 deletions fityk/tplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <vector>
#include <string>
#include <boost/shared_ptr.hpp>
#include <memory> // for shared_ptr

#include "common.h" // DISALLOW_COPY_AND_ASSIGN
#include "vm.h" // VMData
Expand All @@ -23,7 +23,7 @@ struct OpTree;
/// parameters.
struct FITYK_API Tplate
{
typedef boost::shared_ptr<const Tplate> Ptr;
typedef std::shared_ptr<const Tplate> Ptr;
typedef Function* (*create_type)(const Settings*, const std::string&,
Ptr, const std::vector<std::string>&);

Expand Down
3 changes: 2 additions & 1 deletion fityk/transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "data.h"
#include "root/background.hpp"
#include <stdio.h>
#include <assert.h>

using namespace std;

Expand All @@ -32,7 +33,7 @@ realt find_extrapolated_y(vector<Point> const& pp, realt x)
return pp.back().y;
vector<Point>::const_iterator i = lower_bound(pp.begin(), pp.end(),
Point(x, 0));
assert (i > pp.begin() && i < pp.end());
assert(i > pp.begin() && i < pp.end());
if (is_eq(x, i->x))
return i->y;
else
Expand Down
1 change: 1 addition & 0 deletions fityk/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#define BUILDING_LIBFITYK
#include "view.h"
#include <assert.h>
#include "common.h"
#include "data.h"
#include "model.h"
Expand Down
4 changes: 0 additions & 4 deletions wxgui/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@
using std::string;
using std::vector;

#if XYLIB_VERSION < 10500
typedef shared_ptr<const xylib::DataSet> dataset_shared_ptr;
#endif

using fityk::FitManager;
FFrame *frame = NULL;
fityk::Full *ftk = NULL;
Expand Down
4 changes: 0 additions & 4 deletions wxgui/xybrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

#include "uplot.h"

#if XYLIB_VERSION < 10500
typedef shared_ptr<const xylib::DataSet> dataset_shared_ptr;
#endif

class PreviewPlot : public PlotWithTics
{
public:
Expand Down

0 comments on commit 015c731

Please sign in to comment.