Fix bountiful sources of VC++ 'possible loss of data' warnings
authorJeff Cohen <jeffc@jolt-lang.org>
Sat, 1 Jan 2005 18:58:23 +0000 (18:58 +0000)
committerJeff Cohen <jeffc@jolt-lang.org>
Sat, 1 Jan 2005 18:58:23 +0000 (18:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19224 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IntrinsicInst.h
include/llvm/System/TimeValue.h

index e82663debcc209913aa560d5b950d8ca124b60ba..857e4cbeb135afe1578b6450612180e2a5afee88 100644 (file)
@@ -74,10 +74,10 @@ namespace llvm {
   struct DbgStopPointInst : public DbgInfoIntrinsic {
 
     unsigned getLineNo() const {
-      return cast<ConstantInt>(getOperand(2))->getRawValue();
+      return unsigned(cast<ConstantInt>(getOperand(2))->getRawValue());
     }
     unsigned getColNo() const {
-      return cast<ConstantInt>(getOperand(3))->getRawValue();
+      return unsigned(cast<ConstantInt>(getOperand(3))->getRawValue());
     }
     Value *getContext() const { return const_cast<Value*>(getOperand(4)); }
 
index e8a8365c4e886bf23079701992d96aed51db7b10..c8461d23b00e2a202840258e5d7dcfffa04a7970 100644 (file)
@@ -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();
     }