Skip to content

Commit

Permalink
Revert "[78_2] Gitee Scan Rule 025: Effective C++, item 30: understan…
Browse files Browse the repository at this point in the history
…d the ins and outs of inlining"

This reverts commit 867dc9a.
  • Loading branch information
da-liii committed Apr 13, 2024
1 parent e063487 commit bb19419
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 31 deletions.
16 changes: 8 additions & 8 deletions src/Data/History/patch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ class patch;
class patch_rep : public abstract_struct {
public:
inline patch_rep () {}
virtual ~patch_rep () {}
virtual int get_type ()= 0;
virtual int get_arity () { return 0; }
virtual patch get_child (int i);
virtual modification get_modification () {
inline virtual ~patch_rep () {}
virtual int get_type ()= 0;
inline virtual int get_arity () { return 0; }
inline virtual patch get_child (int i);
inline virtual modification get_modification () {
TM_FAILED ("not a modification");
return mod_assign (path (), "");
}
virtual modification get_inverse () {
inline virtual modification get_inverse () {
TM_FAILED ("not a modification");
return mod_assign (path (), "");
}
virtual bool get_birth () {
inline virtual bool get_birth () {
TM_FAILED ("not a birth");
return false;
}
virtual double get_author () { return -1; }
inline virtual double get_author () { return -1; }
};

class patch {
Expand Down
2 changes: 1 addition & 1 deletion src/Edit/Editor/edit_main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class edit_main_rep : public edit_interface_rep,
public:
edit_main_rep (server_rep* sv, tm_buffer buf);
~edit_main_rep ();
inline void* derived_this () { return (edit_main_rep*) this; }
virtual inline void* derived_this () { return (edit_main_rep*) this; }

void set_property (scheme_tree what, scheme_tree val);
void set_bool_property (string what, bool val);
Expand Down
2 changes: 1 addition & 1 deletion src/Edit/editor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class editor_rep : public simple_widget_rep {
public:
editor_rep ();
editor_rep (server_rep* sv, tm_buffer buf);
virtual ~editor_rep () {}
inline virtual ~editor_rep () {}
bool is_current_editor ();

/* public routines from edit_interface */
Expand Down
4 changes: 2 additions & 2 deletions src/Graphics/Gui/widget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class widget_rep : public abstract_struct {
public:
widget_rep ();
virtual ~widget_rep ();
inline void* derived_this () { return (widget_rep*) this; }
virtual tm_ostream& print (tm_ostream& out);
inline virtual void* derived_this () { return (widget_rep*) this; }
virtual tm_ostream& print (tm_ostream& out);

virtual void send (slot s, blackbox val);
// send a message val to the slot s
Expand Down
2 changes: 1 addition & 1 deletion src/Graphics/Pictures/effect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class effect {
class effect_rep : public abstract_struct {
public:
inline effect_rep () {}
virtual ~effect_rep () {}
inline virtual ~effect_rep () {}

virtual rectangle get_logical_extents (array<rectangle> rs);
virtual rectangle get_extents (array<rectangle> rs) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Graphics/Pictures/picture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class picture_rep : public abstract_struct {

public:
inline picture_rep () : unique_id (unique_picture_id ()) {}
virtual ~picture_rep () {}
inline virtual ~picture_rep () {}

inline unsigned long long int get_unique_id () { return unique_id; }
virtual picture_kind get_type () = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Graphics/Pictures/scalable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class scalable {
class scalable_rep : public abstract_struct {
public:
inline scalable_rep () {}
virtual ~scalable_rep () {}
inline virtual ~scalable_rep () {}

virtual scalable_kind get_type () = 0;
virtual void* get_handle ()= 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Graphics/Renderer/brush.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enum brush_kind { brush_none, brush_color, brush_pattern };
class brush_rep : abstract_struct {
public:
inline brush_rep () {}
virtual ~brush_rep () {}
inline virtual ~brush_rep () {}

virtual brush_kind get_type () = 0;
virtual void* get_handle ()= 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Graphics/Renderer/pencil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class pencil;
class pencil_rep : abstract_struct {
public:
inline pencil_rep () {}
virtual ~pencil_rep () {}
inline virtual ~pencil_rep () {}

virtual pencil_kind get_type () = 0;
virtual void* get_handle ()= 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Graphics/Spacial/spacial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class spacial {
class spacial_rep : public abstract_struct {
public:
inline spacial_rep () {}
virtual ~spacial_rep () {}
inline virtual ~spacial_rep () {}

virtual spacial_kind get_type () = 0;
virtual void* get_handle ()= 0;
Expand Down
4 changes: 2 additions & 2 deletions src/Graphics/Types/curve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
class curve_rep : public abstract_struct {
public:
inline curve_rep () {}
virtual ~curve_rep () {}
inline virtual ~curve_rep () {}

virtual int nr_components () { return 1; }
inline virtual int nr_components () { return 1; }
// the number of components of the curve is useful for getting
// nice parameterizations when concatenating curves

Expand Down
2 changes: 1 addition & 1 deletion src/Graphics/Types/frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class frame_rep : public abstract_struct {

public:
inline frame_rep () { linear= false; }
virtual ~frame_rep () {}
inline virtual ~frame_rep () {}
virtual operator tree ()= 0;

virtual point direct_transform (point p) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Graphics/Types/grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class grid_rep : public abstract_struct {
inline grid_rep () {}
inline grid_rep (array<SI> subd2, array<string> col2, point o)
: subd (subd2), col (col2), center (o) {}
virtual ~grid_rep () {}
inline virtual ~grid_rep () {}

virtual void set_aspect (tree aspect);

Expand Down
6 changes: 3 additions & 3 deletions src/Kernel/Abstractions/command.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class command_rep : public abstract_struct {
public:
inline command_rep () { TM_DEBUG (command_count++); }
inline virtual ~command_rep () { TM_DEBUG (command_count--); }
virtual tm_ostream& print (tm_ostream& out);
virtual void apply ()= 0;
virtual void apply (object args);
inline virtual tm_ostream& print (tm_ostream& out);
virtual void apply ()= 0;
virtual void apply (object args);
};

class command {
Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/Qt/qt_widget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class qt_widget_rep : public widget_rep {

qt_widget_rep (types _type= none, QWidget* _qwid= 0);
virtual ~qt_widget_rep ();
virtual string get_nickname () { return "popup"; }
virtual inline string get_nickname () { return "popup"; }

virtual widget plain_window_widget (string name, command quit, int b= 3);
virtual widget make_popup_widget ();
Expand Down Expand Up @@ -295,7 +295,7 @@ class qt_headless_widget_rep : public qt_widget_rep {
virtual ~qt_headless_widget_rep () {
if (DEBUG_QT_WIDGETS) debug_widgets << "~qt_headless_widget_rep" << LF;
}
inline string get_nickname () { return "headless"; }
virtual inline string get_nickname () { return "headless"; }

virtual widget plain_window_widget (string name, command quit, int b= 3) {
(void) name;
Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/Qt/qt_window_widget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class qt_window_widget_rep : public qt_widget_rep {
bool fake= false);
~qt_window_widget_rep ();

virtual string get_nickname () { return orig_name; }
virtual widget popup_window_widget (string s);
virtual inline string get_nickname () { return orig_name; }
virtual widget popup_window_widget (string s);

virtual void send (slot s, blackbox val);
virtual blackbox query (slot s, int type_id);
Expand Down
2 changes: 1 addition & 1 deletion src/Typeset/Bridge/bridge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class bridge_rep : public abstract_struct {

public:
bridge_rep (typesetter ttt, tree st, path ip);
virtual ~bridge_rep () {}
inline virtual ~bridge_rep () {}

virtual void notify_assign (path p, tree u)= 0;
virtual void notify_insert (path p, tree u);
Expand Down
2 changes: 1 addition & 1 deletion src/Typeset/boxes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class box_rep : public abstract_struct {
/****************************** main routines ******************************/

inline box_rep (path ip);
virtual ~box_rep ();
inline virtual ~box_rep ();
void relocate (path p, bool force= false);
virtual box transform (frame fr);
virtual operator tree ()= 0;
Expand Down

0 comments on commit bb19419

Please sign in to comment.