Changeset 205f1add in mainline for uspace/app/top/screen.c


Ignore:
Timestamp:
2018-08-23T21:14:56Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Children:
f33c989e
Parents:
e2625b1a
git-author:
Jakub Jermar <jakub@…> (2018-08-21 21:58:52)
git-committer:
Jakub Jermar <jakub@…> (2018-08-23 21:14:56)
Message:

Get rid of sys/time.h

This commit moves the POSIX-like time functionality from libc's
sys/time.h to libposix and introduces C99-like or HelenOS-specific
interfaces to libc.

Specifically, use of sys/time.h, struct timeval, suseconds_t and
gettimeofday is replaced by time.h (C99), struct timespec (C99),
usec_t (HelenOS) and getuptime / getrealtime (HelenOS).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/top/screen.c

    re2625b1a r205f1add  
    4949#include "top.h"
    5050
    51 #define USEC_COUNT  1000000
    52 
    53 static suseconds_t timeleft = 0;
     51static usec_t timeleft = 0;
    5452
    5553console_ctrl_t *console;
     
    5755static sysarg_t warning_col = 0;
    5856static sysarg_t warning_row = 0;
    59 static suseconds_t warning_timeleft = 0;
     57static usec_t warning_timeleft = 0;
    6058static char *warning_text = NULL;
    6159
     
    179177static inline void print_global_head(data_t *data)
    180178{
    181         printf("top - %02lu:%02lu:%02lu up "
     179        printf("top - %02lld:%02lld:%02lld up "
    182180            "%" PRIun " days, %02" PRIun ":%02" PRIun ":%02" PRIun ", "
    183181            "load average:",
     
    527525        va_end(args);
    528526
    529         warning_timeleft = 2 * USEC_COUNT;
     527        warning_timeleft = SEC2USEC(2);
    530528
    531529        screen_moveto(warning_col, warning_row);
     
    537535 *
    538536 */
    539 int tgetchar(unsigned int sec)
     537int tgetchar(sec_t sec)
    540538{
    541539        /*
     
    544542
    545543        if (timeleft <= 0)
    546                 timeleft = sec * USEC_COUNT;
     544                timeleft = SEC2USEC(sec);
    547545
    548546        /*
Note: See TracChangeset for help on using the changeset viewer.