svn commit: r246460 - projects/calloutng/sys/sys

Alexander Motin mav at FreeBSD.org
Thu Feb 7 11:01:02 UTC 2013


Author: mav
Date: Thu Feb  7 11:01:01 2013
New Revision: 246460
URL: http://svnweb.freebsd.org/changeset/base/246460

Log:
  Use unsigned type when dealing with fractional part.

Modified:
  projects/calloutng/sys/sys/time.h

Modified: projects/calloutng/sys/sys/time.h
==============================================================================
--- projects/calloutng/sys/sys/time.h	Thu Feb  7 10:40:45 2013	(r246459)
+++ projects/calloutng/sys/sys/time.h	Thu Feb  7 11:01:01 2013	(r246460)
@@ -227,7 +227,7 @@ timespec2sbintime(struct timespec ts)
 {
 
 	return (((sbintime_t)ts.tv_sec << 32) +
-	    (ts.tv_nsec * (((sbintime_t)1 << 63) / 500000000) >> 32));
+	    (ts.tv_nsec * (((uint64_t)1 << 63) / 500000000) >> 32));
 }
 
 static __inline struct timeval
@@ -245,7 +245,7 @@ timeval2sbintime(struct timeval tv)
 {
 	
 	return (((sbintime_t)tv.tv_sec << 32) +
-	    (tv.tv_usec * (((sbintime_t)1 << 63) / 500000) >> 32));
+	    (tv.tv_usec * (((uint64_t)1 << 63) / 500000) >> 32));
 }
 
 #endif /* __BSD_VISIBLE */


More information about the svn-src-projects mailing list