From 00dcbaa6e5d2f44ee0d0a7dc5bceabda6b30b504 Mon Sep 17 00:00:00 2001 From: Jeff Cohen Date: Sat, 1 Jan 2005 18:58:23 +0000 Subject: [PATCH] Fix bountiful sources of VC++ 'possible loss of data' warnings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19224 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IntrinsicInst.h | 4 ++-- include/llvm/System/TimeValue.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h index e82663debcc..857e4cbeb13 100644 --- a/include/llvm/IntrinsicInst.h +++ b/include/llvm/IntrinsicInst.h @@ -74,10 +74,10 @@ namespace llvm { struct DbgStopPointInst : public DbgInfoIntrinsic { unsigned getLineNo() const { - return cast(getOperand(2))->getRawValue(); + return unsigned(cast(getOperand(2))->getRawValue()); } unsigned getColNo() const { - return cast(getOperand(3))->getRawValue(); + return unsigned(cast(getOperand(3))->getRawValue()); } Value *getContext() const { return const_cast(getOperand(4)); } diff --git a/include/llvm/System/TimeValue.h b/include/llvm/System/TimeValue.h index e8a8365c4e8..c8461d23b00 100644 --- a/include/llvm/System/TimeValue.h +++ b/include/llvm/System/TimeValue.h @@ -314,7 +314,7 @@ namespace sys { /// @brief Converts from microsecond format to TimeValue format void usec( int64_t microseconds ) { this->seconds_ = microseconds / MICROSECONDS_PER_SECOND; - this->nanos_ = (microseconds % MICROSECONDS_PER_SECOND) * + this->nanos_ = NanoSecondsType(microseconds % MICROSECONDS_PER_SECOND) * NANOSECONDS_PER_MICROSECOND; this->normalize(); } @@ -322,7 +322,7 @@ namespace sys { /// @brief Converts from millisecond format to TimeValue format void msec( int64_t milliseconds ) { this->seconds_ = milliseconds / MILLISECONDS_PER_SECOND; - this->nanos_ = (milliseconds % MILLISECONDS_PER_SECOND) * + this->nanos_ = NanoSecondsType(milliseconds % MILLISECONDS_PER_SECOND) * NANOSECONDS_PER_MILLISECOND; this->normalize(); }