diff --git a/modules/gui/src/cpp/QtWorkspaceBrowser.cpp b/modules/gui/src/cpp/QtWorkspaceBrowser.cpp index 9be1f5e7f4..3da2de75c1 100644 --- a/modules/gui/src/cpp/QtWorkspaceBrowser.cpp +++ b/modules/gui/src/cpp/QtWorkspaceBrowser.cpp @@ -245,7 +245,6 @@ QtWorkspaceBrowser::updateVariables() m_tableWidget->setRowCount((int)variablesList.size()); for (int i = 0; i < variablesList.size(); i++) { - bool isPersistent = m_context->isVariablePersistent(wstring_to_utf8(variablesList[i])); bool isGlobal = m_context->isVariableGlobal(wstring_to_utf8(variablesList[i])); ArrayOf* variable = m_context->lookupVariable(wstring_to_utf8(variablesList[i])); if (variable) { diff --git a/modules/hdf5/src/cpp/h5SaveLoadHelpers.cpp b/modules/hdf5/src/cpp/h5SaveLoadHelpers.cpp index 4f712c2564..29be58402d 100644 --- a/modules/hdf5/src/cpp/h5SaveLoadHelpers.cpp +++ b/modules/hdf5/src/cpp/h5SaveLoadHelpers.cpp @@ -267,7 +267,6 @@ getNelsonDimensions(hid_t fid, const std::string& location, const std::string& v return res; } hid_t type = H5Aget_type(attr_id); - hsize_t sDim = H5Tget_size(type); uint64* ptrUint64 = nullptr; try { ptrUint64 = new uint64[(size_t)dims[1]]; diff --git a/modules/mex/src/cpp/MxStruct.cpp b/modules/mex/src/cpp/MxStruct.cpp index c38b933b66..e2da5a2e4b 100644 --- a/modules/mex/src/cpp/MxStruct.cpp +++ b/modules/mex/src/cpp/MxStruct.cpp @@ -168,10 +168,6 @@ mxAddField(mxArray* pm, const char* fieldname) void mxRemoveField(mxArray* pm, int fieldnumber) { - if (mxIsStruct(pm)) { - auto* ptr = (Nelson::ArrayOf*)pm->ptr; - Nelson::ArrayOf* qp = (Nelson::ArrayOf*)ptr->getDataPointer(); - } auto* ptr = (Nelson::ArrayOf*)pm->ptr; Nelson::stringVector fieldnames = ptr->getFieldNames(); size_t fieldCount = ptr->getFieldNames().size(); diff --git a/modules/os_functions/src/cpp/SystemCommand.cpp b/modules/os_functions/src/cpp/SystemCommand.cpp index 8950b6305d..2ea87ca073 100644 --- a/modules/os_functions/src/cpp/SystemCommand.cpp +++ b/modules/os_functions/src/cpp/SystemCommand.cpp @@ -69,7 +69,6 @@ ParallelSystemCommand(const wstringVector& commands, const std::vector& size_t nbCommands = commands.size(); results.resize(nbCommands); std::vector taskList; - #if defined(__APPLE__) or (defined(_WIN32) && not defined(_WIN64)) for (ompIndexType k = 0; k < (ompIndexType)nbCommands; k++) { SystemCommandTask* task = new SystemCommandTask(); @@ -84,8 +83,6 @@ ParallelSystemCommand(const wstringVector& commands, const std::vector& taskList[k]->evaluateCommand(commands[k], timeouts[k]); } #else - size_t nbThreadsMax = (size_t)NelsonConfiguration::getInstance()->getMaxNumCompThreads(); - size_t nbThreads = std::min(nbCommands, nbThreadsMax); std::vector threadList; for (size_t k = 0; k < nbCommands; k++) { try { diff --git a/modules/sparse/src/cpp/HorzCatSparseDouble.cpp b/modules/sparse/src/cpp/HorzCatSparseDouble.cpp index 431110a77c..c1476b32ab 100644 --- a/modules/sparse/src/cpp/HorzCatSparseDouble.cpp +++ b/modules/sparse/src/cpp/HorzCatSparseDouble.cpp @@ -51,7 +51,6 @@ HorzCatSparseDouble(ArrayOf A, ArrayOf B) Dimensions dimsB = B.getDimensions(); indexType newRowsSize = dimsA.getRows(); indexType newColumnsSize = dimsA.getColumns() + dimsB.getColumns(); - indexType newSize = newColumnsSize * newRowsSize; Dimensions dimsC = Dimensions(newRowsSize, newColumnsSize); try { spMatC = new Eigen::SparseMatrix( @@ -73,7 +72,6 @@ HorzCatSparseDouble(ArrayOf A, ArrayOf B) Dimensions dimsB = B.getDimensions(); indexType newRowsSize = dimsA.getRows(); indexType newColumnsSize = dimsA.getColumns() + dimsB.getColumns(); - indexType newSize = newColumnsSize * newRowsSize; Dimensions dimsC = Dimensions(newRowsSize, newColumnsSize); try { spMatC diff --git a/modules/sparse/src/cpp/HorzCatSparseLogical.cpp b/modules/sparse/src/cpp/HorzCatSparseLogical.cpp index 0aa4420a1c..7419fb5626 100644 --- a/modules/sparse/src/cpp/HorzCatSparseLogical.cpp +++ b/modules/sparse/src/cpp/HorzCatSparseLogical.cpp @@ -46,7 +46,6 @@ HorzCatSparseLogical(ArrayOf A, ArrayOf B) Eigen::SparseMatrix* spMatC; indexType newColumnsSize = dimsA.getColumns() + dimsB.getColumns(); indexType newRowsSize = dimsA.getRows(); - indexType newSize = newColumnsSize * newRowsSize; Dimensions dimsC = Dimensions(newRowsSize, newColumnsSize); try { spMatC = new Eigen::SparseMatrix(newRowsSize, newColumnsSize); diff --git a/modules/sparse/src/cpp/SparseType.cpp b/modules/sparse/src/cpp/SparseType.cpp index 0029281f48..6ba08e0b65 100644 --- a/modules/sparse/src/cpp/SparseType.cpp +++ b/modules/sparse/src/cpp/SparseType.cpp @@ -336,6 +336,13 @@ Eigen_SparseMatrixConstructor(NelsonType dclass, indexType rows, indexType cols, switch (dclass) { case NLS_LOGICAL: { Eigen::SparseMatrix* spMat = nullptr; + try { + spMat = new Eigen::SparseMatrix(rows, cols); + } catch (const std::bad_alloc&) { + spMat = nullptr; + Error(ERROR_MEMORY_ALLOCATION); + } + return spMat; } break; case NLS_DOUBLE: { Eigen::SparseMatrix* spMat = nullptr; @@ -345,18 +352,17 @@ Eigen_SparseMatrixConstructor(NelsonType dclass, indexType rows, indexType cols, spMat = nullptr; Error(ERROR_MEMORY_ALLOCATION); } - indexType X = 0; - indexType Y = 0; - for (auto& i : m) { - for (auto& j : i) { - Eigen::SparseMatrix* src - = (Eigen::SparseMatrix*)(j.getDataPointer()); - } - } return spMat; } break; case NLS_DCOMPLEX: { - Eigen::SparseMatrix* spMat = nullptr; + Eigen::SparseMatrix, 0, signedIndexType>* spMat = nullptr; + try { + spMat = new Eigen::SparseMatrix, 0, signedIndexType>(rows, cols); + } catch (const std::bad_alloc&) { + spMat = nullptr; + Error(ERROR_MEMORY_ALLOCATION); + } + return spMat; } break; default: { Error(_W("Unsupported type in SparseMatrixConstructor.")); @@ -888,7 +894,6 @@ Eigen_makeSparseFromIJVComplex(indexType rows, indexType cols, indexType nnz, in auto* pV = (double*)cp; indexType q = 0; for (indexType k = 0; k < nnz; k++) { - bool isZeroValue = false; /* Currently , for compatibility, complex values are not cumulative */ if (bScalarV) { if (pV[0] || pV[1]) { diff --git a/modules/stream_manager/src/cpp/FscanFunction.cpp b/modules/stream_manager/src/cpp/FscanFunction.cpp index 76c1ca65ef..abc88b6b30 100644 --- a/modules/stream_manager/src/cpp/FscanFunction.cpp +++ b/modules/stream_manager/src/cpp/FscanFunction.cpp @@ -170,7 +170,6 @@ FscanF(FILE* filepointer, const std::string& format, const std::string& encoding char* dp = buff; char* np; char sv; - bool as64bit = false; while (*dp) { np = dp; while ((*dp) && (*dp != '%')) { diff --git a/modules/stream_manager/src/cpp/SscanfFunction.cpp b/modules/stream_manager/src/cpp/SscanfFunction.cpp index 131f63eacf..73ffa76c1a 100644 --- a/modules/stream_manager/src/cpp/SscanfFunction.cpp +++ b/modules/stream_manager/src/cpp/SscanfFunction.cpp @@ -346,7 +346,6 @@ FwscanF(FILE* filepointer, const std::wstring& format, double m, double n, bool wchar_t* dp = buff; wchar_t* np; wchar_t sv; - bool as64bit = false; while (*dp) { pos = 0; np = dp;