Remove BOOST_AUTO from terminaloverlay.cc
This commit is contained in:
committed by
Keith Winstein
parent
5320fbd346
commit
4152af9c8e
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#include <boost/lambda/lambda.hpp>
|
#include <boost/lambda/lambda.hpp>
|
||||||
#include <boost/lambda/bind.hpp>
|
#include <boost/lambda/bind.hpp>
|
||||||
#include <boost/typeof/typeof.hpp>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -91,9 +90,10 @@ Validity ConditionalOverlayCell::get_validity( const Framebuffer &fb, int row,
|
|||||||
|
|
||||||
if ( (current.contents == replacement.contents)
|
if ( (current.contents == replacement.contents)
|
||||||
|| (current.is_blank() && replacement.is_blank()) ) {
|
|| (current.is_blank() && replacement.is_blank()) ) {
|
||||||
BOOST_AUTO( it, find_if( original_contents.begin(), original_contents.end(),
|
vector<Cell>::const_iterator it =
|
||||||
(replacement.is_blank() && bind( &Cell::is_blank, _1 ))
|
find_if( original_contents.begin(), original_contents.end(),
|
||||||
|| replacement.contents == (&_1)->*&Cell::contents ) );
|
(replacement.is_blank() && bind( &Cell::is_blank, _1 ))
|
||||||
|
|| replacement.contents == (&_1)->*&Cell::contents );
|
||||||
if ( it == original_contents.end() ) {
|
if ( it == original_contents.end() ) {
|
||||||
return Correct;
|
return Correct;
|
||||||
} else {
|
} else {
|
||||||
@@ -326,8 +326,12 @@ void PredictionEngine::kill_epoch( uint64_t epoch, const Framebuffer &fb )
|
|||||||
prediction_epoch ) );
|
prediction_epoch ) );
|
||||||
cursor().active = true;
|
cursor().active = true;
|
||||||
|
|
||||||
for ( BOOST_AUTO( i, overlays.begin() ); i != overlays.end(); i++ ) {
|
for ( overlays_t::iterator i = overlays.begin();
|
||||||
for ( BOOST_AUTO( j, i->overlay_cells.begin() ); j != i->overlay_cells.end(); j++ ) {
|
i != overlays.end();
|
||||||
|
i++ ) {
|
||||||
|
for ( overlay_cells_t::iterator j = i->overlay_cells.begin();
|
||||||
|
j != i->overlay_cells.end();
|
||||||
|
j++ ) {
|
||||||
if ( j->tentative( epoch - 1 ) ) {
|
if ( j->tentative( epoch - 1 ) ) {
|
||||||
j->reset();
|
j->reset();
|
||||||
}
|
}
|
||||||
@@ -398,9 +402,9 @@ void PredictionEngine::cull( const Framebuffer &fb )
|
|||||||
|
|
||||||
/* go through cell predictions */
|
/* go through cell predictions */
|
||||||
|
|
||||||
BOOST_AUTO( i, overlays.begin() );
|
overlays_t::iterator i = overlays.begin();
|
||||||
while ( i != overlays.end() ) {
|
while ( i != overlays.end() ) {
|
||||||
BOOST_AUTO( inext, i );
|
overlays_t::iterator inext = i;
|
||||||
inext++;
|
inext++;
|
||||||
if ( (i->row_num < 0) || (i->row_num >= fb.ds.get_height()) ) {
|
if ( (i->row_num < 0) || (i->row_num >= fb.ds.get_height()) ) {
|
||||||
overlays.erase( i );
|
overlays.erase( i );
|
||||||
@@ -408,7 +412,9 @@ void PredictionEngine::cull( const Framebuffer &fb )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( BOOST_AUTO( j, i->overlay_cells.begin() ); j != i->overlay_cells.end(); j++ ) {
|
for ( overlay_cells_t::iterator j = i->overlay_cells.begin();
|
||||||
|
j != i->overlay_cells.end();
|
||||||
|
j++ ) {
|
||||||
switch ( j->get_validity( fb, i->row_num,
|
switch ( j->get_validity( fb, i->row_num,
|
||||||
local_frame_acked, local_frame_late_acked ) ) {
|
local_frame_acked, local_frame_late_acked ) ) {
|
||||||
case IncorrectOrExpired:
|
case IncorrectOrExpired:
|
||||||
@@ -520,8 +526,8 @@ void PredictionEngine::cull( const Framebuffer &fb )
|
|||||||
|
|
||||||
ConditionalOverlayRow & PredictionEngine::get_or_make_row( int row_num, int num_cols )
|
ConditionalOverlayRow & PredictionEngine::get_or_make_row( int row_num, int num_cols )
|
||||||
{
|
{
|
||||||
BOOST_AUTO( it, find_if( overlays.begin(), overlays.end(),
|
overlays_t::iterator it = find_if( overlays.begin(), overlays.end(),
|
||||||
(&_1)->*&ConditionalOverlayRow::row_num == row_num ) );
|
(&_1)->*&ConditionalOverlayRow::row_num == row_num );
|
||||||
|
|
||||||
if ( it != overlays.end() ) {
|
if ( it != overlays.end() ) {
|
||||||
return *it;
|
return *it;
|
||||||
@@ -557,7 +563,9 @@ void PredictionEngine::new_user_byte( char the_byte, const Framebuffer &fb )
|
|||||||
|
|
||||||
list<Parser::Action *> actions( parser.input( the_byte ) );
|
list<Parser::Action *> actions( parser.input( the_byte ) );
|
||||||
|
|
||||||
for ( BOOST_AUTO( it, actions.begin() ); it != actions.end(); it++ ) {
|
for ( list<Parser::Action *>::iterator it = actions.begin();
|
||||||
|
it != actions.end();
|
||||||
|
it++ ) {
|
||||||
Parser::Action *act = *it;
|
Parser::Action *act = *it;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -727,9 +735,13 @@ void PredictionEngine::newline_carriage_return( const Framebuffer &fb )
|
|||||||
init_cursor( fb );
|
init_cursor( fb );
|
||||||
cursor().col = 0;
|
cursor().col = 0;
|
||||||
if ( cursor().row == fb.ds.get_height() - 1 ) {
|
if ( cursor().row == fb.ds.get_height() - 1 ) {
|
||||||
for ( BOOST_AUTO( i, overlays.begin() ); i != overlays.end(); i++ ) {
|
for ( overlays_t::iterator i = overlays.begin();
|
||||||
|
i != overlays.end();
|
||||||
|
i++ ) {
|
||||||
i->row_num--;
|
i->row_num--;
|
||||||
for ( BOOST_AUTO( j, i->overlay_cells.begin() ); j != i->overlay_cells.end(); j++ ) {
|
for ( overlay_cells_t::iterator j = i->overlay_cells.begin();
|
||||||
|
j != i->overlay_cells.end();
|
||||||
|
j++ ) {
|
||||||
if ( j->active ) {
|
if ( j->active ) {
|
||||||
j->expire( local_frame_sent + 1, now );
|
j->expire( local_frame_sent + 1, now );
|
||||||
}
|
}
|
||||||
@@ -738,7 +750,9 @@ void PredictionEngine::newline_carriage_return( const Framebuffer &fb )
|
|||||||
|
|
||||||
/* make blank prediction for last row */
|
/* make blank prediction for last row */
|
||||||
ConditionalOverlayRow &the_row = get_or_make_row( cursor().row, fb.ds.get_width() );
|
ConditionalOverlayRow &the_row = get_or_make_row( cursor().row, fb.ds.get_width() );
|
||||||
for ( BOOST_AUTO( j, the_row.overlay_cells.begin() ); j != the_row.overlay_cells.end(); j++ ) {
|
for ( overlay_cells_t::iterator j = the_row.overlay_cells.begin();
|
||||||
|
j != the_row.overlay_cells.end();
|
||||||
|
j++ ) {
|
||||||
j->active = true;
|
j->active = true;
|
||||||
j->tentative_until_epoch = prediction_epoch;
|
j->tentative_until_epoch = prediction_epoch;
|
||||||
j->expire( local_frame_sent + 1, now );
|
j->expire( local_frame_sent + 1, now );
|
||||||
@@ -765,8 +779,12 @@ bool PredictionEngine::active( void ) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( BOOST_AUTO( i, overlays.begin() ); i != overlays.end(); i++ ) {
|
for ( overlays_t::const_iterator i = overlays.begin();
|
||||||
for ( BOOST_AUTO( j, i->overlay_cells.begin() ); j != i->overlay_cells.end(); j++ ) {
|
i != overlays.end();
|
||||||
|
i++ ) {
|
||||||
|
for ( overlay_cells_t::const_iterator j = i->overlay_cells.begin();
|
||||||
|
j != i->overlay_cells.end();
|
||||||
|
j++ ) {
|
||||||
if ( j->active ) {
|
if ( j->active ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ namespace Overlay {
|
|||||||
public:
|
public:
|
||||||
int row_num;
|
int row_num;
|
||||||
|
|
||||||
vector<ConditionalOverlayCell> overlay_cells;
|
typedef vector<ConditionalOverlayCell> overlay_cells_t;
|
||||||
|
overlay_cells_t overlay_cells;
|
||||||
|
|
||||||
void apply( Framebuffer &fb, uint64_t confirmed_epoch, bool flag ) const;
|
void apply( Framebuffer &fb, uint64_t confirmed_epoch, bool flag ) const;
|
||||||
|
|
||||||
@@ -155,10 +156,13 @@ namespace Overlay {
|
|||||||
char last_byte;
|
char last_byte;
|
||||||
Parser::UTF8Parser parser;
|
Parser::UTF8Parser parser;
|
||||||
|
|
||||||
list<ConditionalOverlayRow> overlays;
|
typedef list<ConditionalOverlayRow> overlays_t;
|
||||||
|
overlays_t overlays;
|
||||||
|
|
||||||
list<ConditionalCursorMove> cursors;
|
list<ConditionalCursorMove> cursors;
|
||||||
|
|
||||||
|
typedef ConditionalOverlayRow::overlay_cells_t overlay_cells_t;
|
||||||
|
|
||||||
uint64_t local_frame_sent, local_frame_acked, local_frame_late_acked;
|
uint64_t local_frame_sent, local_frame_acked, local_frame_late_acked;
|
||||||
|
|
||||||
ConditionalOverlayRow & get_or_make_row( int row_num, int num_cols );
|
ConditionalOverlayRow & get_or_make_row( int row_num, int num_cols );
|
||||||
|
|||||||
Reference in New Issue
Block a user