]> sjero.net Git - wget/commitdiff
[svn] Remove unnecessary casts to time_t. Insert the cast from -1 to time_t,
authorhniksic <devnull@localhost>
Wed, 18 May 2005 17:22:28 +0000 (10:22 -0700)
committerhniksic <devnull@localhost>
Wed, 18 May 2005 17:22:28 +0000 (10:22 -0700)
needed on systems with unsigned time_t.

src/ChangeLog
src/cookies.c

index 9e3d845f54f88eec9d2014eebbba1713f63b849a..d4a3068270ba306e44081a566a6890f3b74bc0d4 100644 (file)
@@ -1,3 +1,11 @@
+2005-05-18  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * cookies.c (update_cookie_field): Explicitly cast -1 to time_t to
+       cope with systems where time_t is unsigned.
+
+       * cookies.c: Remove unnecessary casts to time_t from values
+       already of that type.
+
 2005-05-17  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * ftp.c (ftp_loop_internal): Same here.
index eb3f879f5716ab6fe071b4080c49a8ff414f43a6..616748c8d8533846953bbf9da0f1c6d8bdc5f378 100644 (file)
@@ -264,7 +264,7 @@ store_cookie (struct cookie_jar *jar, struct cookie *cookie)
 #ifdef ENABLE_DEBUG
   if (opt.debug)
     {
-      time_t exptime = (time_t) cookie->expiry_time;
+      time_t exptime = cookie->expiry_time;
       DEBUGP (("\nStored cookie %s %d%s %s <%s> <%s> [expiry %s] %s %s\n",
               cookie->domain, cookie->port,
               cookie->port == PORT_ANY ? " (ANY)" : "",
@@ -394,10 +394,10 @@ update_cookie_field (struct cookie *cookie,
       BOUNDED_TO_ALLOCA (value_b, value_e, value_copy);
 
       expires = http_atotm (value_copy);
-      if (expires != -1)
+      if (expires != (time_t) -1)
        {
          cookie->permanent = 1;
-         cookie->expiry_time = (time_t)expires;
+         cookie->expiry_time = expires;
        }
       else
        /* Error in expiration spec.  Assume default (cookie doesn't