From 279b73a47766a27850402700f433ef7e7537c9e0 Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Thu, 28 Nov 2013 21:31:02 +0100 Subject: [PATCH] win32 port : warnings removed --- pvDataApp/factory/PVUnion.cpp | 2 +- pvDataApp/misc/epicsException.h | 7 ++++++- testApp/pv/testPVAuxInfo.cpp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pvDataApp/factory/PVUnion.cpp b/pvDataApp/factory/PVUnion.cpp index b4bd4e0..2eaa8c5 100644 --- a/pvDataApp/factory/PVUnion.cpp +++ b/pvDataApp/factory/PVUnion.cpp @@ -130,7 +130,7 @@ void PVUnion::set(int32 index, PVFieldPtr const & value) void PVUnion::set(String const & fieldName, PVFieldPtr const & value) { - int32 index = variant ? -1 : unionPtr->getFieldIndex(fieldName); + int32 index = variant ? -1 : static_cast(unionPtr->getFieldIndex(fieldName)); if (index == -1) throw std::invalid_argument("no such fieldName"); diff --git a/pvDataApp/misc/epicsException.h b/pvDataApp/misc/epicsException.h index d191c29..eb7e6af 100644 --- a/pvDataApp/misc/epicsException.h +++ b/pvDataApp/misc/epicsException.h @@ -35,7 +35,8 @@ #define EPICSEXCEPTION_H_ #ifdef _WIN32 -#pragma warning(disable: 4251) +#pragma warning( push ) +#pragma warning(disable: 4275) // warning C4275: non dll-interface class used as base for dll-interface class (std::logic_error) #endif #include @@ -214,6 +215,10 @@ private: mutable std::string base_msg; }; +#ifdef _WIN32 +#pragma warning( pop ) +#endif + #define THROW_BASE_EXCEPTION(msg) THROW_EXCEPTION2(::epics::pvData::BaseException, msg) #define THROW_BASE_EXCEPTION_CAUSE(msg, cause) THROW_EXCEPTION2(::epics::pvData::BaseException, msg) diff --git a/testApp/pv/testPVAuxInfo.cpp b/testApp/pv/testPVAuxInfo.cpp index 494d1d1..52d510b 100644 --- a/testApp/pv/testPVAuxInfo.cpp +++ b/testApp/pv/testPVAuxInfo.cpp @@ -42,7 +42,7 @@ static void printOffsets(PVStructurePtr pvStructure) (long unsigned)pvStructure->getNextFieldOffset(), (long unsigned)pvStructure->getNumberFields()); PVFieldPtrArray fields = pvStructure->getPVFields(); - int number = pvStructure->getStructure()->getNumberFields(); + int number = (int)pvStructure->getStructure()->getNumberFields(); for(int i=0; igetField()->getType()==structure) {