From c8d4380ff4c1cc234733037073feed285cecf609 Mon Sep 17 00:00:00 2001 From: JBenda Date: Tue, 30 Jun 2026 10:53:48 +0200 Subject: [PATCH 1/4] ci(build): use Ninja as CMake generator explicit --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 372c0955..996826e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,6 +60,11 @@ jobs: with: cmake-version: '3.22.x' + # Setup Ninja + - name: Setup Ninja + uses: ashutoshvarma/setup-ninja@v1.1 + with: + version: 1.13.0 # Create a build directory to store all the CMake generated files - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build @@ -68,7 +73,7 @@ jobs: - name: Configure CMake shell: bash working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DINKCPP_PY=OFF -DINKCPP_C=ON -DINKCPP_TEST=ON -DINKCPP_INKLECATE=OS + run: cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DINKCPP_PY=OFF -DINKCPP_C=ON -DINKCPP_TEST=ON -DINKCPP_INKLECATE=OS # Build using CMake and OS toolkit - name: Build From e42e33d57c4db319e6701c43ca06be64ea1ebc47 Mon Sep 17 00:00:00 2001 From: JBenda Date: Tue, 30 Jun 2026 12:05:58 +0200 Subject: [PATCH 2/4] ci(build): try to debug linking error in pipeline --- .github/workflows/build.yml | 66 +++++++++++++-------- inkcpp/include/globals.h | 4 +- inkcpp/include/types.h | 11 +++- inkcpp/operations.h | 4 +- inkcpp/output.cpp | 2 +- inkcpp/string_table.h | 2 +- inkcpp/value.h | 113 +++++++++++++++--------------------- 7 files changed, 101 insertions(+), 101 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 996826e1..25213c88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,30 +16,30 @@ jobs: strategy: matrix: include: - - os: macos-latest - artifact: macos - name: MacOSX - inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip - proof: false - unreal: false - - os: macos-14 - artifact: macos-arm - name: MacOSX-ARM - inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip - proof: false - unreal: false + # - os: macos-latest + # artifact: macos + # name: MacOSX + # inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip + # proof: false + # unreal: false + # - os: macos-14 + # artifact: macos-arm + # name: MacOSX-ARM + # inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip + # proof: false + # unreal: false - os: windows-latest artifact: win64 name: Windows x64 inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_windows.zip proof: true unreal: false - - os: "ubuntu-22.04" - artifact: linux - name: Linux x64 - inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip - proof: true - unreal: true + # - os: "ubuntu-22.04" + # artifact: linux + # name: Linux x64 + # inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip + # proof: true + # unreal: true steps: @@ -71,16 +71,34 @@ jobs: # Run CMake configuration to create build files - name: Configure CMake - shell: bash working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DINKCPP_PY=OFF -DINKCPP_C=ON -DINKCPP_TEST=ON -DINKCPP_INKLECATE=OS + shell: pwsh -command ". {0}" + run: cmake ${{github.workspace}} -GNinja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DINKCPP_PY=OFF -DINKCPP_C=ON -DINKCPP_TEST=ON -DINKCPP_INKLECATE=OS # Build using CMake and OS toolkit - name: Build working-directory: ${{github.workspace}}/build - shell: bash - run: cmake --build . --config $BUILD_TYPE - + shell: pwsh + run: cmake --build . --config ${{env.BUILD_TYPE}} + - name: Install Dumpbin + shell: pwsh + if: always() + run: | + Set-ExecutionPolicy Bypass -Scope Process -Force; + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; + iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + choco install visualstudio2019buildtools --package-parameters "--includeRecommended --includeOptional --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" --no-progress + $vsPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC" + $latestVersion = (Get-ChildItem -Path $vsPath | Sort-Object Name -Descending | Select-Object -First 1).Name + $dumpbinPath = "$vsPath\$latestVersion\bin\Hostx64\x64" + echo $dumpbinPath >> $env:GITHUB_PATH + - name: Inspect inkcpp_cl dependencies + shell: pwsh + working-directory: ${{github.workspace}}/build + if: always() + run: | + dumpbin /dependents inkcpp_cl\inkcpp_cl.exe + dumpbin /imports inkcpp_cl\inkcpp_cl.exe # Run CMake tests (unit tests, etc.) - name: CTests working-directory: ${{github.workspace}}/build @@ -243,12 +261,10 @@ jobs: - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - shell: bash working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DINKCPP_PY=ON -DINKCPP_DOC_BlueprintUE=ON - name: Build working-directory: ${{github.workspace}}/build - shell: bash run: cmake --build . --target doc --config Release - name: Upload uses: actions/upload-artifact@v7 diff --git a/inkcpp/include/globals.h b/inkcpp/include/globals.h index 4163ec24..649078f9 100644 --- a/inkcpp/include/globals.h +++ b/inkcpp/include/globals.h @@ -28,7 +28,7 @@ class globals_interface * @return nullopt if variable won't exist or type won't match */ template - optional get(const char* name) const + optional get(const char* /*name*/) const { static_assert(internal::always_false::value, "Requested Type is not supported"); } @@ -41,7 +41,7 @@ class globals_interface * @retval true on success */ template - bool set(const char* name, const T& val) + bool set(const char* /*name*/, const T& /*val*/) { static_assert(internal::always_false::value, "Requested Type is not supported"); return false; diff --git a/inkcpp/include/types.h b/inkcpp/include/types.h index e6cca05c..31d9ad0c 100644 --- a/inkcpp/include/types.h +++ b/inkcpp/include/types.h @@ -129,15 +129,20 @@ struct value { /// @} +#ifdef __GNUCC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wtautological-compare" +#endif /** Get value to corresponding type * @tparam Ty #Type label of type to get * @attention behavior if undefined if Ty != value.type */ template const auto& get() const - { - static_assert(Ty != Ty, "No value getter for the selected type"); - } + { static_assert(Ty != Ty, "No value getter for the selected type"); } +#ifdef __GNUCC__ +# pragma GCC diagnostic pop +#endif }; /** access a @ref ink::runtime::value::Type::Bool value */ diff --git a/inkcpp/operations.h b/inkcpp/operations.h index 5bab700c..59c5657a 100644 --- a/inkcpp/operations.h +++ b/inkcpp/operations.h @@ -60,7 +60,7 @@ class operation static constexpr bool enabled = false; template - operation(const T& t) + operation(const T& /*t*/) { } @@ -69,7 +69,7 @@ class operation * @param stack were the result(s) get pushed * @param vs array of values, first one = first argument etc */ - void operator()(basic_eval_stack& stack, value* vs) { inkFail("operation not implemented!"); } + void operator()(basic_eval_stack& /*stack*/, value* /*vs*/) { inkFail("operation not implemented!"); } }; } // namespace ink::runtime::internal diff --git a/inkcpp/output.cpp b/inkcpp/output.cpp index 164768f5..74c471aa 100644 --- a/inkcpp/output.cpp +++ b/inkcpp/output.cpp @@ -120,7 +120,7 @@ void basic_stream::append(const value* in, unsigned int length) } template -inline void write_char(T& output, char c) +inline void write_char(T& /*output*/, char /*c*/) { static_assert(always_false::value, "Invalid output type"); } diff --git a/inkcpp/string_table.h b/inkcpp/string_table.h index c7768a4d..0d093995 100644 --- a/inkcpp/string_table.h +++ b/inkcpp/string_table.h @@ -17,7 +17,7 @@ namespace ink::runtime::internal class string_table final : public snapshot_interface { public: - virtual ~string_table(); + ~string_table(); // Create a dynamic string of a particular length char* create(size_t length); diff --git a/inkcpp/value.h b/inkcpp/value.h index f3948ea0..e0ccc053 100644 --- a/inkcpp/value.h +++ b/inkcpp/value.h @@ -60,15 +60,11 @@ enum class value_type { // add operator for value_type (to simplify usage templates). constexpr value_type operator+(value_type t, int i) -{ - return static_cast(static_cast(t) + i); -} +{ return static_cast(static_cast(t) + i); } // add operator for Command (to simplify usage in templates). constexpr Command operator+(Command c, int i) -{ - return static_cast(static_cast(c) + i); -} +{ return static_cast(static_cast(c) + i); } struct string_type { constexpr string_type(const char* string, bool allocated) @@ -134,19 +130,25 @@ class value : public snapshot_interface bool set(const ink::runtime::value& val); ink::runtime::value to_interface_value(list_table&) const; +#ifdef __GNUCC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wtautological-compare" +#endif /// get value of the type (if possible) template typename ret::type get() const - { - static_assert(ty != ty, "No getter for this type defined!"); - } + { static_assert(ty != ty, "No getter for this type defined!"); } + +#ifdef __GNUCC__ +# pragma GCC diagnostic pop +#endif /// check if value evaluates to true bool truthy(const list_table& lists) const; /// set value of type (if possible) template - constexpr value& set(Args... args) + constexpr value& set(Args...) { static_assert(sizeof...(Args) != sizeof...(Args), "No setter for this type defined!"); return *this; @@ -157,9 +159,7 @@ class value : public snapshot_interface /// returns if type is printable (see value_type) constexpr bool printable() const - { - return _type >= value_type::PRINT_BEGIN && _type < value_type::PRINT_END; - } + { return _type >= value_type::PRINT_BEGIN && _type < value_type::PRINT_END; } friend basic_stream& operator<<(basic_stream& os, const value&); // friend basic_stream& operator>>(basic_stream& is, value&); // TODO: implement @@ -192,30 +192,37 @@ class value : public snapshot_interface } /// actual storage + struct value_jump { + uint32_t jump; + uint32_t thread_id; + }; + + struct value_frame { + uint32_t addr; + bool eval; // was eval mode active in frame above + }; + + struct value_pointer { + hash_t name; + int ci; + }; + union { + bool bool_value; int32_t int32_value; string_type string_value; uint32_t uint32_value; float float_value; - struct { - uint32_t jump; - uint32_t thread_id; - } jump; + value_jump jump; list_table::list list_value; list_flag list_flag_value; - struct { - uint32_t addr; - bool eval; // was eval mode active in frame above - } frame_value; + value_frame frame_value; - struct { - hash_t name; - int ci; - } pointer; + value_pointer pointer; }; static constexpr size_t max_value_size = sizeof_largest_type< @@ -227,9 +234,7 @@ class value : public snapshot_interface template value redefine::operator()(const T&, const T& rh) -{ - return value{}.set(rh); -} +{ return value{}.set(rh); } // define get and set for int32 template<> @@ -239,9 +244,7 @@ struct value::ret { template<> inline int32_t value::get() const -{ - return int32_value; -} +{ return int32_value; } template<> inline constexpr value& value::set(int32_t v) @@ -259,9 +262,7 @@ struct value::ret { template<> inline uint32_t value::get() const -{ - return uint32_value; -} +{ return uint32_value; } template<> inline constexpr value& value::set(uint32_t v) @@ -279,9 +280,7 @@ struct value::ret { template<> inline uint32_t value::get() const -{ - return uint32_value; -} +{ return uint32_value; } template<> inline constexpr value& value::set(uint32_t v) @@ -299,9 +298,7 @@ struct value::ret { template<> inline float value::get() const -{ - return float_value; -} +{ return float_value; } template<> inline constexpr value& value::set(float v) @@ -319,9 +316,7 @@ struct value::ret { template<> inline bool value::get() const -{ - return bool_value; -} +{ return bool_value; } template<> inline constexpr value& value::set(bool v) @@ -347,9 +342,7 @@ struct value::ret { template<> inline list_table::list value::get() const -{ - return list_value; -} +{ return list_value; } template<> inline constexpr value& value::set(list_table::list list) @@ -367,9 +360,7 @@ struct value::ret { template<> inline list_flag value::get() const -{ - return list_flag_value; -} +{ return list_flag_value; } template<> inline constexpr value& value::set(list_flag flag) @@ -387,9 +378,7 @@ struct value::ret { template<> inline string_type value::get() const -{ - return string_value; -} +{ return string_value; } template<> inline constexpr value& value::set(const char* v) @@ -440,9 +429,7 @@ struct value::ret { template<> inline value::ret::type value::get() const -{ - return pointer; -} +{ return pointer; } template<> inline constexpr value& value::set(hash_t name, int ci) @@ -461,9 +448,7 @@ struct value::ret { template<> inline value::ret::type value::get() const -{ - return jump; -} +{ return jump; } template<> inline constexpr value& @@ -492,9 +477,7 @@ struct value::ret { template<> inline value::ret::type value::get() const -{ - return jump; -} +{ return jump; } template<> inline constexpr value& @@ -523,9 +506,7 @@ struct value::ret { template<> inline uint32_t value::get() const -{ - return uint32_value; -} +{ return uint32_value; } template<> inline constexpr value& value::set(uint32_t v) @@ -614,9 +595,7 @@ struct value::ret { template<> inline typename value::ret::type value::get() const -{ - return frame_value; -} +{ return frame_value; } template<> inline constexpr value& value::set(uint32_t v, bool evalOn) From eb791401ae74457f7b281e11adc4c55eb98ecdbc Mon Sep 17 00:00:00 2001 From: JBenda Date: Tue, 30 Jun 2026 15:30:23 +0200 Subject: [PATCH 3/4] ci(build): Use native shell to generate cmake project --- .github/workflows/build.yml | 507 ++++++++++++++++------------------ inkcpp/include/functional.h | 25 +- inkcpp/string_operations.cpp | 8 +- inkcpp_c/tests/Globals.c | 8 +- inkcpp_c/tests/Observer.c | 4 +- inkcpp_c/tests/Snapshot.c | 6 +- inkcpp_c/tests/Tags.c | 3 +- inkcpp_test/Observer.cpp | 4 +- proofing/diff_py-codecs.patch | 23 ++ 9 files changed, 288 insertions(+), 300 deletions(-) create mode 100644 proofing/diff_py-codecs.patch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25213c88..e0e72db2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,208 +16,181 @@ jobs: strategy: matrix: include: - # - os: macos-latest - # artifact: macos - # name: MacOSX - # inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip - # proof: false - # unreal: false - # - os: macos-14 - # artifact: macos-arm - # name: MacOSX-ARM - # inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip - # proof: false - # unreal: false + - os: macos-latest + artifact: macos + name: MacOSX + inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip + proof: false + unreal: false + - os: macos-14 + artifact: macos-arm + name: MacOSX-ARM + inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_mac.zip + proof: false + unreal: false - os: windows-latest artifact: win64 name: Windows x64 inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_windows.zip proof: true unreal: false - # - os: "ubuntu-22.04" - # artifact: linux - # name: Linux x64 - # inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip - # proof: true - # unreal: true + - os: "ubuntu-22.04" + artifact: linux + name: Linux x64 + inklecate_url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip + proof: true + unreal: true steps: + # Checkout project + - uses: actions/checkout@v6 + with: + submodules: true - # Checkout project - - uses: actions/checkout@v6 - with: - submodules: true + # Setup python + - uses: actions/setup-python@v5 + if: ${{ matrix.proof }} + with: + python-version: "3.x" - # Setup python - - uses: actions/setup-python@v5 - if: ${{ matrix.proof }} - with: - python-version: '3.x' + # Setup CMake + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: "3.22.x" - # Setup CMake - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: '3.22.x' + # Setup Ninja + - name: Setup Ninja + uses: ashutoshvarma/setup-ninja@v1.1 + with: + version: 1.13.0 + # Create a build directory to store all the CMake generated files + - name: Create Build Environment + run: cmake -E make_directory ${{github.workspace}}/build - # Setup Ninja - - name: Setup Ninja - uses: ashutoshvarma/setup-ninja@v1.1 - with: - version: 1.13.0 - # Create a build directory to store all the CMake generated files - - name: Create Build Environment - run: cmake -E make_directory ${{github.workspace}}/build + # Run CMake configuration to create build files + - name: Configure CMake + working-directory: ${{github.workspace}}/build + # execute this in the native schell to get a native executable file + run: cmake ${{github.workspace}} -GNinja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DINKCPP_PY=OFF -DINKCPP_C=ON -DINKCPP_TEST=ON -DINKCPP_INKLECATE=OS - # Run CMake configuration to create build files - - name: Configure CMake - working-directory: ${{github.workspace}}/build - shell: pwsh -command ". {0}" - run: cmake ${{github.workspace}} -GNinja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DINKCPP_PY=OFF -DINKCPP_C=ON -DINKCPP_TEST=ON -DINKCPP_INKLECATE=OS + # Build using CMake and OS toolkit + - name: Build + working-directory: ${{github.workspace}}/build + # execute this in the native schell to get a native executable file + run: cmake --build . --config ${{env.BUILD_TYPE}} + # Run CMake tests (unit tests, etc.) + - name: CTests + working-directory: ${{github.workspace}}/build + run: ctest . -C ${{env.BUILD_TYPE}} -V - # Build using CMake and OS toolkit - - name: Build - working-directory: ${{github.workspace}}/build - shell: pwsh - run: cmake --build . --config ${{env.BUILD_TYPE}} - - name: Install Dumpbin - shell: pwsh - if: always() - run: | - Set-ExecutionPolicy Bypass -Scope Process -Force; - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; - iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - choco install visualstudio2019buildtools --package-parameters "--includeRecommended --includeOptional --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" --no-progress - $vsPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC" - $latestVersion = (Get-ChildItem -Path $vsPath | Sort-Object Name -Descending | Select-Object -First 1).Name - $dumpbinPath = "$vsPath\$latestVersion\bin\Hostx64\x64" - echo $dumpbinPath >> $env:GITHUB_PATH - - name: Inspect inkcpp_cl dependencies - shell: pwsh - working-directory: ${{github.workspace}}/build - if: always() - run: | - dumpbin /dependents inkcpp_cl\inkcpp_cl.exe - dumpbin /imports inkcpp_cl\inkcpp_cl.exe - # Run CMake tests (unit tests, etc.) - - name: CTests - working-directory: ${{github.workspace}}/build - shell: bash - run: ctest . -C $BUILD_TYPE -V + # Copy all build artifacts to the bin directory + - name: Install Cl + working-directory: ${{github.workspace}}/build + run: cmake --install . --config ${{env.BUILD_TYPE}} --prefix comp_cl --component cl + - name: Upload Cl + uses: actions/upload-artifact@v7 + with: + name: ${{ matrix.artifact }}-cl + path: build/comp_cl/ - # Copy all build artifacts to the bin directory - - name: Install Cl - working-directory: ${{github.workspace}}/build - shell: bash - run: cmake --install . --config $BUILD_TYPE --prefix comp_cl --component cl - - name: Upload Cl - uses: actions/upload-artifact@v7 - with: - name: ${{ matrix.artifact }}-cl - path: build/comp_cl/ + - name: Install Lib + working-directory: ${{github.workspace}}/build + run: cmake --install . --config ${{env.BUILD_TYPE}} --prefix comp_lib --component lib + - name: Upload Lib + uses: actions/upload-artifact@v7 + with: + name: ${{ matrix.artifact }}-lib + path: build/comp_lib/ - - name: Install Lib - working-directory: ${{github.workspace}}/build - shell: bash - run: cmake --install . --config $BUILD_TYPE --prefix comp_lib --component lib - - name: Upload Lib - uses: actions/upload-artifact@v7 - with: - name: ${{ matrix.artifact }}-lib - path: build/comp_lib/ + - name: Install CLib + working-directory: ${{github.workspace}}/build + run: cmake --install . --config ${{env.BUILD_TYPE}} --prefix comp_clib --component clib + - name: Upload Clib + uses: actions/upload-artifact@v7 + with: + name: ${{matrix.artifact}}-clib + path: build/comp_clib - - name: Install CLib - working-directory: ${{github.workspace}}/build - shell: bash - run: cmake --install . --config $BUILD_TYPE --prefix comp_clib --component clib - - name: Upload Clib - uses: actions/upload-artifact@v7 - with: - name: ${{matrix.artifact}}-clib - path: build/comp_clib + - name: Install UE + if: ${{ matrix.unreal }} + working-directory: ${{github.workspace}}/build + run: | + cmake ${{github.workspace}} -DINKCPP_UNREAL_TARGET_VERSION="5.7" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE + cmake --install . --config ${{env.BUILD_TYPE}} --prefix comp_unreal_5_7 --component unreal + cmake ${{github.workspace}} -DINKCPP_UNREAL_TARGET_VERSION="5.6" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE + cmake --install . --config ${{env.BUILD_TYPE}} --prefix comp_unreal_5_6 --component unreal + cmake ${{github.workspace}} -DINKCPP_UNREAL_TARGET_VERSION="5.5" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE + cmake --install . --config ${{env.BUILD_TYPE}} --prefix comp_unreal_5_5 --component unreal + cmake ${{github.workspace}} -DINKCPP_UNREAL_TARGET_VERSION="5.4" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE + cmake --install . --config ${{env.BUILD_TYPE}} --prefix comp_unreal_5_4 --component unreal + - name: Upload UE 5.7 + if: ${{ matrix.unreal }} + uses: actions/upload-artifact@v7 + with: + name: unreal_5_7 + path: build/comp_unreal_5_7/ + - name: Upload UE 5.6 + if: ${{ matrix.unreal }} + uses: actions/upload-artifact@v7 + with: + name: unreal_5_6 + path: build/comp_unreal_5_6/ + - name: Upload UE 5.5 + if: ${{ matrix.unreal }} + uses: actions/upload-artifact@v7 + with: + name: unreal_5_5 + path: build/comp_unreal_5_5/ + - name: Upload UE 5.4 + if: ${{ matrix.unreal }} + uses: actions/upload-artifact@v7 + with: + name: unreal_5_4 + path: build/comp_unreal_5_4/ - - name: Install UE - if: ${{ matrix.unreal }} - working-directory: ${{github.workspace}}/build - shell: bash - run: | - cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.7" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE - cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_7 --component unreal - cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.6" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE - cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_6 --component unreal - cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.5" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE - cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_5 --component unreal - cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.4" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE - cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_4 --component unreal - - name: Upload UE 5.7 - if: ${{ matrix.unreal }} - uses: actions/upload-artifact@v7 - with: - name: unreal_5_7 - path: build/comp_unreal_5_7/ - - name: Upload UE 5.6 - if: ${{ matrix.unreal }} - uses: actions/upload-artifact@v7 - with: - name: unreal_5_6 - path: build/comp_unreal_5_6/ - - name: Upload UE 5.5 - if: ${{ matrix.unreal }} - uses: actions/upload-artifact@v7 - with: - name: unreal_5_5 - path: build/comp_unreal_5_5/ - - name: Upload UE 5.4 - if: ${{ matrix.unreal }} - uses: actions/upload-artifact@v7 - with: - name: unreal_5_4 - path: build/comp_unreal_5_4/ + # Make sure Inkproof has everything it needs to run our executable + - name: Setup Ink Proof + if: ${{ matrix.proof }} + working-directory: proofing/ink-proof + run: | + git apply ../diff_py-codecs.patch + python3 install_deps.py + cp ../inkcpp_runtime_driver drivers/ + cmake -E make_directory deps/inkcpp + cp ../../build/comp_cl/* deps/inkcpp/ - # Make sure Inkproof has everything it needs to run our executable - - name: Setup Ink Proof - if: ${{ matrix.proof }} - shell: bash - working-directory: proofing/ink-proof - run: | - python3 install_deps.py - cp ../inkcpp_runtime_driver drivers/ - chmod +x drivers/inkcpp_runtime_driver - mkdir deps/inkcpp - cp ../../build/comp_cl/* deps/inkcpp/ - chmod +x deps/inkcpp/inkcpp_cl - # Run it - - name: Run Ink Proof - if: ${{ matrix.proof }} - shell: bash - working-directory: proofing/ink-proof - run: | - python3 proof.py --examples 'I...' inklecate_v1.1.1 inkcpp_runtime > run.out - echo -e "| ${{ matrix.name }} | $(cat run.out) |" > ${{ matrix.artifact }}.txt + # Run it + - name: Run Ink Proof + if: ${{ matrix.proof }} + working-directory: proofing/ink-proof + run: | + python3 proof.py --examples 'I...' inklecate_v1.1.1 inkcpp_runtime > run.out + cmake -E echo "| ${{ matrix.name }} | $(cat run.out) |" > ${{ matrix.artifact }}.txt - # Creates a "disabled" artifact if ink proofing is disabled - - name: Create Disabled InkProof Results File - if: ${{ !matrix.proof }} - shell: bash - run: | - mkdir -p proofing/ink-proof - echo "| ${{ matrix.name }} | DISABLED |" > proofing/ink-proof/${{ matrix.artifact }}.txt + # Creates a "disabled" artifact if ink proofing is disabled + - name: Create Disabled InkProof Results File + if: ${{ !matrix.proof }} + shell: bash + run: | + mkdir -p proofing/ink-proof + echo "| ${{ matrix.name }} | DISABLED |" > proofing/ink-proof/${{ matrix.artifact }}.txt - # Upload results artifact - - name: Upload Results Artifact - uses: actions/upload-artifact@v7 - with: - name: result-${{ matrix.artifact }} - path: proofing/ink-proof/${{ matrix.artifact }}.txt + # Upload results artifact + - name: Upload Results Artifact + uses: actions/upload-artifact@v7 + with: + name: result-${{ matrix.artifact }} + path: proofing/ink-proof/${{ matrix.artifact }}.txt - # Upload website artifact - - name: Upload Ink-Proof Website Artifact - if: ${{ matrix.proof }} - uses: actions/upload-artifact@v7 - with: - name: ${{ matrix.artifact }}-www - path: proofing/ink-proof/out + # Upload website artifact + - name: Upload Ink-Proof Website Artifact + if: ${{ matrix.proof }} + uses: actions/upload-artifact@v7 + with: + name: ${{ matrix.artifact }}-www + path: proofing/ink-proof/out build-doc: name: Build Doxygen documentation @@ -226,101 +199,101 @@ jobs: env: DOXYGEN_VERSION: "1.17.0" steps: - - uses: actions/checkout@v6 - with: - submodules: true - - name: Set upt Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - name: install pyton libs - run: >- - python3 -m - pip install - pybind11-stubgen - pdoc - --user - - uses: actions/cache@v5 - id: cache-doxygen - with: - path: doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz - key: doxygen-${{ env.DOXYGEN_VERSION }} - - name: download Doxygen - if: steps.cache-doxygen.outputs.cache-hit != 'true' - run: wget https://www.doxygen.nl/files/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz - - name: Install Doxygen - run: | - sudo apt-get install graphviz -y - tar xzf doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz - cd doxygen-$DOXYGEN_VERSION/ - sudo make install - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: '3.22.x' - - name: Create Build Environment - run: cmake -E make_directory ${{github.workspace}}/build - - name: Configure CMake - working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DINKCPP_PY=ON -DINKCPP_DOC_BlueprintUE=ON - - name: Build - working-directory: ${{github.workspace}}/build - run: cmake --build . --target doc --config Release - - name: Upload - uses: actions/upload-artifact@v7 - with: - name: doxygen - path: Documentation/ + - uses: actions/checkout@v6 + with: + submodules: true + - name: Set upt Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: install pyton libs + run: >- + python3 -m + pip install + pybind11-stubgen + pdoc + --user + - uses: actions/cache@v5 + id: cache-doxygen + with: + path: doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz + key: doxygen-${{ env.DOXYGEN_VERSION }} + - name: download Doxygen + if: steps.cache-doxygen.outputs.cache-hit != 'true' + run: wget https://www.doxygen.nl/files/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz + - name: Install Doxygen + run: | + sudo apt-get install graphviz -y + tar xzf doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz + cd doxygen-$DOXYGEN_VERSION/ + sudo make install + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: "3.22.x" + - name: Create Build Environment + run: cmake -E make_directory ${{github.workspace}}/build + - name: Configure CMake + working-directory: ${{github.workspace}}/build + run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release -DINKCPP_PY=ON -DINKCPP_DOC_BlueprintUE=ON + - name: Build + working-directory: ${{github.workspace}}/build + run: cmake --build . --target doc --config Release + - name: Upload + uses: actions/upload-artifact@v7 + with: + name: doxygen + path: Documentation/ build-python: name: Build Python package needs: compilation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - with: - submodules: true - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - name: install build - run: >- - python3 -m - pip install - build - pybind11-stubgen - pdoc - pytest - --user - - name: Build python release - run: python3 -m build + - uses: actions/checkout@v6 + with: + submodules: true + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: install build + run: >- + python3 -m + pip install + build + pybind11-stubgen + pdoc + pytest + --user + - name: Build python release + run: python3 -m build - - uses: suisei-cn/actions-download-file@v1.6.0 - name: Download Inklecate - id: download_inklecate - with: - url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip - target: "inklecate/" - - name: Deploy Inkelcate - shell: bash - run: | - cd inklecate - unzip *.zip - echo "INKLECATE=${{ matrix.inklecate_pre }}$GITHUB_WORKSPACE/inklecate/inklecate${{ matrix.inklecate_post }}" >> $GITHUB_ENV + - uses: suisei-cn/actions-download-file@v1.6.0 + name: Download Inklecate + id: download_inklecate + with: + url: https://github.com/inkle/ink/releases/download/v1.1.1/inklecate_linux.zip + target: "inklecate/" + - name: Deploy Inkelcate + shell: bash + run: | + cd inklecate + unzip *.zip + echo "INKLECATE=${{ matrix.inklecate_pre }}$GITHUB_WORKSPACE/inklecate/inklecate${{ matrix.inklecate_post }}" >> $GITHUB_ENV - - name: Test python release - run: | - python3 -m pip install dist/*.whl --user - python3 -m pytest inkcpp_python/tests - - name: Remove wheel - run: | - rm dist/*.whl - - name: Upload Python files - uses: actions/upload-artifact@v7 - with: - name: python-package-distribution - path: dist/ + - name: Test python release + run: | + python3 -m pip install dist/*.whl --user + python3 -m pytest inkcpp_python/tests + - name: Remove wheel + run: | + rm dist/*.whl + - name: Upload Python files + uses: actions/upload-artifact@v7 + with: + name: python-package-distribution + path: dist/ clang-format: name: "Check Formatting" @@ -346,7 +319,7 @@ jobs: permissions: contents: write name: "Upload Ink-Proof to Github Pages" - needs: [ compilation, build-doc ] + needs: [compilation, build-doc] runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' steps: diff --git a/inkcpp/include/functional.h b/inkcpp/include/functional.h index db354121..21da2b43 100644 --- a/inkcpp/include/functional.h +++ b/inkcpp/include/functional.h @@ -72,9 +72,13 @@ class callback final : public callback_base static_cast(type), static_cast(new_val.type) ); if constexpr (traits::arity == 2) { - // inkAssert(!old_val.has_value() || old_val.value().type == type, - // "Missmatch type for variable observers old value: expected optional<%i> got - // optional<%i>", static_cast(type), static_cast(old_val.value().type)); + if (old_val.has_value() && old_val.value().type != type) { + inkFail( + "Missmatch type for variable observers old value: expected optional<%i> got " + "optional<%i>", + static_cast(type), static_cast(old_val.value().type) + ); + } } }; if constexpr (traits::arity > 0) { @@ -132,12 +136,10 @@ class function_base // TODO: remove ? #ifdef INK_ENABLE_UNREAL virtual void - call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists) - = 0; + call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists) = 0; #else virtual void - call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists) - = 0; + call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists) = 0; #endif bool lookaheadSafe() const { return _lookaheadSafe; } @@ -176,9 +178,7 @@ class function : public function_base virtual void call( basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists ) override - { - call(stack, length, strings, lists, GenSeq()); - } + { call(stack, length, strings, lists, GenSeq()); } private: // Callable functor object @@ -210,8 +210,9 @@ class function : public function_base } template - void - call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists, seq) + void call( + basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists, seq + ) { inkAssert( is_array_call() || sizeof...(Is) == length, diff --git a/inkcpp/string_operations.cpp b/inkcpp/string_operations.cpp index befe1041..d2de0a03 100644 --- a/inkcpp/string_operations.cpp +++ b/inkcpp/string_operations.cpp @@ -31,15 +31,13 @@ namespace casting const char* get() const { return _str; } private: - const value& _val; - const char* _str; - char _data[512]; // TODO define central + const char* _str; + char _data[512]; // TODO define central }; // constructor for string_cast class string_cast::string_cast(const value& val) - : _val{val} - , _str{nullptr} + : _str{nullptr} { if (val.type() == value_type::string) { // reference string if value is already a string diff --git a/inkcpp_c/tests/Globals.c b/inkcpp_c/tests/Globals.c index d6f02f8f..84824e37 100644 --- a/inkcpp_c/tests/Globals.c +++ b/inkcpp_c/tests/Globals.c @@ -1,7 +1,5 @@ #include #include -#include -#include #include @@ -12,7 +10,7 @@ HInkStory* story = NULL; HInkGlobals* store = NULL; HInkRunner* thread = NULL; -void setup() +void setup(void) { if (! story) { story = ink_story_from_file(INK_TEST_RESOURCE_DIR "GlobalStory.bin"); @@ -27,7 +25,7 @@ void setup() thread = ink_story_new_runner(story, store); } -int main() +int main(void) { //====== Just reading Globals ===== setup(); @@ -57,7 +55,7 @@ int main() val.int32_v = 30; assert(ink_globals_set(store, "age", val)); - // set value of 'friendl_name_of_player' + // set value of 'friendly_name_of_player' val.type = ValueTypeString; val.string_v = "Freddy"; assert(ink_globals_set(store, "friendly_name_of_player", val)); diff --git a/inkcpp_c/tests/Observer.c b/inkcpp_c/tests/Observer.c index b809eaf1..28f101a2 100644 --- a/inkcpp_c/tests/Observer.c +++ b/inkcpp_c/tests/Observer.c @@ -1,7 +1,5 @@ #include #include -#include -#include #include @@ -21,7 +19,7 @@ void observer(InkValue new_value, InkValue old_value) } } -int main() +int main(void) { HInkStory* story = ink_story_from_file(INK_TEST_RESOURCE_DIR "ObserverStory.bin"); HInkGlobals* store = ink_story_new_globals(story); diff --git a/inkcpp_c/tests/Snapshot.c b/inkcpp_c/tests/Snapshot.c index fcfaa59a..8d525d32 100644 --- a/inkcpp_c/tests/Snapshot.c +++ b/inkcpp_c/tests/Snapshot.c @@ -1,7 +1,5 @@ #include #include -#include -#include #include @@ -22,7 +20,7 @@ void check_end(HInkRunner* runner) assert(strcmp(ink_choice_text(ink_runner_get_choice(RUNNER, IDX)), STR) == 0) #define CHECK_NEXT_LINE(RUNNER, STR) assert(strcmp(ink_runner_get_line(RUNNER), STR) == 0) -int main() +int main(void) { { HInkStory* story = ink_story_from_file(INK_TEST_RESOURCE_DIR "SimpleStoryFlow.bin"); @@ -41,7 +39,7 @@ int main() ++cnt; } - // snapshot befroe choose, context (last output lines) can not bet optained at loading + // snapshot before choose, context (last output lines) can not bet obtained at loading HInkSnapshot* snap2 = ink_runner_create_snapshot(runner); check_end(runner); diff --git a/inkcpp_c/tests/Tags.c b/inkcpp_c/tests/Tags.c index 81b46ae0..546d57ad 100644 --- a/inkcpp_c/tests/Tags.c +++ b/inkcpp_c/tests/Tags.c @@ -1,5 +1,4 @@ #include -#include #include #include @@ -7,7 +6,7 @@ #undef NDEBUG #include -int main() +int main(void) { HInkStory* story = ink_story_from_file(INK_TEST_RESOURCE_DIR "TagsStory.bin"); HInkGlobals* store = ink_story_new_globals(story); diff --git a/inkcpp_test/Observer.cpp b/inkcpp_test/Observer.cpp index d5fd05fd..4c30ab65 100644 --- a/inkcpp_test/Observer.cpp +++ b/inkcpp_test/Observer.cpp @@ -154,7 +154,7 @@ SCENARIO("Observer", "[observer][globals][runtime]") CHECK_FALSE(o_i.has_value()); } else { CHECK(i == 5); - CHECK(o_i.has_value()); + REQUIRE(o_i.has_value()); CHECK(o_i.value() == 1); } }; @@ -167,7 +167,7 @@ SCENARIO("Observer", "[observer][globals][runtime]") CHECK_FALSE(o_v.has_value()); } else { CHECK(str == "test"); - CHECK(o_v.has_value()); + REQUIRE(o_v.has_value()); CHECK(o_v.value().type == value::Type::String); std::string str2(o_v.value().get()); CHECK(str2 == "hello"); diff --git a/proofing/diff_py-codecs.patch b/proofing/diff_py-codecs.patch new file mode 100644 index 00000000..e6984bd9 --- /dev/null +++ b/proofing/diff_py-codecs.patch @@ -0,0 +1,23 @@ +diff --git a/diff.py b/diff.py +index 115bf2c..320607d 100644 +--- a/diff.py ++++ b/diff.py +@@ -1,7 +1,6 @@ + #!/usr/bin/env python3 + + import sys +-import codecs + from difflib import unified_diff + + if len(sys.argv) != 3: +@@ -9,8 +8,8 @@ if len(sys.argv) != 3: + + _, a, b = sys.argv + +-a_lines = codecs.open(a, encoding='utf-8-sig').read().splitlines() +-b_lines = codecs.open(b, encoding='utf-8-sig').read().splitlines() ++a_lines = open(a, encoding="utf-8-sig").read().splitlines() ++b_lines = open(b, encoding="utf-8-sig").read().splitlines() + + + out_lines = list(unified_diff(a_lines, b_lines, fromfile=a, tofile=b, lineterm="")) From 24f1e1a62883f24ae1ded8c9470f40d86b4c57a9 Mon Sep 17 00:00:00 2001 From: JBenda Date: Thu, 2 Jul 2026 17:11:46 +0200 Subject: [PATCH 4/4] style: autoformat --- inkcpp/include/functional.h | 15 ++++---- inkcpp/include/types.h | 4 ++- inkcpp/operations.h | 5 ++- inkcpp/value.h | 72 +++++++++++++++++++++++++++---------- inkcpp_test/Observer.cpp | 16 ++++----- 5 files changed, 78 insertions(+), 34 deletions(-) diff --git a/inkcpp/include/functional.h b/inkcpp/include/functional.h index 21da2b43..99309900 100644 --- a/inkcpp/include/functional.h +++ b/inkcpp/include/functional.h @@ -136,10 +136,12 @@ class function_base // TODO: remove ? #ifdef INK_ENABLE_UNREAL virtual void - call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists) = 0; + call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists) + = 0; #else virtual void - call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists) = 0; + call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists) + = 0; #endif bool lookaheadSafe() const { return _lookaheadSafe; } @@ -178,7 +180,9 @@ class function : public function_base virtual void call( basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists ) override - { call(stack, length, strings, lists, GenSeq()); } + { + call(stack, length, strings, lists, GenSeq()); + } private: // Callable functor object @@ -210,9 +214,8 @@ class function : public function_base } template - void call( - basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists, seq - ) + void + call(basic_eval_stack* stack, size_t length, string_table& strings, list_table& lists, seq) { inkAssert( is_array_call() || sizeof...(Is) == length, diff --git a/inkcpp/include/types.h b/inkcpp/include/types.h index 31d9ad0c..0610980f 100644 --- a/inkcpp/include/types.h +++ b/inkcpp/include/types.h @@ -139,7 +139,9 @@ struct value { */ template const auto& get() const - { static_assert(Ty != Ty, "No value getter for the selected type"); } + { + static_assert(Ty != Ty, "No value getter for the selected type"); + } #ifdef __GNUCC__ # pragma GCC diagnostic pop #endif diff --git a/inkcpp/operations.h b/inkcpp/operations.h index 59c5657a..5b6b42f5 100644 --- a/inkcpp/operations.h +++ b/inkcpp/operations.h @@ -69,7 +69,10 @@ class operation * @param stack were the result(s) get pushed * @param vs array of values, first one = first argument etc */ - void operator()(basic_eval_stack& /*stack*/, value* /*vs*/) { inkFail("operation not implemented!"); } + void operator()(basic_eval_stack& /*stack*/, value* /*vs*/) + { + inkFail("operation not implemented!"); + } }; } // namespace ink::runtime::internal diff --git a/inkcpp/value.h b/inkcpp/value.h index e0ccc053..46b56eec 100644 --- a/inkcpp/value.h +++ b/inkcpp/value.h @@ -60,11 +60,15 @@ enum class value_type { // add operator for value_type (to simplify usage templates). constexpr value_type operator+(value_type t, int i) -{ return static_cast(static_cast(t) + i); } +{ + return static_cast(static_cast(t) + i); +} // add operator for Command (to simplify usage in templates). constexpr Command operator+(Command c, int i) -{ return static_cast(static_cast(c) + i); } +{ + return static_cast(static_cast(c) + i); +} struct string_type { constexpr string_type(const char* string, bool allocated) @@ -137,7 +141,9 @@ class value : public snapshot_interface /// get value of the type (if possible) template typename ret::type get() const - { static_assert(ty != ty, "No getter for this type defined!"); } + { + static_assert(ty != ty, "No getter for this type defined!"); + } #ifdef __GNUCC__ # pragma GCC diagnostic pop @@ -159,7 +165,9 @@ class value : public snapshot_interface /// returns if type is printable (see value_type) constexpr bool printable() const - { return _type >= value_type::PRINT_BEGIN && _type < value_type::PRINT_END; } + { + return _type >= value_type::PRINT_BEGIN && _type < value_type::PRINT_END; + } friend basic_stream& operator<<(basic_stream& os, const value&); // friend basic_stream& operator>>(basic_stream& is, value&); // TODO: implement @@ -234,7 +242,9 @@ class value : public snapshot_interface template value redefine::operator()(const T&, const T& rh) -{ return value{}.set(rh); } +{ + return value{}.set(rh); +} // define get and set for int32 template<> @@ -244,7 +254,9 @@ struct value::ret { template<> inline int32_t value::get() const -{ return int32_value; } +{ + return int32_value; +} template<> inline constexpr value& value::set(int32_t v) @@ -262,7 +274,9 @@ struct value::ret { template<> inline uint32_t value::get() const -{ return uint32_value; } +{ + return uint32_value; +} template<> inline constexpr value& value::set(uint32_t v) @@ -280,7 +294,9 @@ struct value::ret { template<> inline uint32_t value::get() const -{ return uint32_value; } +{ + return uint32_value; +} template<> inline constexpr value& value::set(uint32_t v) @@ -298,7 +314,9 @@ struct value::ret { template<> inline float value::get() const -{ return float_value; } +{ + return float_value; +} template<> inline constexpr value& value::set(float v) @@ -316,7 +334,9 @@ struct value::ret { template<> inline bool value::get() const -{ return bool_value; } +{ + return bool_value; +} template<> inline constexpr value& value::set(bool v) @@ -342,7 +362,9 @@ struct value::ret { template<> inline list_table::list value::get() const -{ return list_value; } +{ + return list_value; +} template<> inline constexpr value& value::set(list_table::list list) @@ -360,7 +382,9 @@ struct value::ret { template<> inline list_flag value::get() const -{ return list_flag_value; } +{ + return list_flag_value; +} template<> inline constexpr value& value::set(list_flag flag) @@ -378,7 +402,9 @@ struct value::ret { template<> inline string_type value::get() const -{ return string_value; } +{ + return string_value; +} template<> inline constexpr value& value::set(const char* v) @@ -429,7 +455,9 @@ struct value::ret { template<> inline value::ret::type value::get() const -{ return pointer; } +{ + return pointer; +} template<> inline constexpr value& value::set(hash_t name, int ci) @@ -448,7 +476,9 @@ struct value::ret { template<> inline value::ret::type value::get() const -{ return jump; } +{ + return jump; +} template<> inline constexpr value& @@ -477,7 +507,9 @@ struct value::ret { template<> inline value::ret::type value::get() const -{ return jump; } +{ + return jump; +} template<> inline constexpr value& @@ -506,7 +538,9 @@ struct value::ret { template<> inline uint32_t value::get() const -{ return uint32_value; } +{ + return uint32_value; +} template<> inline constexpr value& value::set(uint32_t v) @@ -595,7 +629,9 @@ struct value::ret { template<> inline typename value::ret::type value::get() const -{ return frame_value; } +{ + return frame_value; +} template<> inline constexpr value& value::set(uint32_t v, bool evalOn) diff --git a/inkcpp_test/Observer.cpp b/inkcpp_test/Observer.cpp index 4c30ab65..66069244 100644 --- a/inkcpp_test/Observer.cpp +++ b/inkcpp_test/Observer.cpp @@ -154,9 +154,9 @@ SCENARIO("Observer", "[observer][globals][runtime]") CHECK_FALSE(o_i.has_value()); } else { CHECK(i == 5); - REQUIRE(o_i.has_value()); - CHECK(o_i.value() == 1); - } + REQUIRE(o_i.has_value()); + CHECK(o_i.value() == 1); + } }; int var2_cnt = 0; auto var2 = [&var2_cnt](value v, ink::optional o_v) { @@ -167,11 +167,11 @@ SCENARIO("Observer", "[observer][globals][runtime]") CHECK_FALSE(o_v.has_value()); } else { CHECK(str == "test"); - REQUIRE(o_v.has_value()); - CHECK(o_v.value().type == value::Type::String); - std::string str2(o_v.value().get()); - CHECK(str2 == "hello"); - } + REQUIRE(o_v.has_value()); + CHECK(o_v.value().type == value::Type::String); + std::string str2(o_v.value().get()); + CHECK(str2 == "hello"); + } }; globals->observe("var1", var1);