Skip to content

Commit 8469db9

Browse files
committed
Modernize all typedefs with using statements
1 parent 38c84a9 commit 8469db9

9 files changed

Lines changed: 14 additions & 16 deletions

File tree

src/frontend/mosh-server.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595

9696
#include "src/network/networktransport-impl.h"
9797

98-
typedef Network::Transport< Terminal::Complete, Network::UserStream > ServerConnection;
98+
using ServerConnection = Network::Transport<Terminal::Complete, Network::UserStream>;
9999

100100
static void serve( int host_fd,
101101
Terminal::Complete &terminal,

src/frontend/stmclient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class STMClient {
6161

6262
Terminal::Framebuffer local_framebuffer, new_state;
6363
Overlay::OverlayManager overlays;
64-
typedef Network::Transport< Network::UserStream, Terminal::Complete > NetworkType;
64+
using NetworkType = Network::Transport<Network::UserStream, Terminal::Complete>;
6565
using NetworkPointer = std::shared_ptr<NetworkType>;
6666
NetworkPointer network;
6767
Terminal::Display display;

src/frontend/terminaloverlay.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ namespace Overlay {
4545
using namespace Terminal;
4646
using namespace Network;
4747
using std::deque;
48-
using std::list;
49-
using std::vector;
5048
using std::wstring;
5149

5250
enum Validity {
@@ -99,8 +97,8 @@ namespace Overlay {
9997
Cell replacement;
10098
bool unknown;
10199

102-
vector<Cell> original_contents; /* we don't give credit for correct predictions
103-
that match the original contents */
100+
std::vector<Cell> original_contents; /* we don't give credit for correct predictions
101+
that match the original contents */
104102

105103
void apply( Framebuffer &fb, uint64_t confirmed_epoch, int row, bool flag ) const;
106104
Validity get_validity( const Framebuffer &fb, int row, uint64_t early_ack, uint64_t late_ack ) const;
@@ -128,7 +126,7 @@ namespace Overlay {
128126
public:
129127
int row_num;
130128

131-
typedef vector<ConditionalOverlayCell> overlay_cells_type;
129+
using overlay_cells_type = std::vector<ConditionalOverlayCell>;
132130
overlay_cells_type overlay_cells;
133131

134132
void apply( Framebuffer &fb, uint64_t confirmed_epoch, bool flag ) const;
@@ -215,13 +213,13 @@ namespace Overlay {
215213
char last_byte;
216214
Parser::UTF8Parser parser;
217215

218-
typedef list<ConditionalOverlayRow> overlays_type;
216+
using overlays_type = std::list<ConditionalOverlayRow>;
219217
overlays_type overlays;
220218

221-
typedef list<ConditionalCursorMove> cursors_type;
219+
using cursors_type = std::list<ConditionalCursorMove>;
222220
cursors_type cursors;
223221

224-
typedef ConditionalOverlayRow::overlay_cells_type overlay_cells_type;
222+
using overlay_cells_type = ConditionalOverlayRow::overlay_cells_type;
225223

226224
uint64_t local_frame_sent, local_frame_acked, local_frame_late_acked;
227225

src/network/transportsender.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace Network {
7474

7575
MyState current_state;
7676

77-
typedef list< TimestampedState<MyState> > sent_states_type;
77+
using sent_states_type = std::list<TimestampedState<MyState>>;
7878
sent_states_type sent_states;
7979
/* first element: known, acknowledged receiver state */
8080
/* last element: last sent state */

src/statesync/completeterminal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace Terminal {
5353
// outside calls to act() to keep horrible things from happening.
5454
Parser::Actions actions;
5555

56-
typedef std::list< std::pair<uint64_t, uint64_t> > input_history_type;
56+
using input_history_type = std::list<std::pair<uint64_t, uint64_t>>;
5757
input_history_type input_history;
5858
uint64_t echo_ack;
5959

src/terminal/parseraction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace Parser {
5959
};
6060

6161
using ActionPointer = std::shared_ptr<Action>;
62-
typedef std::vector<ActionPointer> Actions;
62+
using Actions = std::vector<ActionPointer>;
6363

6464
class Ignore : public Action {
6565
public:

src/terminal/terminaldispatcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ namespace Terminal {
6666
bool clears_wrap_state;
6767
};
6868

69-
typedef std::map<std::string, Function> dispatch_map_t;
69+
using dispatch_map_t = std::map<std::string, Function>;
7070

7171
class DispatchRegistry {
7272
public:

src/terminal/terminaldisplay.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const
6868
if ( f.get_bell_count() != frame.last_frame.get_bell_count() ) {
6969
frame.append( '\007' );
7070
}
71-
typedef Terminal::Framebuffer::title_type title_type;
71+
using title_type = Terminal::Framebuffer::title_type;
7272

7373
/* has icon name or window title changed? */
7474
if ( has_title && f.is_title_initialized() &&

src/terminal/terminalframebuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/* Terminal framebuffer */
4747

4848
namespace Terminal {
49-
typedef uint32_t color_type;
49+
using color_type = uint32_t;
5050

5151
class Renditions {
5252
public:

0 commit comments

Comments
 (0)