Changeset 11473 for trunk/oscam-time.c


Ignore:
Timestamp:
01/18/19 20:17:57 (18 months ago)
Author:
Gorgone Impertinence
Message:

big cleanup pack 3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oscam-time.c

    r11470 r11473  
    114114
    115115    for(i = 11; i && daysPerMonth[i] > work; --i) { ; }
    116     r->tm_mon   = i;
     116    r->tm_mon = i;
    117117    r->tm_mday += work - daysPerMonth[i];
    118118    return r;
     
    133133    gettimeofday(&tv, NULL);
    134134#if defined(CLOCKFIX)
    135     if (tv.tv_sec > lasttime.tv_sec || (tv.tv_sec == lasttime.tv_sec && tv.tv_usec >= lasttime.tv_usec))
    136     {           // check for time issues!
    137         lasttime = tv;  // register this valid time
     135    if (tv.tv_sec > lasttime.tv_sec || (tv.tv_sec == lasttime.tv_sec && tv.tv_usec >= lasttime.tv_usec)) // check for time issues!
     136    {
     137        lasttime = tv; // register this valid time
    138138    }
    139139    else
     
    143143        //fprintf(stderr, "*** WARNING: BAD TIME AFFECTING WHOLE OSCAM ECM HANDLING, SYSTEMTIME SET TO LAST KNOWN VALID TIME **** \n");
    144144    }
    145 #endif 
    146     tp->time    = tv.tv_sec;
     145#endif
     146    tp->time = tv.tv_sec;
    147147    tp->millitm = tv.tv_usec / 1000;
    148148}
     
    153153    gettimeofday(&tv, NULL);
    154154#if defined(CLOCKFIX)
    155     if (tv.tv_sec > lasttime.tv_sec || (tv.tv_sec == lasttime.tv_sec && tv.tv_usec >= lasttime.tv_usec))
    156     {           // check for time issues!
    157         lasttime = tv;  // register this valid time
     155    if (tv.tv_sec > lasttime.tv_sec || (tv.tv_sec == lasttime.tv_sec && tv.tv_usec >= lasttime.tv_usec)) // check for time issues!
     156    {
     157        lasttime = tv; // register this valid time
    158158    }
    159159    else
     
    163163        //fprintf(stderr, "*** WARNING: BAD TIME AFFECTING WHOLE OSCAM ECM HANDLING, SYSTEMTIME SET TO LAST KNOWN VALID TIME **** \n");
    164164    }
    165 #endif 
    166     tp->time    = tv.tv_sec;
     165#endif
     166    tp->time = tv.tv_sec;
    167167    tp->millitm = tv.tv_usec;
    168168}
     
    170170void cs_sleepms(uint32_t msec)
    171171{
    172     //does not interfere with signals like sleep and usleep do
     172    // does not interfere with signals like sleep and usleep do
    173173    struct timespec req_ts;
    174174    req_ts.tv_sec = msec / 1000;
     
    198198void cs_sleepus(uint32_t usec)
    199199{
    200     //does not interfere with signals like sleep and usleep do
     200    // does not interfere with signals like sleep and usleep do
    201201    struct timespec req_ts;
    202202    req_ts.tv_sec = usec / 1000000;
     
    271271
    272272#if defined(__UCLIBC__)
    273 #  define __UCLIBC_VER (__UCLIBC_MAJOR__ * 10000 + __UCLIBC_MINOR__ * 100 + __UCLIBC_SUBLEVEL__)
     273#define __UCLIBC_VER (__UCLIBC_MAJOR__ * 10000 + __UCLIBC_MINOR__ * 100 + __UCLIBC_SUBLEVEL__)
    274274#else
    275 #  define __UCLIBC_VER 999999
     275#define __UCLIBC_VER 999999
    276276#endif
    277277
    278278#if defined(__GLIBC__)
    279 #  define __GLIBCVER (__GLIBC__ * 100 + __GLIBC_MINOR__)
     279#define __GLIBCVER (__GLIBC__ * 100 + __GLIBC_MINOR__)
    280280#else
    281 #  define __GLIBCVER 9999
     281#define __GLIBCVER 9999
    282282#endif
    283283
     
    289289#if defined(HAVE_pthread_condattr_setclock)
    290290// UCLIBC 0.9.31 does not have pthread_condattr_setclock
    291 #  if __UCLIBC_VER < 932
    292 #     undef HAVE_pthread_condattr_setclock
    293 #  endif
     291#if __UCLIBC_VER < 932
     292#undef HAVE_pthread_condattr_setclock
     293#endif
    294294// glibc 2.3.6 in ppc old toolchain do not have pthread_condattr_setclock
    295 #  if __GLIBCVER < 204
    296 #     undef HAVE_pthread_condattr_setclock
    297 #  endif
     295#if __GLIBCVER < 204
     296#undef HAVE_pthread_condattr_setclock
     297#endif
    298298// android's libc not have pthread_condattr_setclock
    299 #  if __BIONIC__
    300 #     undef HAVE_pthread_condattr_setclock
    301 #  endif
     299#if __BIONIC__
     300#undef HAVE_pthread_condattr_setclock
     301#endif
    302302#endif
    303303
     
    393393    gettimeofday(&tv, NULL);
    394394#if defined(CLOCKFIX)
    395     if (tv.tv_sec > lasttime.tv_sec || (tv.tv_sec == lasttime.tv_sec && tv.tv_usec >= lasttime.tv_usec))
    396     {           // check for time issues!
    397         lasttime = tv;  // register this valid time
     395    if (tv.tv_sec > lasttime.tv_sec || (tv.tv_sec == lasttime.tv_sec && tv.tv_usec >= lasttime.tv_usec)) // check for time issues!
     396    {
     397        lasttime = tv; // register this valid time
    398398    }
    399399    else
Note: See TracChangeset for help on using the changeset viewer.