net-mgmt/tcptrack: fix build on armv7 / powerpc

TextUI.cc:306:17: error: format specifies type 'int' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat]
  306 |                         printw("%ds",ic->getIdleSeconds());
      |                                 ~~   ^~~~~~~~~~~~~~~~~~~~
      |                                 %lld
TextUI.cc:308:17: error: format specifies type 'int' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat]
  308 |                         printw("%dm",ic->getIdleSeconds()/60);
      |                                 ~~   ^~~~~~~~~~~~~~~~~~~~~~~
      |                                 %lld
TextUI.cc:310:17: error: format specifies type 'int' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat]
  310 |                         printw("%dh",ic->getIdleSeconds()/3600);
      |                                 ~~   ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 %lld
3 errors generated.
This commit is contained in:
Piotr Kubaj 2025-01-12 17:19:01 +01:00
parent 1530fd2a9f
commit aa03dfb264

View file

@ -158,3 +158,18 @@ too low).
+ if (pthread_create(&displayer_tid, NULL, displayer_thread_func, this) != 0)
throw GenericError("pthread_create() returned an error.");
@@ -309,11 +303,11 @@
move(row,58);
if( ic->getIdleSeconds() < 60 )
- printw("%ds",ic->getIdleSeconds());
+ printw("%ds",(int)(ic->getIdleSeconds()));
else if( ic->getIdleSeconds() > 59 )
- printw("%dm",ic->getIdleSeconds()/60);
+ printw("%dm",(int)(ic->getIdleSeconds())/60);
else if( ic->getIdleSeconds() > 3559 )
- printw("%dh",ic->getIdleSeconds()/3600);
+ printw("%dh",(int)(ic->getIdleSeconds())/3600);
move(row,63);
if( ic->activityToggle() )