Eliminate debugging printfs

This commit is contained in:
Keith Winstein
2012-01-02 03:56:56 -05:00
parent 267f5a31a7
commit c0845631de
+15 -5
View File
@@ -80,7 +80,7 @@ Validity ConditionalCursorMove::get_validity( const Framebuffer &fb, uint64_t cu
if ( (row >= fb.ds.get_height()) if ( (row >= fb.ds.get_height())
|| (col >= fb.ds.get_width()) ) { || (col >= fb.ds.get_width()) ) {
fprintf( stderr, "Crazy cursor (%d,%d)!\n", row, col ); // fprintf( stderr, "Crazy cursor (%d,%d)!\n", row, col );
return IncorrectOrExpired; return IncorrectOrExpired;
} }
@@ -90,8 +90,10 @@ Validity ConditionalCursorMove::get_validity( const Framebuffer &fb, uint64_t cu
} else if ( current_frame < expiration_frame ) { } else if ( current_frame < expiration_frame ) {
return Pending; return Pending;
} else { } else {
/*
fprintf( stderr, "Bad cursor in %d (I thought (%d,%d) vs actual (%d,%d)).\n", (int)current_frame, fprintf( stderr, "Bad cursor in %d (I thought (%d,%d) vs actual (%d,%d)).\n", (int)current_frame,
row, col, fb.ds.get_cursor_row(), fb.ds.get_cursor_col() ); row, col, fb.ds.get_cursor_row(), fb.ds.get_cursor_col() );
*/
return IncorrectOrExpired; return IncorrectOrExpired;
} }
} }
@@ -316,14 +318,19 @@ void PredictionEngine::cull( const Framebuffer &fb )
switch ( j->get_validity( fb, i->row_num, local_frame_acked ) ) { switch ( j->get_validity( fb, i->row_num, local_frame_acked ) ) {
case IncorrectOrExpired: case IncorrectOrExpired:
if ( j->tentative ) { if ( j->tentative ) {
/*
fprintf( stderr, "Bad tentative prediction in row %d, col %d\n", fprintf( stderr, "Bad tentative prediction in row %d, col %d\n",
i->row_num, j->col ); i->row_num, j->col );
*/
j->reset(); j->reset();
become_tentative(); become_tentative();
/*
if ( j->display_time != uint64_t(-1) ) { if ( j->display_time != uint64_t(-1) ) {
fprintf( stderr, "TIMING %ld - %ld (TENT)\n", time(NULL), now - j->display_time ); fprintf( stderr, "TIMING %ld - %ld (TENT)\n", time(NULL), now - j->display_time );
} }
*/
} else { } else {
/*
fprintf( stderr, "[%d=>%d] (score=%d) Killing prediction in row %d, col %d\n", fprintf( stderr, "[%d=>%d] (score=%d) Killing prediction in row %d, col %d\n",
(int)local_frame_acked, (int)j->expiration_frame, (int)local_frame_acked, (int)j->expiration_frame,
score, score,
@@ -331,14 +338,17 @@ void PredictionEngine::cull( const Framebuffer &fb )
if ( j->display_time != uint64_t(-1) ) { if ( j->display_time != uint64_t(-1) ) {
fprintf( stderr, "TIMING %ld - %ld\n", time(NULL), now - j->display_time ); fprintf( stderr, "TIMING %ld - %ld\n", time(NULL), now - j->display_time );
} }
*/
reset(); reset();
return; return;
} }
break; break;
case Correct: case Correct:
/*
if ( j->display_time != uint64_t(-1) ) { if ( j->display_time != uint64_t(-1) ) {
fprintf( stderr, "TIMING %ld + %ld\n", now, now - j->display_time ); fprintf( stderr, "TIMING %ld + %ld\n", now, now - j->display_time );
} }
*/
if ( j->prediction_time > prediction_checkpoint ) { if ( j->prediction_time > prediction_checkpoint ) {
score++; score++;
@@ -430,7 +440,7 @@ void PredictionEngine::new_user_byte( char the_byte, const Framebuffer &fb )
} else if ( (ch < 0x20) || (ch > 0x7E) ) { } else if ( (ch < 0x20) || (ch > 0x7E) ) {
/* unknown print */ /* unknown print */
become_tentative(); become_tentative();
fprintf( stderr, "Unknown print 0x%x\n", ch ); // fprintf( stderr, "Unknown print 0x%x\n", ch );
} else { } else {
/* don't attempt to change existing blank or space cells if user has typed space */ /* don't attempt to change existing blank or space cells if user has typed space */
const Cell *existing_cell = fb.get_cell( cursor.row, cursor.col ); const Cell *existing_cell = fb.get_cell( cursor.row, cursor.col );
@@ -498,11 +508,11 @@ void PredictionEngine::new_user_byte( char the_byte, const Framebuffer &fb )
} else if ( typeid( *act ) == typeid( Parser::Execute ) ) { } else if ( typeid( *act ) == typeid( Parser::Execute ) ) {
become_tentative(); become_tentative();
cursor.freeze(); cursor.freeze();
fprintf( stderr, "Execute 0x%x\n", act->ch ); // fprintf( stderr, "Execute 0x%x\n", act->ch );
} else if ( typeid( *act ) == typeid( Parser::Esc_Dispatch ) ) { } else if ( typeid( *act ) == typeid( Parser::Esc_Dispatch ) ) {
fprintf( stderr, "Escape sequence\n" ); // fprintf( stderr, "Escape sequence\n" );
} else if ( typeid( *act ) == typeid( Parser::CSI_Dispatch ) ) { } else if ( typeid( *act ) == typeid( Parser::CSI_Dispatch ) ) {
fprintf( stderr, "CSI sequence\n" ); // fprintf( stderr, "CSI sequence\n" );
} }
delete act; delete act;