r8946: Some casts to fix warnings when time_t is an unsigned type. Fixes
authorTim Potter <tpot@samba.org>
Tue, 2 Aug 2005 20:44:30 +0000 (20:44 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:00:22 +0000 (11:00 -0500)
bugzilla #1888 and #1894.
(This used to be commit dcc74371388d280d8ee5130a04e1594ae88d19b3)

source3/lib/time.c
source3/nmbd/nmbd_workgroupdb.c

index f7b0aefe4fe6023d8ae9bcdd84b344db09e67483..5e0f5646fca9eb3385f4bc6e9adc93ed67821b1e 100644 (file)
@@ -366,7 +366,7 @@ time_t nt_time_to_unix_abs(NTTIME *nt)
                return(0);
 
        if (nt->high==0x80000000 && nt->low==0)
-               return -1;
+               return (time_t)-1;
 
        /* reverse the time */
        /* it's a negative value, turn it to positive */
@@ -421,7 +421,7 @@ void unix_to_nt_time(NTTIME *nt, time_t t)
                nt->high = 0x7fffffff;
                return;
        }               
-       if (t == -1) {
+       if (t == (time_t)-1) {
                nt->low = 0xffffffff;
                nt->high = 0xffffffff;
                return;
@@ -462,7 +462,7 @@ void unix_to_nt_time_abs(NTTIME *nt, time_t t)
                return;
        }
                
-       if (t == -1) {
+       if (t == (time_t)-1) {
                /* that's what NT uses for infinite */
                nt->low = 0x0;
                nt->high = 0x80000000;
index 917116dd07708ae6e4fe4460e49c99d384317876..335d5220310fc4d6cae6006c1d9ca2db260e1fb5 100644 (file)
@@ -322,7 +322,7 @@ void expire_workgroups_and_servers(time_t t)
                        expire_servers(work, t);
 
                        if ((work->serverlist == NULL) && (work->death_time != PERMANENT_TTL) && 
-                                       ((t == -1) || (work->death_time < t))) {
+                                       ((t == (time_t)-1) || (work->death_time < t))) {
                                DEBUG(3,("expire_workgroups_and_servers: Removing timed out workgroup %s\n",
                                                work->work_group));
                                remove_workgroup_from_subnet(subrec, work);