diff --git a/CMakeLists.txt b/CMakeLists.txt index be2eeb55ccca46c847d75280c76f8a47a8c84870..1693c44ea9313ef7a9f0f13ffd4fa8daf83a3a5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,8 @@ if (MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") target_compile_options(${PICT_BUILD_OPTIONS} INTERFACE - /W3 + /W4 /WX + /wd4189 # DOUT(arg) has unused parameters. Suppressing the warning here. ) target_compile_definitions(${PICT_BUILD_OPTIONS} diff --git a/api-usage/pictapi-sample.cpp b/api-usage/pictapi-sample.cpp index 2287546b0628ec0361b128536f90c3f29a5c19d2..aff7ad8062a50908098ee2c39a835761373d8fbc 100644 --- a/api-usage/pictapi-sample.cpp +++ b/api-usage/pictapi-sample.cpp @@ -34,7 +34,6 @@ void __cdecl wmain() PICT_RET_CODE ret = PICT_SUCCESS; PICT_HANDLE task = PictCreateTask(); - checkNull( task ); // // In a general case, models might form a tree-like hierarchy @@ -42,6 +41,7 @@ void __cdecl wmain() // PICT_HANDLE model = PictCreateModel(); + checkNull( task ); checkNull( model ); // diff --git a/api/generator.h b/api/generator.h index d15cf95595828a85b7422eaeb47fc1cb4768ba07..b66dc534b9865f109f3f1eb486039ece7cecd354 100644 --- a/api/generator.h +++ b/api/generator.h @@ -270,7 +270,7 @@ public: } // for inserter() to work we need two-param insert - iterator insert( iterator pos, const ExclusionTerm& Term ) + iterator insert( iterator, const ExclusionTerm& Term ) { return insert( Term ).first; } diff --git a/cli/ctokenizer.cpp b/cli/ctokenizer.cpp index b8f038c1dacb3e75dbfeb97b2c9667080f73f725..c71d9da88ed5613339a22b9ea2ca505270e559f4 100644 --- a/cli/ctokenizer.cpp +++ b/cli/ctokenizer.cpp @@ -532,9 +532,6 @@ RelationType ConstraintsTokenizer::getRelationType() else throw CSyntaxError( SyntaxErrorType::UnknownRelation, _currentPosition ); } else throw CSyntaxError( SyntaxErrorType::UnknownRelation, _currentPosition ); - - assert( false ); - return ( RelationType::Unknown ); } // diff --git a/cli/gcdmodel.cpp b/cli/gcdmodel.cpp index 5f8b5446ad2a8c271bcf767b489d62da9b3623f8..cc997b94da6129305b6d82c2b223cdaabba53e99 100644 --- a/cli/gcdmodel.cpp +++ b/cli/gcdmodel.cpp @@ -162,7 +162,8 @@ ErrorCode CGcdData::TranslateToGCD() { CModelParameter& param = _modelData.Parameters[ index ]; - Parameter* gcdParam = new Parameter( UNDEFINED_ORDER, index, static_cast<int>( param.Values.size() ), + Parameter* gcdParam = new Parameter( UNDEFINED_ORDER, static_cast<int>(index), + static_cast<int>( param.Values.size() ), param.Name, param.IsResultParameter ); // find out and assign weights to values diff --git a/cli/model.h b/cli/model.h index 2bdf1066d5b6812c539aa7062b004e081e069982..2a30f8451be7f8ca08b9d56251451176be62007a 100644 --- a/cli/model.h +++ b/cli/model.h @@ -61,7 +61,7 @@ public: CModelParameter() : Name(L""), IsResultParameter(false), - Order(UNDEFINED_ORDER), + Order(static_cast<unsigned int>(UNDEFINED_ORDER)), GcdPointer(nullptr){} int GetValueOrdinal( IN std::wstring& name, IN bool caseSensitive ); diff --git a/cli/mparser.cpp b/cli/mparser.cpp index e729c32ad99cbd745ef52ec0ac6819bf1545689f..ca1fc3f1b234c6f59b34645b7125077e3509c51b 100644 --- a/cli/mparser.cpp +++ b/cli/mparser.cpp @@ -134,7 +134,7 @@ bool CModelData::readParameter( wstring& line ) wstring name = trim( line.substr( 0, paramSep )); - unsigned int order = UNDEFINED_ORDER; + unsigned int order = static_cast<unsigned int>(UNDEFINED_ORDER); //check if this param has custom-order defined wstrings nameAndOrder; diff --git a/clidll/dllmain.cpp b/clidll/dllmain.cpp index 1ea5a226b3b54bd394d0177baaaf701e35e540b8..7ded2bcce7d1571dca6f6a217dfff3feba79c564 100644 --- a/clidll/dllmain.cpp +++ b/clidll/dllmain.cpp @@ -1,9 +1,9 @@ #if defined(_WIN32) #include "windows.h" -BOOL APIENTRY DllMain( HMODULE hModule, +BOOL APIENTRY DllMain( HMODULE /*hModule*/, DWORD ul_reason_for_call, - LPVOID lpReserved + LPVOID /*lpReserved*/ ) { switch (ul_reason_for_call)