diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml new file mode 100644 index 0000000000..e2df784547 --- /dev/null +++ b/.github/workflows/cppcheck.yml @@ -0,0 +1,26 @@ +name: cppcheck-annotations + +on: + pull_request: + +jobs: + build: + name: cppcheck-annotations + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Run cppcheck-annotation-action + uses: Konstantin343/cppcheck-annotation-action@v1.0 + with: + std: 'c++20' + sources: 'src' + platform: 'unix64' + log-level: 'verbose' + + - name: Annotate lines with errors + uses: yuzutech/annotations-action@v0.4.0 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + title: 'Results of CppCheck' + input: 'annotations.json' diff --git a/src/libs/antares/study/runtime/runtime.cpp b/src/libs/antares/study/runtime/runtime.cpp index f10da99345..1b14ccb6fe 100644 --- a/src/libs/antares/study/runtime/runtime.cpp +++ b/src/libs/antares/study/runtime/runtime.cpp @@ -57,7 +57,7 @@ static void StudyRuntimeInfosInitializeAllAreas(Study& study, StudyRuntimeInfos& // E' = ln(e) - 0.5 * ln(1 + (s*s) / (e*e)) // S' = sqrt(ln(1 + (s*s) / (e*e))) nE = log(e[i]) - 0.5 * log(1. + (s[i] * s[i]) / (e[i] * e[i])); - nS = sqrt(log(1. + (s[i] * s[i]) / (e[i] * e[i]))); + nS = sqrt(logp1((s[i] * s[i]) / (e[i] * e[i]))); // asserts assert(!std::isnan(nE) diff --git a/src/solver/ts-generator/availability.cpp b/src/solver/ts-generator/availability.cpp index f9b50696df..70594b5794 100644 --- a/src/solver/ts-generator/availability.cpp +++ b/src/solver/ts-generator/availability.cpp @@ -121,7 +121,7 @@ void GeneratorTempData::prepareIndispoFromLaw(Data::StatisticalLaw law, B[d] = sqrt(B[d]) - 1.; B[d] /= 2. * xtemp; A[d] = D - 1. / B[d]; - B[d] = log(1. - B[d]); + B[d] = logp1(-B[d]); B[d] = 1. / B[d]; } else