From 7aa07aa2cefda24f11faff93f35e0ff0d30c630b Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Tue, 30 Aug 2011 09:34:03 -0400 Subject: [PATCH] get rid of a lot of warning messages. --- pvDataApp/factory/Convert.cpp | 64 ++++++++++++++++---------------- pvDataApp/property/timeStamp.cpp | 4 +- test/testBaseException | 8 ++-- test/testBaseExceptionDiff | 10 ++--- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/pvDataApp/factory/Convert.cpp b/pvDataApp/factory/Convert.cpp index 3174098..0491dbd 100644 --- a/pvDataApp/factory/Convert.cpp +++ b/pvDataApp/factory/Convert.cpp @@ -704,11 +704,11 @@ int8 Convert::toByte(PVScalar * pv) } case pvFloat: { PVFloat *value = static_cast(pv); - return value->get(); + return static_cast(value->get()); } case pvDouble: { PVDouble *value = static_cast(pv); - return value->get(); + return static_cast(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(pv); - return value->get(); + return static_cast(value->get()); } case pvDouble: { PVDouble *value = static_cast(pv); - return value->get(); + return static_cast(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(pv); - return value->get(); + return static_cast(value->get()); } case pvDouble: { PVDouble *value = static_cast(pv); - return value->get(); + return static_cast(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(pv); - return value->get(); + return static_cast(value->get()); } case pvDouble: { PVDouble *value = static_cast(pv); - return value->get(); + return static_cast(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(pv); - value->put(from); return; + value->put(static_cast(from)); return; } case pvShort: { PVShort *value = static_cast(pv); - value->put(from); return; + value->put(static_cast(from)); return; } case pvInt: { PVInt *value = static_cast(pv); - value->put(from); return; + value->put(static_cast(from)); return; } case pvLong: { PVLong *value = static_cast(pv); - value->put(from); return; + value->put(static_cast(from)); return; } case pvFloat: { PVFloat *value = static_cast(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(pv); - value->put(from); return; + value->put(static_cast(from)); return; } case pvShort: { PVShort *value = static_cast(pv); - value->put(from); return; + value->put(static_cast(from)); return; } case pvInt: { PVInt *value = static_cast(pv); - value->put(from); return; + value->put(static_cast(from)); return; } case pvLong: { PVLong *value = static_cast(pv); - value->put(from); return; + value->put(static_cast(from)); return; } case pvFloat: { PVFloat *value = static_cast(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(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(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(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(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(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(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(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(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(pv); int8 data[1]; while (len > 0) { - data[0] = from[fromOffset]; + data[0] = static_cast(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(pv); int16 data[1]; while (len > 0) { - data[0] = from[fromOffset]; + data[0] = static_cast(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(pv); int32 data[1]; while (len > 0) { - data[0] = from[fromOffset]; + data[0] = static_cast(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(pv); int64 data[1]; while (len > 0) { - data[0] = from[fromOffset]; + data[0] = static_cast(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(pv); int8 data[1]; while (len > 0) { - data[0] = from[fromOffset]; + data[0] = static_cast(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(pv); int16 data[1]; while (len > 0) { - data[0] = from[fromOffset]; + data[0] = static_cast(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(pv); int32 data[1]; while (len > 0) { - data[0] = from[fromOffset]; + data[0] = static_cast(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(pv); int64 data[1]; while (len > 0) { - data[0] = from[fromOffset]; + data[0] = static_cast(from[fromOffset]); if (pvdata->put(offset, 1, data, 0) == 0) return ntransfered; --len; diff --git a/pvDataApp/property/timeStamp.cpp b/pvDataApp/property/timeStamp.cpp index 5314656..f37290f 100644 --- a/pvDataApp/property/timeStamp.cpp +++ b/pvDataApp/property/timeStamp.cpp @@ -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(seconds); + int64 nano = static_cast((seconds - secs)*1e9); nanoSeconds += nano; if(nanoSeconds>nanoSecPerSec) { nanoSeconds -= nanoSecPerSec; diff --git a/test/testBaseException b/test/testBaseException index 0de1968..e195adc 100644 --- a/test/testBaseException +++ b/test/testBaseException @@ -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] diff --git a/test/testBaseExceptionDiff b/test/testBaseExceptionDiff index 7a7e2f2..3aecec5 100644 --- a/test/testBaseExceptionDiff +++ b/test/testBaseExceptionDiff @@ -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] +