]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/btime.c
19July06
[bacula/bacula] / bacula / src / lib / btime.c
index d77b3e679d5334af77b8ea24c4a8de710930cef8..79fc7578f96af9ccc57b86e865a97ffab1fb1aab 100644 (file)
@@ -28,9 +28,9 @@
  * in Bacula (fdate_t, ftime_t, time_t (Unix standard), btime_t, and
  *  utime_t).  fdate_t and ftime_t are deprecated and should no longer
  *  be used, and in general, Unix time time_t should no longer be used,
- *  it is being phased out. 
- *     
- *  Epoch is the base of Unix time in seconds (time_t, ...) 
+ *  it is being phased out.
+ *
+ *  Epoch is the base of Unix time in seconds (time_t, ...)
  *     and is 1 Jan 1970 at 0:0 UTC
  *
  *  The major two times that should be left are:
@@ -46,9 +46,9 @@ char *bstrftime(char *dt, int maxlen, utime_t tim)
 {
    time_t ttime = (time_t)tim;
    struct tm tm;
-   
+
    /* ***FIXME**** the format and localtime_r() should be user configurable */
-   localtime_r(&ttime, &tm);
+   (void)localtime_r(&ttime, &tm);
    strftime(dt, maxlen, "%d-%b-%Y %H:%M", &tm);
    return dt;
 }
@@ -58,9 +58,9 @@ char *bstrftimes(char *dt, int maxlen, utime_t tim)
 {
    time_t ttime = (time_t)tim;
    struct tm tm;
-   
+
    /* ***FIXME**** the format and localtime_r() should be user configurable */
-   localtime_r(&ttime, &tm);
+   (void)localtime_r(&ttime, &tm);
    strftime(dt, maxlen, "%d-%b-%Y %H:%M:%S", &tm);
    return dt;
 }
@@ -71,9 +71,9 @@ char *bstrftime_ny(char *dt, int maxlen, utime_t tim)
 {
    time_t ttime = (time_t)tim;
    struct tm tm;
-   
+
    /* ***FIXME**** the format and localtime_r() should be user configurable */
-   localtime_r(&ttime, &tm);
+   (void)localtime_r(&ttime, &tm);
    strftime(dt, maxlen, "%d-%b %H:%M", &tm);
    return dt;
 }
@@ -84,9 +84,9 @@ char *bstrftime_nc(char *dt, int maxlen, utime_t tim)
 {
    time_t ttime = (time_t)tim;
    struct tm tm;
-   
+
    /* ***FIXME**** the format and localtime_r() should be user configurable */
-   localtime_r(&ttime, &tm);
+   (void)localtime_r(&ttime, &tm);
    /* NOTE! since the compiler complains about %y, I use %y and cut the century */
    strftime(dt, maxlen, "%d-%b-%Y %H:%M", &tm);
    strcpy(dt+7, dt+9);
@@ -99,13 +99,13 @@ char *bstrutime(char *dt, int maxlen, utime_t tim)
 {
    time_t ttime = (time_t)tim;
    struct tm tm;
-   localtime_r(&ttime, &tm);
+   (void)localtime_r(&ttime, &tm);
    strftime(dt, maxlen, "%Y-%m-%d %H:%M:%S", &tm);
    return dt;
 }
 
 /* Convert standard time string yyyy-mm-dd hh:mm:ss to Unix time */
-utime_t str_to_utime(char *str) 
+utime_t str_to_utime(char *str)
 {
    struct tm tm;
    time_t ttime;
@@ -116,7 +116,7 @@ utime_t str_to_utime(char *str)
    }
    if (tm.tm_mon > 0) {
       tm.tm_mon--;
-   } else { 
+   } else {
       return 0;
    }
    if (tm.tm_year >= 1900) {
@@ -127,7 +127,7 @@ utime_t str_to_utime(char *str)
    tm.tm_wday = tm.tm_yday = 0;
    tm.tm_isdst = -1;
    ttime = mktime(&tm);
-   if (ttime == -1) {      
+   if (ttime == -1) {
       ttime = 0;
    }
    return (utime_t)ttime;
@@ -152,7 +152,7 @@ btime_t get_current_btime()
 /* Convert btime to Unix time */
 time_t btime_to_unix(btime_t bt)
 {
-   return (time_t)(bt/1000000);                   
+   return (time_t)(bt/1000000);
 }
 
 /* Convert btime to utime */
@@ -180,7 +180,7 @@ int tm_wom(int mday, int wday)
    int wom = 1 + (mday - fs - 1) / 7;
 // Dmsg4(100, "mday=%d wom=%d wday=%d fs=%d\n", mday, wom, wday, fs);
    return wom;
-}  
+}
 
 /*
  * Given a Unix date return the week of the year.
@@ -197,12 +197,12 @@ int tm_woy(time_t stime)
    time_t time4;
    struct tm tm;
    memset(&tm, 0, sizeof(struct tm));
-   localtime_r(&stime, &tm);
+   (void)localtime_r(&stime, &tm);
    tm_yday = tm.tm_yday;
    tm.tm_mon = 0;
    tm.tm_mday = 4;
    time4 = mktime(&tm);
-   localtime_r(&time4, &tm);
+   (void)localtime_r(&time4, &tm);
    fty = 1 - tm.tm_wday;
    if (fty <= 0) {
       fty += 7;
@@ -221,7 +221,7 @@ void get_current_time(struct date_time *dt)
    time_t now;
 
    now = time(NULL);
-   gmtime_r(&now, &tm);
+   (void)gmtime_r(&now, &tm);
    Dmsg6(200, "m=%d d=%d y=%d h=%d m=%d s=%d\n", tm.tm_mon+1, tm.tm_mday, tm.tm_year+1900,
       tm.tm_hour, tm.tm_min, tm.tm_sec);
    tm_encode(dt, &tm);
@@ -354,13 +354,13 @@ void date_time_decode(struct date_time *dt,
     time_decode(dt->julian_day_fraction, hour, minute, second, second_fraction);
 }
 
-/*  tm_encode  --  Encode a civil date and time from a tm structure   
+/*  tm_encode  --  Encode a civil date and time from a tm structure
  *                to a Julian day and day fraction.
  */
 
 /* Deprecated. Do not use. */
 void tm_encode(struct date_time *dt,
-                     struct tm *tm) 
+                     struct tm *tm)
 {
     uint32_t year;
     uint8_t month, day, hour, minute, second;
@@ -381,7 +381,7 @@ void tm_encode(struct date_time *dt,
 
 /* Deprecated. Do not use. */
 void tm_decode(struct date_time *dt,
-                     struct tm *tm) 
+                     struct tm *tm)
 {
     uint32_t year;
     uint8_t month, day, hour, minute, second;