[PATCH] uuid: make integer arithmetic conversion explicit

Gedare Bloom gedare at rtems.org
Thu Sep 5 18:51:26 UTC 2013


Upcast multiplication to 64-bit integer arithmetic.
---
 cpukit/libmisc/uuid/gen_uuid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpukit/libmisc/uuid/gen_uuid.c b/cpukit/libmisc/uuid/gen_uuid.c
index 0599637..4d10ff3 100644
--- a/cpukit/libmisc/uuid/gen_uuid.c
+++ b/cpukit/libmisc/uuid/gen_uuid.c
@@ -402,7 +402,7 @@ try_again:
 		last = tv;
 	}
 
-	clock_reg = tv.tv_usec*10 + adjustment;
+	clock_reg = ((uint64_t) tv.tv_usec)*10 + adjustment;
 	clock_reg += ((uint64_t) tv.tv_sec)*10000000;
 	clock_reg += (((uint64_t) 0x01B21DD2) << 32) + 0x13814000;
 
-- 
1.7.1




More information about the devel mailing list