diff --git a/CMakeLists.txt b/CMakeLists.txt index be2eeb5..1693c44 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 2287546..aff7ad8 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 d15cf95..b66dc53 100644 --- a/api/generator.h +++ b/api/generator.h @@ -270,7 +270,7 @@ class Exclusion } // 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 b8f038c..c71d9da 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 5f8b544..cc997b9 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( param.Values.size() ), + Parameter* gcdParam = new Parameter( UNDEFINED_ORDER, static_cast(index), + static_cast( 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 2bdf106..2a30f84 100644 --- a/cli/model.h +++ b/cli/model.h @@ -61,7 +61,7 @@ class CModelParameter CModelParameter() : Name(L""), IsResultParameter(false), - Order(UNDEFINED_ORDER), + Order(static_cast(UNDEFINED_ORDER)), GcdPointer(nullptr){} int GetValueOrdinal( IN std::wstring& name, IN bool caseSensitive ); diff --git a/cli/mparser.cpp b/cli/mparser.cpp index e729c32..ca1fc3f 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(UNDEFINED_ORDER); //check if this param has custom-order defined wstrings nameAndOrder; diff --git a/clidll/dllmain.cpp b/clidll/dllmain.cpp index 1ea5a22..7ded2bc 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)