svn commit: samba r20695 - in branches: SAMBA_3_0/source/lib
SAMBA_3_0_24/source/lib
jra at samba.org
jra at samba.org
Fri Jan 12 02:58:01 GMT 2007
Author: jra
Date: 2007-01-12 02:58:01 +0000 (Fri, 12 Jan 2007)
New Revision: 20695
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20695
Log:
Remove duplication of constants.
Jeremy.
Modified:
branches/SAMBA_3_0/source/lib/time.c
branches/SAMBA_3_0_24/source/lib/time.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/time.c
===================================================================
--- branches/SAMBA_3_0/source/lib/time.c 2007-01-12 02:48:37 UTC (rev 20694)
+++ branches/SAMBA_3_0/source/lib/time.c 2007-01-12 02:58:01 UTC (rev 20695)
@@ -56,8 +56,6 @@
#endif
}
-#define TIME_FIXUP_CONSTANT 11644473600LL
-
struct timespec convert_time_t_to_timespec(time_t t)
{
struct timespec ts;
@@ -107,7 +105,7 @@
}
t2 = t;
- t2 += TIME_FIXUP_CONSTANT;
+ t2 += TIME_FIXUP_CONSTANT_INT;
t2 *= 1000*1000*10;
*nt = t2;
@@ -545,7 +543,7 @@
NTTIME timeval_to_nttime(const struct timeval *tv)
{
return 10*(tv->tv_usec +
- ((TIME_FIXUP_CONSTANT + (uint64_t)tv->tv_sec) * 1000000));
+ ((TIME_FIXUP_CONSTANT_INT + (uint64_t)tv->tv_sec) * 1000000));
}
/*******************************************************************
@@ -1075,13 +1073,6 @@
return make_unix_date3(date_ptr, cli->serverzone);
}
-#if (SIZEOF_LONG == 8)
-#define TIME_FIXUP_CONSTANT_INT 11644473600L
-#elif (SIZEOF_LONG_LONG == 8)
-#define TIME_FIXUP_CONSTANT_INT 11644473600LL
-#endif
-
-
/* Large integer version. */
struct timespec nt_time_to_unix_timespec(NTTIME *nt)
{
Modified: branches/SAMBA_3_0_24/source/lib/time.c
===================================================================
--- branches/SAMBA_3_0_24/source/lib/time.c 2007-01-12 02:48:37 UTC (rev 20694)
+++ branches/SAMBA_3_0_24/source/lib/time.c 2007-01-12 02:58:01 UTC (rev 20695)
@@ -56,8 +56,6 @@
#endif
}
-#define TIME_FIXUP_CONSTANT 11644473600LL
-
struct timespec convert_time_t_to_timespec(time_t t)
{
struct timespec ts;
@@ -107,7 +105,7 @@
}
t2 = t;
- t2 += TIME_FIXUP_CONSTANT;
+ t2 += TIME_FIXUP_CONSTANT_INT;
t2 *= 1000*1000*10;
*nt = t2;
@@ -545,7 +543,7 @@
NTTIME timeval_to_nttime(const struct timeval *tv)
{
return 10*(tv->tv_usec +
- ((TIME_FIXUP_CONSTANT + (uint64_t)tv->tv_sec) * 1000000));
+ ((TIME_FIXUP_CONSTANT_INT + (uint64_t)tv->tv_sec) * 1000000));
}
/*******************************************************************
@@ -1075,13 +1073,6 @@
return make_unix_date3(date_ptr, cli->serverzone);
}
-#if (SIZEOF_LONG == 8)
-#define TIME_FIXUP_CONSTANT_INT 11644473600L
-#elif (SIZEOF_LONG_LONG == 8)
-#define TIME_FIXUP_CONSTANT_INT 11644473600LL
-#endif
-
-
/* Large integer version. */
struct timespec nt_time_to_unix_timespec(NTTIME *nt)
{
More information about the samba-cvs
mailing list