summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Chernyakhovsky <alex@achernya.com>2023-07-30 17:27:10 -0400
committerAlex Chernyakhovsky <achernya@mit.edu>2023-07-30 19:02:51 -0400
commit8469db91db49c4e41c175c266019e8da816e75df (patch)
tree8c60863e8e56ddce6e1dc56276cc17dd0b57f950
parent38c84a9330a28ef1641014d189bfa5311405610e (diff)
Modernize all typedefs with using statements
-rw-r--r--src/frontend/mosh-server.cc2
-rw-r--r--src/frontend/stmclient.h2
-rw-r--r--src/frontend/terminaloverlay.h14
-rw-r--r--src/network/transportsender.h2
-rw-r--r--src/statesync/completeterminal.h2
-rw-r--r--src/terminal/parseraction.h2
-rw-r--r--src/terminal/terminaldispatcher.h2
-rw-r--r--src/terminal/terminaldisplay.cc2
-rw-r--r--src/terminal/terminalframebuffer.h2
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<Terminal::Complete, Network::UserStream>;
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<Network::UserStream, Terminal::Complete>;
using NetworkPointer = std::shared_ptr<NetworkType>;
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<Cell> original_contents; /* we don't give credit for correct predictions
- that match the original contents */
+ std::vector<Cell> 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<ConditionalOverlayCell> overlay_cells_type;
+ using overlay_cells_type = std::vector<ConditionalOverlayCell>;
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<ConditionalOverlayRow> overlays_type;
+ using overlays_type = std::list<ConditionalOverlayRow>;
overlays_type overlays;
- typedef list<ConditionalCursorMove> cursors_type;
+ using cursors_type = std::list<ConditionalCursorMove>;
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<MyState> > sent_states_type;
+ using sent_states_type = std::list<TimestampedState<MyState>>;
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<uint64_t, uint64_t> > input_history_type;
+ using input_history_type = std::list<std::pair<uint64_t, uint64_t>>;
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<Action>;
- typedef std::vector<ActionPointer> Actions;
+ using Actions = std::vector<ActionPointer>;
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<std::string, Function> dispatch_map_t;
+ using dispatch_map_t = std::map<std::string, Function>;
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: