From 0f32f59dc3d1fa11f6b3afb53c2900d9150c474e Mon Sep 17 00:00:00 2001 From: jess Date: Wed, 15 Apr 2020 13:24:22 -0700 Subject: [PATCH 01/27] Add Open Collective MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, I'm making updates for Open Collective. Either you or another core contributor signed this repository up for Open Collective. This pull request adds financial contributors from your Open Collective https://opencollective.com/assimp ❤️ What it does: - adds a badge to show the latest number of financial contributors - adds a banner displaying contributors to the project on GitHub - adds a banner displaying all individuals contributing financially on Open Collective - adds a section displaying all organizations contributing financially on Open Collective, with their logo and a link to their website P.S: As with any pull request, feel free to comment or suggest changes. Thank you for your great contribution to the Open Source community. You are awesome! 🙌 And welcome to the Open Collective community! 😊 Come chat with us in the #opensource channel on https://slack.opencollective.com - great place to ask questions and share best practices with other Open Source sustainers! --- Readme.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Readme.md b/Readme.md index 61fff538f..15e76b9d2 100644 --- a/Readme.md +++ b/Readme.md @@ -2,6 +2,7 @@ Open Asset Import Library (assimp) ================================== A library to import and export various 3d-model-formats including scene-post-processing to generate missing render data. ### Current project status ### +[![Financial Contributors on Open Collective](https://opencollective.com/assimp/all/badge.svg?label=financial+contributors)](https://opencollective.com/assimp) ![C/C++ CI](https://github.com/assimp/assimp/workflows/C/C++%20CI/badge.svg) [![Linux Build Status](https://travis-ci.org/assimp/assimp.svg)](https://travis-ci.org/assimp/assimp) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/tmo433wax6u6cjp4?svg=true)](https://ci.appveyor.com/project/kimkulling/assimp) @@ -179,6 +180,28 @@ And we also have a Gitter-channel:Gitter [![Join the chat at https://gitter.im/a Contributions to assimp are highly appreciated. The easiest way to get involved is to submit a pull request with your changes against the main repository's `master` branch. +## Contributors + +### Code Contributors + +This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. + + + +### Financial Contributors + +Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/assimp/contribute)] + +#### Individuals + + + +#### Organizations + +Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/assimp/contribute)] + + + ### License ### Our license is based on the modified, __3-clause BSD__-License. From 4c3aee1968c9fdb8f01d3da5850b1550df959607 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Mon, 27 Apr 2020 12:54:17 +0200 Subject: [PATCH 02/27] add opencollective to funding --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e0c2bec9e..84e3123fe 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,3 @@ patreon: assimp custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4JRJVPXC4QJM4 +open_collective: assimp From 603a1200a2e0e7bcd0a60744c0c75501db786408 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 27 Apr 2020 19:51:59 +0200 Subject: [PATCH 03/27] add gcc build target --- .github/workflows/ccpp.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index dca0c3bea..bdc6c9ec0 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -19,9 +19,12 @@ jobs: - os: windows-latest cxx: cl.exe cc: cl.exe - - os: ubuntu-latest + - os: ubuntu-latest.clang cxx: clang++ cc: clang + - os: ubuntu-latest.gcc + cxx: g++ + cc: gcc - os: macos-latest cxx: clang++ cc: clang From c1c80801438d913b59a093d3bc043f5e97b15b39 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 27 Apr 2020 19:55:58 +0200 Subject: [PATCH 04/27] Use correct name --- .github/workflows/ccpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index bdc6c9ec0..f61d99bb8 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -19,10 +19,10 @@ jobs: - os: windows-latest cxx: cl.exe cc: cl.exe - - os: ubuntu-latest.clang + - os: ubuntu-latest cxx: clang++ cc: clang - - os: ubuntu-latest.gcc + - os: ubuntu-latest cxx: g++ cc: gcc - os: macos-latest From 625cc9d096f59ff79c872ef3d7e1e5a1658ead0e Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 27 Apr 2020 21:30:06 +0200 Subject: [PATCH 05/27] Remove useless comparison --- contrib/irrXML/irrString.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/contrib/irrXML/irrString.h b/contrib/irrXML/irrString.h index 1abf22b78..246348891 100644 --- a/contrib/irrXML/irrString.h +++ b/contrib/irrXML/irrString.h @@ -635,9 +635,6 @@ private: s32 amount = used < new_size ? used : new_size; for (s32 i=0; i Date: Tue, 28 Apr 2020 14:22:00 +0200 Subject: [PATCH 06/27] Add sanitizer job --- .github/workflows/ccpp.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 08292d55f..46f060836 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -7,13 +7,13 @@ on: branches: [ master ] jobs: - job: + job-build: name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - name: [ubuntu-gcc, macos-clang, windows-msvc, ubuntu-clang] + name: [ubuntu-gcc, macos-clang, windows-msvc, ubuntu-clang, ubuntu-memory-sanitizer] # For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux. include: - name: windows-msvc @@ -57,3 +57,27 @@ jobs: - name: test run: cd build/bin && ./unit shell: bash + + job-sanitizer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: lukka/get-cmake@latest + - uses: ilammy/msvc-dev-cmd@v1 + - uses: lukka/set-shell-env@v1 + with: + CXX: clang++ + CC: clang + + - name: configure and build + uses: lukka/run-cmake@v2 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release -DASSIMP_ASAN=ON' + buildWithCMakeArgs: '-- -v' + buildDirectory: '${{ github.workspace }}/build/' + + - name: test + run: cd build/bin && ./unit + shell: bash From 24fc16336ac8d5089c530008d288e740f5f03112 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 14:24:21 +0200 Subject: [PATCH 07/27] Add build-dependency --- .github/workflows/ccpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 46f060836..a1d81d0cc 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -59,6 +59,7 @@ jobs: shell: bash job-sanitizer: + needs: job-build runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 43df1d676a1871de9147f8ac6ea696c64b38db78 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 14:27:02 +0200 Subject: [PATCH 08/27] Fix dependency --- .github/workflows/ccpp.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index a1d81d0cc..c96a628ce 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -7,7 +7,7 @@ on: branches: [ master ] jobs: - job-build: + job: name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test runs-on: ${{ matrix.os }} strategy: @@ -58,8 +58,7 @@ jobs: run: cd build/bin && ./unit shell: bash - job-sanitizer: - needs: job-build + sanitizer: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 8240a11e1578c05aee6de9fa0bce68963a1b4eb9 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 14:41:44 +0200 Subject: [PATCH 09/27] Add undefined behavior sanitizer job --- .github/workflows/ccpp.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index c96a628ce..0a3ca72ec 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -58,7 +58,31 @@ jobs: run: cd build/bin && ./unit shell: bash - sanitizer: + adress-sanitizer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: lukka/get-cmake@latest + - uses: ilammy/msvc-dev-cmd@v1 + - uses: lukka/set-shell-env@v1 + with: + CXX: clang++ + CC: clang + + - name: configure and build + uses: lukka/run-cmake@v2 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release -DASSIMP_ASAN=ON' + buildWithCMakeArgs: '-- -v' + buildDirectory: '${{ github.workspace }}/build/' + + - name: test + run: cd build/bin && ./unit + shell: bash + + undefined-behavior-sanitizer: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 5cb4ac843d8434a6aaf9c5356f00324a34b55d11 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 14:43:12 +0200 Subject: [PATCH 10/27] Update ccpp.yml --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 0a3ca72ec..418c100f3 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -7,7 +7,7 @@ on: branches: [ master ] jobs: - job: + builds: name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test runs-on: ${{ matrix.os }} strategy: From 8085e7555e378e7e975d123949b7d69517edf5b6 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 14:53:19 +0200 Subject: [PATCH 11/27] try something out to get builds back to job-list --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 418c100f3..0a3ca72ec 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -7,7 +7,7 @@ on: branches: [ master ] jobs: - builds: + job: name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test runs-on: ${{ matrix.os }} strategy: From 8224cbeaad58c2d0b4d83af9e4ff85fecff1a53e Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 20:25:48 +0200 Subject: [PATCH 12/27] Try a different naming schema --- .github/workflows/ccpp.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 0a3ca72ec..6d54e289e 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -7,7 +7,7 @@ on: branches: [ master ] jobs: - job: + job1: name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test runs-on: ${{ matrix.os }} strategy: @@ -58,7 +58,8 @@ jobs: run: cd build/bin && ./unit shell: bash - adress-sanitizer: + job2: + name: adress-sanitizer runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -82,7 +83,8 @@ jobs: run: cd build/bin && ./unit shell: bash - undefined-behavior-sanitizer: + job3: + name: undefined-behavior-sanitizer runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 8888495d124636d8ca0d44febe87996a62cb0d72 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 20:30:59 +0200 Subject: [PATCH 13/27] Create sanitizer.yml --- .github/workflows/sanitizer.yml | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/sanitizer.yml diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml new file mode 100644 index 000000000..d6f09367f --- /dev/null +++ b/.github/workflows/sanitizer.yml @@ -0,0 +1,58 @@ +name: C/C++ CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + job1: + name: adress-sanitizer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: lukka/get-cmake@latest + - uses: ilammy/msvc-dev-cmd@v1 + - uses: lukka/set-shell-env@v1 + with: + CXX: clang++ + CC: clang + + - name: configure and build + uses: lukka/run-cmake@v2 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release -DASSIMP_ASAN=ON' + buildWithCMakeArgs: '-- -v' + buildDirectory: '${{ github.workspace }}/build/' + + - name: test + run: cd build/bin && ./unit + shell: bash + + job2: + name: undefined-behavior-sanitizer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: lukka/get-cmake@latest + - uses: ilammy/msvc-dev-cmd@v1 + - uses: lukka/set-shell-env@v1 + with: + CXX: clang++ + CC: clang + + - name: configure and build + uses: lukka/run-cmake@v2 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release -DASSIMP_ASAN=ON' + buildWithCMakeArgs: '-- -v' + buildDirectory: '${{ github.workspace }}/build/' + + - name: test + run: cd build/bin && ./unit + shell: bash From a5a38c02a5b7d70facf97a58dc90271982fd0b00 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 20:31:42 +0200 Subject: [PATCH 14/27] move sanitizer into its own file --- .github/workflows/ccpp.yml | 50 -------------------------------------- 1 file changed, 50 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 6d54e289e..d46dbe6a0 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -57,53 +57,3 @@ jobs: - name: test run: cd build/bin && ./unit shell: bash - - job2: - name: adress-sanitizer - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: lukka/get-cmake@latest - - uses: ilammy/msvc-dev-cmd@v1 - - uses: lukka/set-shell-env@v1 - with: - CXX: clang++ - CC: clang - - - name: configure and build - uses: lukka/run-cmake@v2 - with: - cmakeListsOrSettingsJson: CMakeListsTxtAdvanced - cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release -DASSIMP_ASAN=ON' - buildWithCMakeArgs: '-- -v' - buildDirectory: '${{ github.workspace }}/build/' - - - name: test - run: cd build/bin && ./unit - shell: bash - - job3: - name: undefined-behavior-sanitizer - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: lukka/get-cmake@latest - - uses: ilammy/msvc-dev-cmd@v1 - - uses: lukka/set-shell-env@v1 - with: - CXX: clang++ - CC: clang - - - name: configure and build - uses: lukka/run-cmake@v2 - with: - cmakeListsOrSettingsJson: CMakeListsTxtAdvanced - cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release -DASSIMP_ASAN=ON' - buildWithCMakeArgs: '-- -v' - buildDirectory: '${{ github.workspace }}/build/' - - - name: test - run: cd build/bin && ./unit - shell: bash From 4afbe35e0775de4b31f88c790db5ee76b28cf93f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 20:32:55 +0200 Subject: [PATCH 15/27] Use unique name for the sanitizer check --- .github/workflows/sanitizer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml index d6f09367f..7a8eb17fa 100644 --- a/.github/workflows/sanitizer.yml +++ b/.github/workflows/sanitizer.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: C/C++ Sanitizer on: push: From 7b4ff0cb1c9775ee1fe899ea8e9b9ed8485afec0 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 20:39:13 +0200 Subject: [PATCH 16/27] Fix name --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index d46dbe6a0..36fca3f29 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -7,7 +7,7 @@ on: branches: [ master ] jobs: - job1: + job: name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test runs-on: ${{ matrix.os }} strategy: From 68efdcde883cf5f9e1b9cb42b4da211e443ee1fb Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 20:41:02 +0200 Subject: [PATCH 17/27] Remove deprecated step --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 36fca3f29..08292d55f 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - name: [ubuntu-gcc, macos-clang, windows-msvc, ubuntu-clang, ubuntu-memory-sanitizer] + name: [ubuntu-gcc, macos-clang, windows-msvc, ubuntu-clang] # For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux. include: - name: windows-msvc From 1a440834ae455bf4d592500959cbee7559b1a69b Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 28 Apr 2020 21:11:21 +0200 Subject: [PATCH 18/27] Use debug configuration --- .github/workflows/sanitizer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml index 7a8eb17fa..bfcad7867 100644 --- a/.github/workflows/sanitizer.yml +++ b/.github/workflows/sanitizer.yml @@ -24,7 +24,7 @@ jobs: with: cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release -DASSIMP_ASAN=ON' + cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Debug -DASSIMP_ASAN=ON' buildWithCMakeArgs: '-- -v' buildDirectory: '${{ github.workspace }}/build/' @@ -49,7 +49,7 @@ jobs: with: cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release -DASSIMP_ASAN=ON' + cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Debug -DASSIMP_ASAN=ON' buildWithCMakeArgs: '-- -v' buildDirectory: '${{ github.workspace }}/build/' From fcdf88a74a948cf7c47e583bc0de524c3da15355 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 29 Apr 2020 13:41:40 +0200 Subject: [PATCH 19/27] Use correct sanitizer --- .github/workflows/sanitizer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml index bfcad7867..c1fa62ff3 100644 --- a/.github/workflows/sanitizer.yml +++ b/.github/workflows/sanitizer.yml @@ -49,7 +49,7 @@ jobs: with: cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' - cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Debug -DASSIMP_ASAN=ON' + cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Debug -DASSIMP_UBSAN=ON' buildWithCMakeArgs: '-- -v' buildDirectory: '${{ github.workspace }}/build/' From b9c597d0553d5996c54ce414efb572d4c7778453 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 29 Apr 2020 13:46:01 +0200 Subject: [PATCH 20/27] Fix review finding. --- .github/workflows/sanitizer.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml index c1fa62ff3..9bba5f6fd 100644 --- a/.github/workflows/sanitizer.yml +++ b/.github/workflows/sanitizer.yml @@ -13,7 +13,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: lukka/get-cmake@latest - - uses: ilammy/msvc-dev-cmd@v1 - uses: lukka/set-shell-env@v1 with: CXX: clang++ @@ -38,7 +37,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: lukka/get-cmake@latest - - uses: ilammy/msvc-dev-cmd@v1 - uses: lukka/set-shell-env@v1 with: CXX: clang++ From c6131ce38ada7dd1d74b693e3979cb04a83d0df2 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 29 Apr 2020 20:43:23 +0200 Subject: [PATCH 21/27] scenecombiner: fix leak. --- code/Common/SceneCombiner.cpp | 5 +---- include/assimp/mesh.h | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/Common/SceneCombiner.cpp b/code/Common/SceneCombiner.cpp index 62efe2ece..4d2a411f2 100644 --- a/code/Common/SceneCombiner.cpp +++ b/code/Common/SceneCombiner.cpp @@ -979,7 +979,7 @@ void GetArrayCopy(Type*& dest, ai_uint num ) { dest = new Type[num]; ::memcpy(dest, old, sizeof(Type) * num); - } +} // ------------------------------------------------------------------------------------------------ void SceneCombiner::CopySceneFlat(aiScene** _dest,const aiScene* src) { @@ -1269,9 +1269,6 @@ void SceneCombiner::Copy(aiBone** _dest, const aiBone* src) { // get a flat copy *dest = *src; - - // and reallocate all arrays - GetArrayCopy( dest->mWeights, dest->mNumWeights ); } // ------------------------------------------------------------------------------------------------ diff --git a/include/assimp/mesh.h b/include/assimp/mesh.h index bd987bc88..4b5af97ce 100644 --- a/include/assimp/mesh.h +++ b/include/assimp/mesh.h @@ -308,7 +308,10 @@ struct aiBone { //! Copy constructor aiBone(const aiBone &other) : - mName(other.mName), mNumWeights(other.mNumWeights), mWeights(nullptr), mOffsetMatrix(other.mOffsetMatrix) { + mName(other.mName), + mNumWeights(other.mNumWeights), + mWeights(nullptr), + mOffsetMatrix(other.mOffsetMatrix) { if (other.mWeights && other.mNumWeights) { mWeights = new aiVertexWeight[mNumWeights]; ::memcpy(mWeights, other.mWeights, mNumWeights * sizeof(aiVertexWeight)); From f808ed9fb5879f4b11d46ace3599e262a6ef50ec Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 29 Apr 2020 20:52:49 +0200 Subject: [PATCH 22/27] fbxconverter: fix memoryleak. --- code/FBX/FBXConverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/FBX/FBXConverter.cpp b/code/FBX/FBXConverter.cpp index 880b5de76..c22e3a50b 100644 --- a/code/FBX/FBXConverter.cpp +++ b/code/FBX/FBXConverter.cpp @@ -3392,7 +3392,7 @@ void FBXConverter::ConvertGlobalSettings() { const bool hasGenerator = !doc.Creator().empty(); - mSceneOut->mMetaData = aiMetadata::Alloc(16 + (hasGenerator ? 1 : 0)); + mSceneOut->mMetaData = aiMetadata::Alloc(17 + (hasGenerator ? 1 : 0)); mSceneOut->mMetaData->Set(0, "UpAxis", doc.GlobalSettings().UpAxis()); mSceneOut->mMetaData->Set(1, "UpAxisSign", doc.GlobalSettings().UpAxisSign()); mSceneOut->mMetaData->Set(2, "FrontAxis", doc.GlobalSettings().FrontAxis()); From da2bf5c7a43eacc7c1b4583790e0115951bfd560 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 29 Apr 2020 21:13:46 +0200 Subject: [PATCH 23/27] fix wrong size --- code/FBX/FBXConverter.cpp | 2 +- include/assimp/metadata.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/FBX/FBXConverter.cpp b/code/FBX/FBXConverter.cpp index c22e3a50b..880b5de76 100644 --- a/code/FBX/FBXConverter.cpp +++ b/code/FBX/FBXConverter.cpp @@ -3392,7 +3392,7 @@ void FBXConverter::ConvertGlobalSettings() { const bool hasGenerator = !doc.Creator().empty(); - mSceneOut->mMetaData = aiMetadata::Alloc(17 + (hasGenerator ? 1 : 0)); + mSceneOut->mMetaData = aiMetadata::Alloc(16 + (hasGenerator ? 1 : 0)); mSceneOut->mMetaData->Set(0, "UpAxis", doc.GlobalSettings().UpAxis()); mSceneOut->mMetaData->Set(1, "UpAxisSign", doc.GlobalSettings().UpAxisSign()); mSceneOut->mMetaData->Set(2, "FrontAxis", doc.GlobalSettings().FrontAxis()); diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index 28ddce567..cd7569ffe 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -320,7 +320,7 @@ struct aiMetadata { } template - inline bool Set( const std::string &key, const T &value ) { + inline bool Set(const std::string &key, const T &value) { if (key.empty()) { return false; } From e0bc0f7fade58376a54a1374bf1e2cd0f0e15e69 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 29 Apr 2020 21:19:15 +0200 Subject: [PATCH 24/27] try to fix double memleak. --- code/FBX/FBXConverter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/FBX/FBXConverter.cpp b/code/FBX/FBXConverter.cpp index 880b5de76..e46e45c28 100644 --- a/code/FBX/FBXConverter.cpp +++ b/code/FBX/FBXConverter.cpp @@ -3401,7 +3401,8 @@ void FBXConverter::ConvertGlobalSettings() { mSceneOut->mMetaData->Set(5, "CoordAxisSign", doc.GlobalSettings().CoordAxisSign()); mSceneOut->mMetaData->Set(6, "OriginalUpAxis", doc.GlobalSettings().OriginalUpAxis()); mSceneOut->mMetaData->Set(7, "OriginalUpAxisSign", doc.GlobalSettings().OriginalUpAxisSign()); - mSceneOut->mMetaData->Set(8, "UnitScaleFactor", (double)doc.GlobalSettings().UnitScaleFactor()); + const double unitScaleFactor = (double)doc.GlobalSettings().UnitScaleFactor(); + mSceneOut->mMetaData->Set(8, "UnitScaleFactor", unitScaleFactor); mSceneOut->mMetaData->Set(9, "OriginalUnitScaleFactor", doc.GlobalSettings().OriginalUnitScaleFactor()); mSceneOut->mMetaData->Set(10, "AmbientColor", doc.GlobalSettings().AmbientColor()); mSceneOut->mMetaData->Set(11, "FrameRate", (int)doc.GlobalSettings().TimeMode()); From 1c30b7bf8ed2a4cc02a1b33f52e46c05be815c60 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 29 Apr 2020 21:31:01 +0200 Subject: [PATCH 25/27] tryout: check if leak is coupled to type double. --- code/FBX/FBXConverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/FBX/FBXConverter.cpp b/code/FBX/FBXConverter.cpp index e46e45c28..296d30398 100644 --- a/code/FBX/FBXConverter.cpp +++ b/code/FBX/FBXConverter.cpp @@ -3402,7 +3402,7 @@ void FBXConverter::ConvertGlobalSettings() { mSceneOut->mMetaData->Set(6, "OriginalUpAxis", doc.GlobalSettings().OriginalUpAxis()); mSceneOut->mMetaData->Set(7, "OriginalUpAxisSign", doc.GlobalSettings().OriginalUpAxisSign()); const double unitScaleFactor = (double)doc.GlobalSettings().UnitScaleFactor(); - mSceneOut->mMetaData->Set(8, "UnitScaleFactor", unitScaleFactor); + mSceneOut->mMetaData->Set(8, "UnitScaleFactor", doc.GlobalSettings().UnitScaleFactor()); mSceneOut->mMetaData->Set(9, "OriginalUnitScaleFactor", doc.GlobalSettings().OriginalUnitScaleFactor()); mSceneOut->mMetaData->Set(10, "AmbientColor", doc.GlobalSettings().AmbientColor()); mSceneOut->mMetaData->Set(11, "FrameRate", (int)doc.GlobalSettings().TimeMode()); From 2d9d1120158197cb1e4a64d607b7aca413a1aa4f Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 29 Apr 2020 21:35:42 +0200 Subject: [PATCH 26/27] fix warning --- code/FBX/FBXConverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/FBX/FBXConverter.cpp b/code/FBX/FBXConverter.cpp index 296d30398..1bf977189 100644 --- a/code/FBX/FBXConverter.cpp +++ b/code/FBX/FBXConverter.cpp @@ -3401,7 +3401,7 @@ void FBXConverter::ConvertGlobalSettings() { mSceneOut->mMetaData->Set(5, "CoordAxisSign", doc.GlobalSettings().CoordAxisSign()); mSceneOut->mMetaData->Set(6, "OriginalUpAxis", doc.GlobalSettings().OriginalUpAxis()); mSceneOut->mMetaData->Set(7, "OriginalUpAxisSign", doc.GlobalSettings().OriginalUpAxisSign()); - const double unitScaleFactor = (double)doc.GlobalSettings().UnitScaleFactor(); + //const double unitScaleFactor = (double)doc.GlobalSettings().UnitScaleFactor(); mSceneOut->mMetaData->Set(8, "UnitScaleFactor", doc.GlobalSettings().UnitScaleFactor()); mSceneOut->mMetaData->Set(9, "OriginalUnitScaleFactor", doc.GlobalSettings().OriginalUnitScaleFactor()); mSceneOut->mMetaData->Set(10, "AmbientColor", doc.GlobalSettings().AmbientColor()); From a639221ededeb186c3f903b932594f8e7b44bd4c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 30 Apr 2020 09:14:42 +0200 Subject: [PATCH 27/27] Update to float - Temporary change to analyze leak. --- test/unit/utFBXImporterExporter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/utFBXImporterExporter.cpp b/test/unit/utFBXImporterExporter.cpp index 88a3e067e..2f1ea79e8 100644 --- a/test/unit/utFBXImporterExporter.cpp +++ b/test/unit/utFBXImporterExporter.cpp @@ -210,13 +210,13 @@ TEST_F(utFBXImporterExporter, importUnitScaleFactor) { EXPECT_NE(nullptr, scene); EXPECT_NE(nullptr, scene->mMetaData); - double factor(0.0); + float factor(0.0f); scene->mMetaData->Get("UnitScaleFactor", factor); - EXPECT_DOUBLE_EQ(500.0, factor); + EXPECT_EQ(500.0f, factor); - scene->mMetaData->Set("UnitScaleFactor", factor * 2); + scene->mMetaData->Set("UnitScaleFactor", factor * 2.0f); scene->mMetaData->Get("UnitScaleFactor", factor); - EXPECT_DOUBLE_EQ(1000.0, factor); + EXPECT_EQ(1000.0f, factor); } TEST_F(utFBXImporterExporter, importEmbeddedAsciiTest) {