Skip to content

Commit

Permalink
Cast time_elapsed to int before calling human_readable_duration
Browse files Browse the repository at this point in the history
When attempting to build againt EPEL 5, it was noticed that
human_readable_duration expects an int, but time_elapsed is an
integer.  Explicitly static_cast<int>( time_elapsed ) to appease older
compilers.
  • Loading branch information
achernya committed Mar 27, 2013
1 parent 688bf21 commit 172b1e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/frontend/terminaloverlay.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -242,13 +242,16 @@ void NotificationEngine::apply( Framebuffer &fb ) const
return; return;
} else if ( message.empty() && time_expired ) { } else if ( message.empty() && time_expired ) {
swprintf( tmp, 128, L"mosh: Last %s %s ago.%s", explanation, swprintf( tmp, 128, L"mosh: Last %s %s ago.%s", explanation,
human_readable_duration( time_elapsed, "seconds" ).c_str(), human_readable_duration( static_cast<int>( time_elapsed ),
"seconds" ).c_str(),
keystroke_str ); keystroke_str );
} else if ( (!message.empty()) && (!time_expired) ) { } else if ( (!message.empty()) && (!time_expired) ) {
swprintf( tmp, 128, L"mosh: %ls%s", message.c_str(), keystroke_str ); swprintf( tmp, 128, L"mosh: %ls%s", message.c_str(), keystroke_str );
} else { } else {
swprintf( tmp, 128, L"mosh: %ls (%s without %s.)%s", message.c_str(), swprintf( tmp, 128, L"mosh: %ls (%s without %s.)%s", message.c_str(),
human_readable_duration( time_elapsed, "s" ).c_str(), explanation, keystroke_str ); human_readable_duration( static_cast<int>( time_elapsed ),
"s" ).c_str(),
explanation, keystroke_str );
} }


wstring string_to_draw( tmp ); wstring string_to_draw( tmp );
Expand Down

0 comments on commit 172b1e5

Please sign in to comment.