get rid of a lot of warning messages.

This commit is contained in:
Marty Kraimer
2011-08-30 09:34:03 -04:00
parent 33183d3dd1
commit 7aa07aa2ce
4 changed files with 43 additions and 43 deletions

View File

@@ -704,11 +704,11 @@ int8 Convert::toByte(PVScalar * pv)
}
case pvFloat: {
PVFloat *value = static_cast<PVFloat *>(pv);
return value->get();
return static_cast<int8>(value->get());
}
case pvDouble: {
PVDouble *value = static_cast<PVDouble *>(pv);
return value->get();
return static_cast<int8>(value->get());
}
case pvString:
throw std::logic_error(String("string can not be converted to byte"));
@@ -741,11 +741,11 @@ int16 Convert::toShort(PVScalar * pv)
}
case pvFloat: {
PVFloat *value = static_cast<PVFloat *>(pv);
return value->get();
return static_cast<int16>(value->get());
}
case pvDouble: {
PVDouble *value = static_cast<PVDouble *>(pv);
return value->get();
return static_cast<int16>(value->get());
}
case pvString:
throw std::logic_error(String("string can not be converted to short"));
@@ -778,11 +778,11 @@ int32 Convert::toInt(PVScalar * pv)
}
case pvFloat: {
PVFloat *value = static_cast<PVFloat *>(pv);
return value->get();
return static_cast<int32>(value->get());
}
case pvDouble: {
PVDouble *value = static_cast<PVDouble *>(pv);
return value->get();
return static_cast<int32>(value->get());
}
case pvString:
throw std::logic_error(String("string can not be converted to int"));
@@ -815,11 +815,11 @@ int64 Convert::toLong(PVScalar * pv)
}
case pvFloat: {
PVFloat *value = static_cast<PVFloat *>(pv);
return value->get();
return static_cast<int64>(value->get());
}
case pvDouble: {
PVDouble *value = static_cast<PVDouble *>(pv);
return value->get();
return static_cast<int64>(value->get());
}
case pvString:
throw std::logic_error(String("string can not be converted to long"));
@@ -1143,19 +1143,19 @@ void Convert::fromFloat(PVScalar* pv, float from)
throw std::logic_error(String("float can not be converted to boolean"));
case pvByte: {
PVByte *value = static_cast<PVByte *>(pv);
value->put(from); return;
value->put(static_cast<int8>(from)); return;
}
case pvShort: {
PVShort *value = static_cast<PVShort *>(pv);
value->put(from); return;
value->put(static_cast<int16>(from)); return;
}
case pvInt: {
PVInt *value = static_cast<PVInt *>(pv);
value->put(from); return;
value->put(static_cast<int32>(from)); return;
}
case pvLong: {
PVLong *value = static_cast<PVLong *>(pv);
value->put(from); return;
value->put(static_cast<int64>(from)); return;
}
case pvFloat: {
PVFloat *value = static_cast<PVFloat *>(pv);
@@ -1187,19 +1187,19 @@ void Convert::fromDouble(PVScalar *pv, double from)
throw std::logic_error(String("double can not be converted to boolean"));
case pvByte: {
PVByte *value = static_cast<PVByte *>(pv);
value->put(from); return;
value->put(static_cast<int8>(from)); return;
}
case pvShort: {
PVShort *value = static_cast<PVShort *>(pv);
value->put(from); return;
value->put(static_cast<int16>(from)); return;
}
case pvInt: {
PVInt *value = static_cast<PVInt *>(pv);
value->put(from); return;
value->put(static_cast<int32>(from)); return;
}
case pvLong: {
PVLong *value = static_cast<PVLong *>(pv);
value->put(from); return;
value->put(static_cast<int64>(from)); return;
}
case pvFloat: {
PVFloat *value = static_cast<PVFloat *>(pv);
@@ -1739,7 +1739,7 @@ int convertToByteArray(PVScalarArray * pv, int offset, int len,int8 to[], int to
FloatArray dataArray = data.data;
int dataOffset = data.offset;
for (int i = 0; i < num; i++)
to[i + toOffset] = dataArray[i + dataOffset];
to[i + toOffset] = static_cast<int8>(dataArray[i + dataOffset]);
len -= num;
offset += num;
toOffset += num;
@@ -1757,7 +1757,7 @@ int convertToByteArray(PVScalarArray * pv, int offset, int len,int8 to[], int to
DoubleArray dataArray = data.data;
int dataOffset = data.offset;
for (int i = 0; i < num; i++)
to[i + toOffset] = dataArray[i + dataOffset];
to[i + toOffset] = static_cast<int8>(dataArray[i + dataOffset]);
len -= num;
offset += num;
toOffset += num;
@@ -1962,7 +1962,7 @@ int convertToShortArray(PVScalarArray * pv, int offset, int len,int16 to[], int
FloatArray dataArray = data.data;
int dataOffset = data.offset;
for (int i = 0; i < num; i++)
to[i + toOffset] = dataArray[i + dataOffset];
to[i + toOffset] = static_cast<int16>(dataArray[i + dataOffset]);
len -= num;
offset += num;
toOffset += num;
@@ -1980,7 +1980,7 @@ int convertToShortArray(PVScalarArray * pv, int offset, int len,int16 to[], int
DoubleArray dataArray = data.data;
int dataOffset = data.offset;
for (int i = 0; i < num; i++)
to[i + toOffset] = dataArray[i + dataOffset];
to[i + toOffset] = static_cast<int16>(dataArray[i + dataOffset]);
len -= num;
offset += num;
toOffset += num;
@@ -2185,7 +2185,7 @@ int convertToIntArray(PVScalarArray * pv, int offset, int len,int32 to[], int to
FloatArray dataArray = data.data;
int dataOffset = data.offset;
for (int i = 0; i < num; i++)
to[i + toOffset] = dataArray[i + dataOffset];
to[i + toOffset] = static_cast<int32>(dataArray[i + dataOffset]);
len -= num;
offset += num;
toOffset += num;
@@ -2203,7 +2203,7 @@ int convertToIntArray(PVScalarArray * pv, int offset, int len,int32 to[], int to
DoubleArray dataArray = data.data;
int dataOffset = data.offset;
for (int i = 0; i < num; i++)
to[i + toOffset] = dataArray[i + dataOffset];
to[i + toOffset] = static_cast<int32>(dataArray[i + dataOffset]);
len -= num;
offset += num;
toOffset += num;
@@ -2408,7 +2408,7 @@ int convertToLongArray(PVScalarArray * pv, int offset, int len,int64 to[], int t
FloatArray dataArray = data.data;
int dataOffset = data.offset;
for (int i = 0; i < num; i++)
to[i + toOffset] = dataArray[i + dataOffset];
to[i + toOffset] = static_cast<int64>(dataArray[i + dataOffset]);
len -= num;
offset += num;
toOffset += num;
@@ -2426,7 +2426,7 @@ int convertToLongArray(PVScalarArray * pv, int offset, int len,int64 to[], int t
DoubleArray dataArray = data.data;
int dataOffset = data.offset;
for (int i = 0; i < num; i++)
to[i + toOffset] = dataArray[i + dataOffset];
to[i + toOffset] = static_cast<int64>(dataArray[i + dataOffset]);
len -= num;
offset += num;
toOffset += num;
@@ -2456,7 +2456,7 @@ int convertFromFloatArray(PVScalarArray *pv, int offset, int len,float from[], i
PVByteArray *pvdata = static_cast<PVByteArray*>(pv);
int8 data[1];
while (len > 0) {
data[0] = from[fromOffset];
data[0] = static_cast<int8>(from[fromOffset]);
if (pvdata->put(offset, 1, data, 0) == 0)
return ntransfered;
--len;
@@ -2470,7 +2470,7 @@ int convertFromFloatArray(PVScalarArray *pv, int offset, int len,float from[], i
PVShortArray *pvdata = static_cast<PVShortArray*>(pv);
int16 data[1];
while (len > 0) {
data[0] = from[fromOffset];
data[0] = static_cast<int16>(from[fromOffset]);
if (pvdata->put(offset, 1, data, 0) == 0)
return ntransfered;
--len;
@@ -2484,7 +2484,7 @@ int convertFromFloatArray(PVScalarArray *pv, int offset, int len,float from[], i
PVIntArray *pvdata = static_cast<PVIntArray*>(pv);
int32 data[1];
while (len > 0) {
data[0] = from[fromOffset];
data[0] = static_cast<int32>(from[fromOffset]);
if (pvdata->put(offset, 1, data, 0) == 0)
return ntransfered;
--len;
@@ -2498,7 +2498,7 @@ int convertFromFloatArray(PVScalarArray *pv, int offset, int len,float from[], i
PVLongArray *pvdata = static_cast<PVLongArray*>(pv);
int64 data[1];
while (len > 0) {
data[0] = from[fromOffset];
data[0] = static_cast<int64>(from[fromOffset]);
if (pvdata->put(offset, 1, data, 0) == 0)
return ntransfered;
--len;
@@ -2679,7 +2679,7 @@ int convertFromDoubleArray(PVScalarArray *pv, int offset, int len,double from[],
PVByteArray *pvdata = static_cast<PVByteArray*>(pv);
int8 data[1];
while (len > 0) {
data[0] = from[fromOffset];
data[0] = static_cast<int8>(from[fromOffset]);
if (pvdata->put(offset, 1, data, 0) == 0)
return ntransfered;
--len;
@@ -2693,7 +2693,7 @@ int convertFromDoubleArray(PVScalarArray *pv, int offset, int len,double from[],
PVShortArray *pvdata = static_cast<PVShortArray*>(pv);
int16 data[1];
while (len > 0) {
data[0] = from[fromOffset];
data[0] = static_cast<int16>(from[fromOffset]);
if (pvdata->put(offset, 1, data, 0) == 0)
return ntransfered;
--len;
@@ -2707,7 +2707,7 @@ int convertFromDoubleArray(PVScalarArray *pv, int offset, int len,double from[],
PVIntArray *pvdata = static_cast<PVIntArray*>(pv);
int32 data[1];
while (len > 0) {
data[0] = from[fromOffset];
data[0] = static_cast<int32>(from[fromOffset]);
if (pvdata->put(offset, 1, data, 0) == 0)
return ntransfered;
--len;
@@ -2721,7 +2721,7 @@ int convertFromDoubleArray(PVScalarArray *pv, int offset, int len,double from[],
PVLongArray *pvdata = static_cast<PVLongArray*>(pv);
int64 data[1];
while (len > 0) {
data[0] = from[fromOffset];
data[0] = static_cast<int64>(from[fromOffset]);
if (pvdata->put(offset, 1, data, 0) == 0)
return ntransfered;
--len;

View File

@@ -156,8 +156,8 @@ TimeStamp & TimeStamp::operator-=(int64 seconds)
TimeStamp & TimeStamp::operator+=(double seconds)
{
int64 secs = seconds;
int64 nano = (seconds - secs)*1e9;
int64 secs = static_cast<int64>(seconds);
int64 nano = static_cast<int64>((seconds - secs)*1e9);
nanoSeconds += nano;
if(nanoSeconds>nanoSecPerSec) {
nanoSeconds -= nanoSecPerSec;

View File

@@ -5,7 +5,7 @@ There is a logic_error
On line 68 of ../testBaseException.cpp
../bin/linux-x86/testBaseException[0x80497b9]
../bin/linux-x86/testBaseException[0x8049a54]
/lib/libc.so.6(__libc_start_main+0xe6)[0x126e36]
/lib/libc.so.6(__libc_start_main+0xe6)[0x3aae36]
../bin/linux-x86/testBaseException[0x80490e1]
To translate run 'addr2line -e execname 0xXXXXXXX ...'
Note: Must be compiled with debug symbols
@@ -17,7 +17,7 @@ On line 75 of ../testBaseException.cpp
../bin/linux-x86/testBaseException() [0x8049cec]
../bin/linux-x86/testBaseException() [0x8049923]
../bin/linux-x86/testBaseException() [0x8049a54]
/lib/libc.so.6(__libc_start_main+0xe6) [0x126e36]
/lib/libc.so.6(__libc_start_main+0xe6) [0x3aae36]
../bin/linux-x86/testBaseException() [0x80490e1]
testBaseException...
@@ -26,7 +26,7 @@ all is OK
On line 48 of ../testBaseException.cpp
../bin/linux-x86/testBaseException() [0x8049581]
../bin/linux-x86/testBaseException() [0x8049a5c]
/lib/libc.so.6(__libc_start_main+0xe6) [0x126e36]
/lib/libc.so.6(__libc_start_main+0xe6) [0x3aae36]
../bin/linux-x86/testBaseException() [0x80490e1]
@@ -38,7 +38,7 @@ On line 57 of ../testBaseException.cpp
../bin/linux-x86/testBaseException() [0x80491ec]
../bin/linux-x86/testBaseException() [0x80496f9]
../bin/linux-x86/testBaseException() [0x8049a5c]
/lib/libc.so.6(__libc_start_main+0xe6) [0x126e36]
/lib/libc.so.6(__libc_start_main+0xe6) [0x3aae36]
../bin/linux-x86/testBaseException() [0x80490e1]

View File

@@ -1,5 +1,5 @@
--- testBaseExceptionGold 2011-04-27 13:11:55.000000000 -0400
+++ testBaseException 2011-06-07 07:20:29.000000000 -0400
+++ testBaseException 2011-08-30 09:31:21.000000000 -0400
@@ -1,37 +1,46 @@
+
+
@@ -8,7 +8,7 @@
+On line 68 of ../testBaseException.cpp
+../bin/linux-x86/testBaseException[0x80497b9]
+../bin/linux-x86/testBaseException[0x8049a54]
+/lib/libc.so.6(__libc_start_main+0xe6)[0x126e36]
+/lib/libc.so.6(__libc_start_main+0xe6)[0x3aae36]
+../bin/linux-x86/testBaseException[0x80490e1]
+To translate run 'addr2line -e execname 0xXXXXXXX ...'
+ Note: Must be compiled with debug symbols
@@ -20,7 +20,7 @@
+../bin/linux-x86/testBaseException() [0x8049cec]
+../bin/linux-x86/testBaseException() [0x8049923]
+../bin/linux-x86/testBaseException() [0x8049a54]
+/lib/libc.so.6(__libc_start_main+0xe6) [0x126e36]
+/lib/libc.so.6(__libc_start_main+0xe6) [0x3aae36]
+../bin/linux-x86/testBaseException() [0x80490e1]
+
testBaseException...
@@ -34,7 +34,7 @@
+On line 48 of ../testBaseException.cpp
+../bin/linux-x86/testBaseException() [0x8049581]
+../bin/linux-x86/testBaseException() [0x8049a5c]
+/lib/libc.so.6(__libc_start_main+0xe6) [0x126e36]
+/lib/libc.so.6(__libc_start_main+0xe6) [0x3aae36]
+../bin/linux-x86/testBaseException() [0x80490e1]
+
@@ -67,7 +67,7 @@
+../bin/linux-x86/testBaseException() [0x80491ec]
+../bin/linux-x86/testBaseException() [0x80496f9]
+../bin/linux-x86/testBaseException() [0x8049a5c]
+/lib/libc.so.6(__libc_start_main+0xe6) [0x126e36]
+/lib/libc.so.6(__libc_start_main+0xe6) [0x3aae36]
+../bin/linux-x86/testBaseException() [0x80490e1]
+