From 8469db91db49c4e41c175c266019e8da816e75df Mon Sep 17 00:00:00 2001 From: Alex Chernyakhovsky Date: Sun, 30 Jul 2023 17:27:10 -0400 Subject: Modernize all typedefs with using statements --- src/frontend/mosh-server.cc | 2 +- src/frontend/stmclient.h | 2 +- src/frontend/terminaloverlay.h | 14 ++++++-------- src/network/transportsender.h | 2 +- src/statesync/completeterminal.h | 2 +- src/terminal/parseraction.h | 2 +- src/terminal/terminaldispatcher.h | 2 +- src/terminal/terminaldisplay.cc | 2 +- src/terminal/terminalframebuffer.h | 2 +- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index 4b13d9f..7c49ab9 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -95,7 +95,7 @@ #include "src/network/networktransport-impl.h" -typedef Network::Transport< Terminal::Complete, Network::UserStream > ServerConnection; +using ServerConnection = Network::Transport; static void serve( int host_fd, Terminal::Complete &terminal, diff --git a/src/frontend/stmclient.h b/src/frontend/stmclient.h index 3fccd1f..e811e26 100644 --- a/src/frontend/stmclient.h +++ b/src/frontend/stmclient.h @@ -61,7 +61,7 @@ private: Terminal::Framebuffer local_framebuffer, new_state; Overlay::OverlayManager overlays; - typedef Network::Transport< Network::UserStream, Terminal::Complete > NetworkType; + using NetworkType = Network::Transport; using NetworkPointer = std::shared_ptr; NetworkPointer network; Terminal::Display display; diff --git a/src/frontend/terminaloverlay.h b/src/frontend/terminaloverlay.h index 16b5029..648c1bc 100644 --- a/src/frontend/terminaloverlay.h +++ b/src/frontend/terminaloverlay.h @@ -45,8 +45,6 @@ namespace Overlay { using namespace Terminal; using namespace Network; using std::deque; - using std::list; - using std::vector; using std::wstring; enum Validity { @@ -99,8 +97,8 @@ namespace Overlay { Cell replacement; bool unknown; - vector original_contents; /* we don't give credit for correct predictions - that match the original contents */ + std::vector original_contents; /* we don't give credit for correct predictions + that match the original contents */ void apply( Framebuffer &fb, uint64_t confirmed_epoch, int row, bool flag ) const; Validity get_validity( const Framebuffer &fb, int row, uint64_t early_ack, uint64_t late_ack ) const; @@ -128,7 +126,7 @@ namespace Overlay { public: int row_num; - typedef vector overlay_cells_type; + using overlay_cells_type = std::vector; overlay_cells_type overlay_cells; void apply( Framebuffer &fb, uint64_t confirmed_epoch, bool flag ) const; @@ -215,13 +213,13 @@ namespace Overlay { char last_byte; Parser::UTF8Parser parser; - typedef list overlays_type; + using overlays_type = std::list; overlays_type overlays; - typedef list cursors_type; + using cursors_type = std::list; cursors_type cursors; - typedef ConditionalOverlayRow::overlay_cells_type overlay_cells_type; + using overlay_cells_type = ConditionalOverlayRow::overlay_cells_type; uint64_t local_frame_sent, local_frame_acked, local_frame_late_acked; diff --git a/src/network/transportsender.h b/src/network/transportsender.h index 5b89e9c..cd4fb04 100644 --- a/src/network/transportsender.h +++ b/src/network/transportsender.h @@ -74,7 +74,7 @@ namespace Network { MyState current_state; - typedef list< TimestampedState > sent_states_type; + using sent_states_type = std::list>; sent_states_type sent_states; /* first element: known, acknowledged receiver state */ /* last element: last sent state */ diff --git a/src/statesync/completeterminal.h b/src/statesync/completeterminal.h index 34f9a96..2483ef4 100644 --- a/src/statesync/completeterminal.h +++ b/src/statesync/completeterminal.h @@ -53,7 +53,7 @@ namespace Terminal { // outside calls to act() to keep horrible things from happening. Parser::Actions actions; - typedef std::list< std::pair > input_history_type; + using input_history_type = std::list>; input_history_type input_history; uint64_t echo_ack; diff --git a/src/terminal/parseraction.h b/src/terminal/parseraction.h index e102d40..bb36980 100644 --- a/src/terminal/parseraction.h +++ b/src/terminal/parseraction.h @@ -59,7 +59,7 @@ namespace Parser { }; using ActionPointer = std::shared_ptr; - typedef std::vector Actions; + using Actions = std::vector; class Ignore : public Action { public: diff --git a/src/terminal/terminaldispatcher.h b/src/terminal/terminaldispatcher.h index cc92c2e..8dabbdc 100644 --- a/src/terminal/terminaldispatcher.h +++ b/src/terminal/terminaldispatcher.h @@ -66,7 +66,7 @@ namespace Terminal { bool clears_wrap_state; }; - typedef std::map dispatch_map_t; + using dispatch_map_t = std::map; class DispatchRegistry { public: diff --git a/src/terminal/terminaldisplay.cc b/src/terminal/terminaldisplay.cc index 1cc8c59..10411cc 100644 --- a/src/terminal/terminaldisplay.cc +++ b/src/terminal/terminaldisplay.cc @@ -68,7 +68,7 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const if ( f.get_bell_count() != frame.last_frame.get_bell_count() ) { frame.append( '\007' ); } - typedef Terminal::Framebuffer::title_type title_type; + using title_type = Terminal::Framebuffer::title_type; /* has icon name or window title changed? */ if ( has_title && f.is_title_initialized() && diff --git a/src/terminal/terminalframebuffer.h b/src/terminal/terminalframebuffer.h index cd94640..0f77e42 100644 --- a/src/terminal/terminalframebuffer.h +++ b/src/terminal/terminalframebuffer.h @@ -46,7 +46,7 @@ /* Terminal framebuffer */ namespace Terminal { - typedef uint32_t color_type; + using color_type = uint32_t; class Renditions { public: -- cgit v1.2.3